126 lines
4.8 KiB
Go
126 lines
4.8 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"
|
|
)
|
|
|
|
// TaskSubmissionDao is the data access object for the table hg_task_submission.
|
|
type TaskSubmissionDao 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 TaskSubmissionColumns // columns contains all the column names of Table for convenient usage.
|
|
handlers []gdb.ModelHandler // handlers for customized model modification.
|
|
}
|
|
|
|
// TaskSubmissionColumns defines and stores column names for the table hg_task_submission.
|
|
type TaskSubmissionColumns struct {
|
|
Id string // 主键
|
|
TenantId string // 租户ID
|
|
SubmissionNo string // 提交编号
|
|
TradeOrderId string // 交易订单ID
|
|
TaskId string // 任务ID
|
|
MemberId string // 会员ID
|
|
MemberLevelId string // 提交时等级ID
|
|
EvidenceText string // 证据说明
|
|
EvidenceAttachmentIds string // 证据附件
|
|
SubmissionStatus string // 1待审 2通过 3驳回 4已结算 5已冲正
|
|
CommissionAmount string // 佣金快照(分)
|
|
SuccessRate string // 成功率万分比
|
|
ReviewedBy string // 审核人
|
|
ReviewedAt string // 审核时间
|
|
ReviewReasonCode string // 标准原因
|
|
ReviewReason string // 审核意见
|
|
AllowResubmit string // 是否允许重提
|
|
LedgerId string // 佣金台账ID
|
|
SettledAt string // 结算时间
|
|
ReversalApprovalId string // 冲正审批ID
|
|
CreatedBy string // 创建者
|
|
UpdatedBy string // 更新者
|
|
CreatedAt string // 创建时间
|
|
UpdatedAt string // 更新时间
|
|
}
|
|
|
|
// taskSubmissionColumns holds the columns for the table hg_task_submission.
|
|
var taskSubmissionColumns = TaskSubmissionColumns{
|
|
Id: "id",
|
|
TenantId: "tenant_id",
|
|
SubmissionNo: "submission_no",
|
|
TradeOrderId: "trade_order_id",
|
|
TaskId: "task_id",
|
|
MemberId: "member_id",
|
|
MemberLevelId: "member_level_id",
|
|
EvidenceText: "evidence_text",
|
|
EvidenceAttachmentIds: "evidence_attachment_ids",
|
|
SubmissionStatus: "submission_status",
|
|
CommissionAmount: "commission_amount",
|
|
SuccessRate: "success_rate",
|
|
ReviewedBy: "reviewed_by",
|
|
ReviewedAt: "reviewed_at",
|
|
ReviewReasonCode: "review_reason_code",
|
|
ReviewReason: "review_reason",
|
|
AllowResubmit: "allow_resubmit",
|
|
LedgerId: "ledger_id",
|
|
SettledAt: "settled_at",
|
|
ReversalApprovalId: "reversal_approval_id",
|
|
CreatedBy: "created_by",
|
|
UpdatedBy: "updated_by",
|
|
CreatedAt: "created_at",
|
|
UpdatedAt: "updated_at",
|
|
}
|
|
|
|
// NewTaskSubmissionDao creates and returns a new DAO object for table data access.
|
|
func NewTaskSubmissionDao(handlers ...gdb.ModelHandler) *TaskSubmissionDao {
|
|
return &TaskSubmissionDao{
|
|
group: "default",
|
|
table: "hg_task_submission",
|
|
columns: taskSubmissionColumns,
|
|
handlers: handlers,
|
|
}
|
|
}
|
|
|
|
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
|
func (dao *TaskSubmissionDao) DB() gdb.DB {
|
|
return g.DB(dao.group)
|
|
}
|
|
|
|
// Table returns the table name of the current DAO.
|
|
func (dao *TaskSubmissionDao) Table() string {
|
|
return dao.table
|
|
}
|
|
|
|
// Columns returns all column names of the current DAO.
|
|
func (dao *TaskSubmissionDao) Columns() TaskSubmissionColumns {
|
|
return dao.columns
|
|
}
|
|
|
|
// Group returns the database configuration group name of the current DAO.
|
|
func (dao *TaskSubmissionDao) 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 *TaskSubmissionDao) 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 *TaskSubmissionDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
|
return dao.Ctx(ctx).Transaction(ctx, f)
|
|
}
|