Files
iotlcm/openapi/internal/dao/internal/t_profit_account_month_bill.go
T

126 lines
5.5 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"
)
// TProfitAccountMonthBillDao is the data access object for the table t_profit_account_month_bill.
type TProfitAccountMonthBillDao 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 TProfitAccountMonthBillColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TProfitAccountMonthBillColumns defines and stores column names for the table t_profit_account_month_bill.
type TProfitAccountMonthBillColumns struct {
Id string // 账单ID
DeptId string // 机构ID
AccountPeriod string // 账期YYYY-MM
OpeningBalance string // 月初余额
CommissionIncome string // 分润收入
BalanceTransferInIncome string // 余额转提现收入
WithdrawalExpense string // 提现支出
WithdrawableTransferOutExpense string // 可提现转余额支出
ProfitCreditRepayExpense string // 盈利账户还款支出
TotalIncome string // 本月收入总额
TotalExpense string // 本月支出总额
ClosingBalance string // 月末余额(月初余额+本月收入-本月支出)
IncomeCount string // 收入笔数
ExpenseCount string // 支出笔数
BillStatus string // 账单状态:1正常,2已调整,3已作废
SettleTime string // 结算时间
SettleBy string // 结算人ID
Remark string // 备注
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tProfitAccountMonthBillColumns holds the columns for the table t_profit_account_month_bill.
var tProfitAccountMonthBillColumns = TProfitAccountMonthBillColumns{
Id: "id",
DeptId: "dept_id",
AccountPeriod: "account_period",
OpeningBalance: "opening_balance",
CommissionIncome: "commission_income",
BalanceTransferInIncome: "balance_transfer_in_income",
WithdrawalExpense: "withdrawal_expense",
WithdrawableTransferOutExpense: "withdrawable_transfer_out_expense",
ProfitCreditRepayExpense: "profit_credit_repay_expense",
TotalIncome: "total_income",
TotalExpense: "total_expense",
ClosingBalance: "closing_balance",
IncomeCount: "income_count",
ExpenseCount: "expense_count",
BillStatus: "bill_status",
SettleTime: "settle_time",
SettleBy: "settle_by",
Remark: "remark",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTProfitAccountMonthBillDao creates and returns a new DAO object for table data access.
func NewTProfitAccountMonthBillDao(handlers ...gdb.ModelHandler) *TProfitAccountMonthBillDao {
return &TProfitAccountMonthBillDao{
group: "default",
table: "t_profit_account_month_bill",
columns: tProfitAccountMonthBillColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TProfitAccountMonthBillDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TProfitAccountMonthBillDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TProfitAccountMonthBillDao) Columns() TProfitAccountMonthBillColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TProfitAccountMonthBillDao) 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 *TProfitAccountMonthBillDao) 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 *TProfitAccountMonthBillDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}