Files
olons_admin/server/internal/dao/internal/withdrawal_order.go
T
2026-10-10 20:56:17 +08:00

136 lines
5.3 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"
)
// WithdrawalOrderDao is the data access object for the table hg_withdrawal_order.
type WithdrawalOrderDao 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 WithdrawalOrderColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// WithdrawalOrderColumns defines and stores column names for the table hg_withdrawal_order.
type WithdrawalOrderColumns struct {
Id string // 主键
TenantId string // 租户ID
WithdrawalNo string // 提现单号
MemberId string // 会员ID
PaymentAccountId string // 收款账户ID
ChannelId string // 付款渠道ID
RequestAmount string // 申请金额(分)
FeeAmount string // 手续费(分)
ActualAmount string // 实际到账(分)
Currency string // 币种
AccountSnapshotCipher string // 收款账户加密快照
AccountMask string // 收款账户脱敏快照
BankName string // 银行名称快照
HolderMask string // 开户名脱敏快照
RiskResult string // 风控结果摘要
WithdrawalStatus string // 提现状态
ReviewReasonCode string // 审核原因编码
ReviewReason string // 审核意见
ApprovalRequestId string // 审批单ID
ExternalNo string // 外部付款单号
FreezeLedgerId string // 冻结台账ID
FinalLedgerId string // 完成或解冻台账ID
ReviewedAt string // 审核时间
ProcessedAt string // 处理时间
CompletedAt string // 完成时间
CreatedBy string // 创建者
UpdatedBy string // 更新者
CreatedAt string // 发起时间
UpdatedAt string // 更新时间
}
// withdrawalOrderColumns holds the columns for the table hg_withdrawal_order.
var withdrawalOrderColumns = WithdrawalOrderColumns{
Id: "id",
TenantId: "tenant_id",
WithdrawalNo: "withdrawal_no",
MemberId: "member_id",
PaymentAccountId: "payment_account_id",
ChannelId: "channel_id",
RequestAmount: "request_amount",
FeeAmount: "fee_amount",
ActualAmount: "actual_amount",
Currency: "currency",
AccountSnapshotCipher: "account_snapshot_cipher",
AccountMask: "account_mask",
BankName: "bank_name",
HolderMask: "holder_mask",
RiskResult: "risk_result",
WithdrawalStatus: "withdrawal_status",
ReviewReasonCode: "review_reason_code",
ReviewReason: "review_reason",
ApprovalRequestId: "approval_request_id",
ExternalNo: "external_no",
FreezeLedgerId: "freeze_ledger_id",
FinalLedgerId: "final_ledger_id",
ReviewedAt: "reviewed_at",
ProcessedAt: "processed_at",
CompletedAt: "completed_at",
CreatedBy: "created_by",
UpdatedBy: "updated_by",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
}
// NewWithdrawalOrderDao creates and returns a new DAO object for table data access.
func NewWithdrawalOrderDao(handlers ...gdb.ModelHandler) *WithdrawalOrderDao {
return &WithdrawalOrderDao{
group: "default",
table: "hg_withdrawal_order",
columns: withdrawalOrderColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *WithdrawalOrderDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *WithdrawalOrderDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *WithdrawalOrderDao) Columns() WithdrawalOrderColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *WithdrawalOrderDao) 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 *WithdrawalOrderDao) 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 *WithdrawalOrderDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}