Files
iotlcm/admin-svr/server/internal/dao/internal/t_export_task.go
T

129 lines
4.4 KiB
Go

// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// TExportTaskDao is the data access object for the table t_export_task.
type TExportTaskDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns TExportTaskColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TExportTaskColumns defines and stores column names for the table t_export_task.
type TExportTaskColumns struct {
Id string // 主键ID
TaskNo string // 任务编号
BizKey string // 业务标识
BizName string // 业务名称
PermCode string // 导出权限码快照
QueryParams string // 筛选条件快照
IdentitySnapshot string // 提交时用户身份与角色范围快照
Status string // 状态
TotalCount string // 导出总行数
OssId string // OSS文件ID
FileName string // 文件名
FileSize string // 文件大小
FileMd5 string // 文件MD5
DownloadCount string // 下载次数
LastDownloadTime string // 最后下载时间
ErrorMessage string // 失败原因
OwnerUserId string // 发起用户ID
DeptId string // 机构ID
TenantId string // 租户ID
CreatedDept string // 创建部门ID
CreatedBy string // 创建者ID
CreatedAt string // 创建时间
StartTime string // 开始生成时间
FinishTime string // 完成/失败时间
ExpireTime string // 文件过期时间
DeletedTime string // 文件清理时间
DeleteReason string // 清理原因
UpdatedAt string // 更新时间
}
// tExportTaskColumns holds the columns for the table t_export_task.
var tExportTaskColumns = TExportTaskColumns{
Id: "id",
TaskNo: "task_no",
BizKey: "biz_key",
BizName: "biz_name",
PermCode: "perm_code",
QueryParams: "query_params",
IdentitySnapshot: "identity_snapshot",
Status: "status",
TotalCount: "total_count",
OssId: "oss_id",
FileName: "file_name",
FileSize: "file_size",
FileMd5: "file_md5",
DownloadCount: "download_count",
LastDownloadTime: "last_download_time",
ErrorMessage: "error_message",
OwnerUserId: "owner_user_id",
DeptId: "dept_id",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
StartTime: "start_time",
FinishTime: "finish_time",
ExpireTime: "expire_time",
DeletedTime: "deleted_time",
DeleteReason: "delete_reason",
UpdatedAt: "updated_at",
}
// NewTExportTaskDao creates and returns a new DAO object for table data access.
func NewTExportTaskDao(handlers ...gdb.ModelHandler) *TExportTaskDao {
return &TExportTaskDao{
group: "default",
table: "t_export_task",
columns: tExportTaskColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TExportTaskDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TExportTaskDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TExportTaskDao) Columns() TExportTaskColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TExportTaskDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *TExportTaskDao) Ctx(ctx context.Context) *gdb.Model {
model := dao.DB().Model(dao.table)
for _, handler := range dao.handlers {
model = handler(model)
}
return model.Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
func (dao *TExportTaskDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}