youngee_contract_info.go 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. // YoungeeContractInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type YoungeeContractInfoDao 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 YoungeeContractInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // YoungeeContractInfoColumns defines and stores column names for table youngee_contract_info.
  17. type YoungeeContractInfoColumns struct {
  18. ContractId string // 合约id
  19. TaskId string // 任务id
  20. ProjectId string // 任务所属项目id
  21. BreakType string // 违约类型(4类严重违约):1(脚本)2(初稿)3(链接)4(数据)
  22. SettlementAmount string // 应结算金额
  23. BreakAt string // 违约时间
  24. HandleAt string // 处理时间
  25. TerminateAt string // 解约申请时间
  26. DefaultStatus string // 违约处理状态1-5分别表示为违约、已重新上传、解约待处理、解约已处理(驳回)、解约已处理(解约)
  27. }
  28. // youngeeContractInfoColumns holds the columns for table youngee_contract_info.
  29. var youngeeContractInfoColumns = YoungeeContractInfoColumns{
  30. ContractId: "contract_id",
  31. TaskId: "task_id",
  32. ProjectId: "project_id",
  33. BreakType: "break_type",
  34. SettlementAmount: "settlement_amount",
  35. BreakAt: "break_at",
  36. HandleAt: "handle_at",
  37. TerminateAt: "terminate_at",
  38. DefaultStatus: "default_status",
  39. }
  40. // NewYoungeeContractInfoDao creates and returns a new DAO object for table data access.
  41. func NewYoungeeContractInfoDao() *YoungeeContractInfoDao {
  42. return &YoungeeContractInfoDao{
  43. Group: "default",
  44. Table: "youngee_contract_info",
  45. Columns: youngeeContractInfoColumns,
  46. }
  47. }
  48. // DB retrieves and returns the underlying raw database management object of current DAO.
  49. func (dao *YoungeeContractInfoDao) DB() gdb.DB {
  50. return g.DB(dao.Group)
  51. }
  52. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  53. func (dao *YoungeeContractInfoDao) Ctx(ctx context.Context) *gdb.Model {
  54. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  55. }
  56. // Transaction wraps the transaction logic using function f.
  57. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  58. // It commits the transaction and returns nil if function f returns nil.
  59. //
  60. // Note that, you should not Commit or Rollback the transaction in function f
  61. // as it is automatically handled by this function.
  62. func (dao *YoungeeContractInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  63. return dao.Ctx(ctx).Transaction(ctx, f)
  64. }