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

134 lines
5.9 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"
)
// TConsumeAccountMonthBillDao is the data access object for the table t_consume_account_month_bill.
type TConsumeAccountMonthBillDao 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 TConsumeAccountMonthBillColumns // columns contains all the column names of Table for convenient usage.
handlers []gdb.ModelHandler // handlers for customized model modification.
}
// TConsumeAccountMonthBillColumns defines and stores column names for the table t_consume_account_month_bill.
type TConsumeAccountMonthBillColumns struct {
Id string // 账单ID
DeptId string // 机构ID
AccountPeriod string // 账期YYYY-MM
OpeningBalance string // 月初余额
RechargeIncome string // 充值收入
WithdrawableTransferInIncome string // 可提现转入收入
ManualAdjustIncome string // 人工调账收入
RefundIncome string // 退款收入
ConsumeExpense string // 平台消费支出
BalanceTransferOutExpense string // 转可提现支出
ManualAdjustExpense string // 人工调账支出
ConsumeCreditRepayExpense string // 消费账户还款支出
TotalIncome string // 本月收入总额
TotalExpense string // 本月支出总额
ClosingBalance string // 月末余额(月初余额+本月收入-本月支出)
IncomeCount string // 收入笔数
ExpenseCount string // 支出笔数
CreditUsed string // 本月使用信用额度
CreditRepaid string // 本月还款信用额度
BillStatus string // 账单状态:1正常,2已调整,3已作废
SettleTime string // 结算时间
Remark string // 备注
TenantId string // 租户ID
CreatedDept string // 创建部门
CreatedBy string // 创建者
CreatedAt string // 创建时间
UpdatedBy string // 更新者
UpdatedAt string // 更新时间
}
// tConsumeAccountMonthBillColumns holds the columns for the table t_consume_account_month_bill.
var tConsumeAccountMonthBillColumns = TConsumeAccountMonthBillColumns{
Id: "id",
DeptId: "dept_id",
AccountPeriod: "account_period",
OpeningBalance: "opening_balance",
RechargeIncome: "recharge_income",
WithdrawableTransferInIncome: "withdrawable_transfer_in_income",
ManualAdjustIncome: "manual_adjust_income",
RefundIncome: "refund_income",
ConsumeExpense: "consume_expense",
BalanceTransferOutExpense: "balance_transfer_out_expense",
ManualAdjustExpense: "manual_adjust_expense",
ConsumeCreditRepayExpense: "consume_credit_repay_expense",
TotalIncome: "total_income",
TotalExpense: "total_expense",
ClosingBalance: "closing_balance",
IncomeCount: "income_count",
ExpenseCount: "expense_count",
CreditUsed: "credit_used",
CreditRepaid: "credit_repaid",
BillStatus: "bill_status",
SettleTime: "settle_time",
Remark: "remark",
TenantId: "tenant_id",
CreatedDept: "created_dept",
CreatedBy: "created_by",
CreatedAt: "created_at",
UpdatedBy: "updated_by",
UpdatedAt: "updated_at",
}
// NewTConsumeAccountMonthBillDao creates and returns a new DAO object for table data access.
func NewTConsumeAccountMonthBillDao(handlers ...gdb.ModelHandler) *TConsumeAccountMonthBillDao {
return &TConsumeAccountMonthBillDao{
group: "default",
table: "t_consume_account_month_bill",
columns: tConsumeAccountMonthBillColumns,
handlers: handlers,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *TConsumeAccountMonthBillDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *TConsumeAccountMonthBillDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *TConsumeAccountMonthBillDao) Columns() TConsumeAccountMonthBillColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *TConsumeAccountMonthBillDao) 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 *TConsumeAccountMonthBillDao) 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 *TConsumeAccountMonthBillDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}