120 lines
4.7 KiB
Go
120 lines
4.7 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"
|
|
)
|
|
|
|
// TFinWithdrawableChangeDao is the data access object for the table t_fin_withdrawable_change.
|
|
type TFinWithdrawableChangeDao 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 TFinWithdrawableChangeColumns // columns contains all the column names of Table for convenient usage.
|
|
handlers []gdb.ModelHandler // handlers for customized model modification.
|
|
}
|
|
|
|
// TFinWithdrawableChangeColumns defines and stores column names for the table t_fin_withdrawable_change.
|
|
type TFinWithdrawableChangeColumns struct {
|
|
Id string // 主键ID
|
|
DeptId string // 机构ID
|
|
ChangeType string // 变动类型:0分润,1提现,2转出(可提现转余额)3转入(余额转可提现)4还款
|
|
IncomeExpenseType string // 收支类型: 0收入,1支出
|
|
ChangeAmount string // 变动金额
|
|
BeforeBalance string // 变动前可提现余额
|
|
AfterBalance string // 变动后可提现余额
|
|
AccountType string // 提现账号类型,1:银行卡,2:支付宝,3:微信
|
|
BankName string // 开户行名称
|
|
BankAccount string // 开户行账号或账号
|
|
AccountName string // 用户姓名
|
|
IdentityCard string // 用户身份证号
|
|
SourceNo string // 来源单号
|
|
Remark string // 备注
|
|
AccountPeriod string // 账期(YYYY-MM)
|
|
TenantId string // 租户ID
|
|
CreatedDept string // 创建部门
|
|
CreatedBy string // 创建者
|
|
CreatedAt string // 创建时间
|
|
UpdatedBy string // 更新者
|
|
UpdatedAt string // 更新时间
|
|
}
|
|
|
|
// tFinWithdrawableChangeColumns holds the columns for the table t_fin_withdrawable_change.
|
|
var tFinWithdrawableChangeColumns = TFinWithdrawableChangeColumns{
|
|
Id: "id",
|
|
DeptId: "dept_id",
|
|
ChangeType: "change_type",
|
|
IncomeExpenseType: "income_expense_type",
|
|
ChangeAmount: "change_amount",
|
|
BeforeBalance: "before_balance",
|
|
AfterBalance: "after_balance",
|
|
AccountType: "account_type",
|
|
BankName: "bank_name",
|
|
BankAccount: "bank_account",
|
|
AccountName: "account_name",
|
|
IdentityCard: "identity_card",
|
|
SourceNo: "source_no",
|
|
Remark: "remark",
|
|
AccountPeriod: "account_period",
|
|
TenantId: "tenant_id",
|
|
CreatedDept: "created_dept",
|
|
CreatedBy: "created_by",
|
|
CreatedAt: "created_at",
|
|
UpdatedBy: "updated_by",
|
|
UpdatedAt: "updated_at",
|
|
}
|
|
|
|
// NewTFinWithdrawableChangeDao creates and returns a new DAO object for table data access.
|
|
func NewTFinWithdrawableChangeDao(handlers ...gdb.ModelHandler) *TFinWithdrawableChangeDao {
|
|
return &TFinWithdrawableChangeDao{
|
|
group: "default",
|
|
table: "t_fin_withdrawable_change",
|
|
columns: tFinWithdrawableChangeColumns,
|
|
handlers: handlers,
|
|
}
|
|
}
|
|
|
|
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
|
func (dao *TFinWithdrawableChangeDao) DB() gdb.DB {
|
|
return g.DB(dao.group)
|
|
}
|
|
|
|
// Table returns the table name of the current DAO.
|
|
func (dao *TFinWithdrawableChangeDao) Table() string {
|
|
return dao.table
|
|
}
|
|
|
|
// Columns returns all column names of the current DAO.
|
|
func (dao *TFinWithdrawableChangeDao) Columns() TFinWithdrawableChangeColumns {
|
|
return dao.columns
|
|
}
|
|
|
|
// Group returns the database configuration group name of the current DAO.
|
|
func (dao *TFinWithdrawableChangeDao) 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 *TFinWithdrawableChangeDao) 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 *TFinWithdrawableChangeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
|
return dao.Ctx(ctx).Transaction(ctx, f)
|
|
}
|