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

142 lines
5.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"
)
// TResourceBatchDownloadDao is the data access object for the table t_resource_batch_download.
type TResourceBatchDownloadDao 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 TResourceBatchDownloadColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TResourceBatchDownloadColumns defines and stores column names for the table t_resource_batch_download.
type TResourceBatchDownloadColumns struct {
Id string // 主键ID
BatchNo string // 批次编号(全局唯一)
TaskName string // 任务名称
ResourceType string // 资源类型 枚举
ExportScene string // 导出场景 枚举
QueryParams string // 导出查询条件快照
TotalCount string // 预计导出总条数
SuccessCount string // 已成功导出条数
FailCount string // 失败条数
DownloadStatus string // 下载状态 枚举
OssId string // OSS文件ID
FileName string // 导出文件名
FileExt string // 文件扩展名
FileUrl string // 文件访问地址
FilePath string // 服务器本地路径
FileSize string // 文件大小(字节)
FileMd5 string // 文件MD5
DownloadCount string // 下载次数
LastDownloadTime string // 最后下载时间
MaxDownloadCount string // 最大下载次数限制
ErrorMessage string // 失败原因
DeptId string // 所属机构ID
StartTime string // 任务开始时间
FinishTime string // 任务完成时间
ExpireTime string // 文件过期时间
Remark string // 备注
TenantId string // 租户ID
CreatedDept string // 创建部门ID
CreatedBy string // 创建者ID
CreatedAt string // 创建时间
UpdatedBy string // 更新者ID
UpdatedAt string // 更新时间
}
// tResourceBatchDownloadColumns holds the columns for the table t_resource_batch_download.
var tResourceBatchDownloadColumns = TResourceBatchDownloadColumns{
Id: "id",
BatchNo: "batch_no",
TaskName: "task_name",
ResourceType: "resource_type",
ExportScene: "export_scene",
QueryParams: "query_params",
TotalCount: "total_count",
SuccessCount: "success_count",
FailCount: "fail_count",
DownloadStatus: "download_status",
OssId: "oss_id",
FileName: "file_name",
FileExt: "file_ext",
FileUrl: "file_url",
FilePath: "file_path",
FileSize: "file_size",
FileMd5: "file_md5",
DownloadCount: "download_count",
LastDownloadTime: "last_download_time",
MaxDownloadCount: "max_download_count",
ErrorMessage: "error_message",
DeptId: "dept_id",
StartTime: "start_time",
FinishTime: "finish_time",
ExpireTime: "expire_time",
Remark: "remark",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTResourceBatchDownloadDao creates and returns a new DAO object for table data access.
func NewTResourceBatchDownloadDao(handlers ...gdb.ModelHandler) *TResourceBatchDownloadDao {
return &TResourceBatchDownloadDao{
group: "default",
table: "t_resource_batch_download",
columns: tResourceBatchDownloadColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TResourceBatchDownloadDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TResourceBatchDownloadDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TResourceBatchDownloadDao) Columns() TResourceBatchDownloadColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TResourceBatchDownloadDao) 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 *TResourceBatchDownloadDao) 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.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *TResourceBatchDownloadDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}