younggee_invoice_info.go 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // ==========================================================================
  2. // Code generated by GoFrame CLI tool. DO NOT EDIT.
  3. // ==========================================================================
  4. package internal
  5. import (
  6. "context"
  7. "github.com/gogf/gf/database/gdb"
  8. "github.com/gogf/gf/frame/g"
  9. )
  10. // YounggeeInvoiceInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type YounggeeInvoiceInfoDao struct {
  12. Table string // Table is the underlying table name of the DAO.
  13. Group string // Group is the database configuration group name of current DAO.
  14. Columns YounggeeInvoiceInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // YounggeeInvoiceInfoColumns defines and stores column names for table younggee_invoice_info.
  17. type YounggeeInvoiceInfoColumns struct {
  18. InvoiceId string // 发票信息id
  19. EnterpriseId string // 企业id
  20. HeadType string // 抬头类型
  21. InvoiceHeader string // 发票抬头
  22. InvoiceType string // 发票类型
  23. TaxCode string // 税务登记证号/统一社会信用代码
  24. Bank string // 基本户开户银行
  25. BankCardNumber string // 基本户开户银行账号
  26. RegisteredAddress string // 企业注册地址
  27. RegisteredPhone string // 企业注册电话
  28. UpdateAt string // 更新时间
  29. }
  30. // younggeeInvoiceInfoColumns holds the columns for table younggee_invoice_info.
  31. var younggeeInvoiceInfoColumns = YounggeeInvoiceInfoColumns{
  32. InvoiceId: "invoice_id",
  33. EnterpriseId: "enterprise_id",
  34. HeadType: "head_type",
  35. InvoiceHeader: "invoice_header",
  36. InvoiceType: "invoice_type",
  37. TaxCode: "tax_code",
  38. Bank: "bank",
  39. BankCardNumber: "bank_card_number",
  40. RegisteredAddress: "registered_address",
  41. RegisteredPhone: "registered_phone",
  42. UpdateAt: "update_at",
  43. }
  44. // NewYounggeeInvoiceInfoDao creates and returns a new DAO object for table data access.
  45. func NewYounggeeInvoiceInfoDao() *YounggeeInvoiceInfoDao {
  46. return &YounggeeInvoiceInfoDao{
  47. Group: "default",
  48. Table: "younggee_invoice_info",
  49. Columns: younggeeInvoiceInfoColumns,
  50. }
  51. }
  52. // DB retrieves and returns the underlying raw database management object of current DAO.
  53. func (dao *YounggeeInvoiceInfoDao) DB() gdb.DB {
  54. return g.DB(dao.Group)
  55. }
  56. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  57. func (dao *YounggeeInvoiceInfoDao) Ctx(ctx context.Context) *gdb.Model {
  58. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  59. }
  60. // Transaction wraps the transaction logic using function f.
  61. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  62. // It commits the transaction and returns nil if function f returns nil.
  63. //
  64. // Note that, you should not Commit or Rollback the transaction in function f
  65. // as it is automatically handled by this function.
  66. func (dao *YounggeeInvoiceInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  67. return dao.Ctx(ctx).Transaction(ctx, f)
  68. }