workflow_node_template.go 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. // WorkflowNodeTemplateDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type WorkflowNodeTemplateDao 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 WorkflowNodeTemplateColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // WorkflowNodeTemplateColumns defines and stores column names for table workflow_node_template.
  17. type WorkflowNodeTemplateColumns struct {
  18. TemplateId string //
  19. NodeNameFirst string // 首次执行时的节点名,前端显示
  20. NodeNameAfterSecond string // 第二次之后执行时的节点名
  21. ProcedureStage string // 订单处理流程阶段,如:拍单阶段、初稿阶段
  22. StepInStage string // 在阶段中的步骤,如提交初稿是初稿阶段的第一步
  23. CurExecutionTimes string // 当前执行次数
  24. MaxExecutionTimes string // 最大执行次数
  25. Tip string // 此步骤在达人端的提示
  26. SucNextStep string // 成功后在此阶段的后续步骤 0不处理 255进行后续阶段 其余数值为本阶段step_in_stage值
  27. FailNextStep string // 失败的后续步骤,数值同上
  28. State string // 状态 1未开启 2进行中 3成功 4失败
  29. FailReason string //
  30. StartDate string // 开启日期
  31. CompleteDate string // 完成日期
  32. CompleteUserName string // 完成人名
  33. LimitDays1 string // 此状态限制天数 0不限制
  34. ReduceFeeRatio1 string // 超期扣费比率
  35. LimitDays2 string // 第二次执行限制天数(修改操作限时)
  36. ReduceFeeRatio2 string // 第二次执行超期扣费率
  37. OperateRoleRestrict string // 操作角色限制 1后端 2达人
  38. SortId string //
  39. }
  40. // workflowNodeTemplateColumns holds the columns for table workflow_node_template.
  41. var workflowNodeTemplateColumns = WorkflowNodeTemplateColumns{
  42. TemplateId: "template_id",
  43. NodeNameFirst: "node_name_first",
  44. NodeNameAfterSecond: "node_name_after_second",
  45. ProcedureStage: "procedure_stage",
  46. StepInStage: "step_in_stage",
  47. CurExecutionTimes: "cur_execution_times",
  48. MaxExecutionTimes: "max_execution_times",
  49. Tip: "tip",
  50. SucNextStep: "suc_next_step",
  51. FailNextStep: "fail_next_step",
  52. State: "state",
  53. FailReason: "fail_reason",
  54. StartDate: "start_date",
  55. CompleteDate: "complete_date",
  56. CompleteUserName: "complete_user_name",
  57. LimitDays1: "limit_days_1",
  58. ReduceFeeRatio1: "reduce_fee_ratio_1",
  59. LimitDays2: "limit_days_2",
  60. ReduceFeeRatio2: "reduce_fee_ratio_2",
  61. OperateRoleRestrict: "operate_role_restrict",
  62. SortId: "sort_id",
  63. }
  64. // NewWorkflowNodeTemplateDao creates and returns a new DAO object for table data access.
  65. func NewWorkflowNodeTemplateDao() *WorkflowNodeTemplateDao {
  66. return &WorkflowNodeTemplateDao{
  67. Group: "default",
  68. Table: "workflow_node_template",
  69. Columns: workflowNodeTemplateColumns,
  70. }
  71. }
  72. // DB retrieves and returns the underlying raw database management object of current DAO.
  73. func (dao *WorkflowNodeTemplateDao) DB() gdb.DB {
  74. return g.DB(dao.Group)
  75. }
  76. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  77. func (dao *WorkflowNodeTemplateDao) Ctx(ctx context.Context) *gdb.Model {
  78. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  79. }
  80. // Transaction wraps the transaction logic using function f.
  81. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  82. // It commits the transaction and returns nil if function f returns nil.
  83. //
  84. // Note that, you should not Commit or Rollback the transaction in function f
  85. // as it is automatically handled by this function.
  86. func (dao *WorkflowNodeTemplateDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  87. return dao.Ctx(ctx).Transaction(ctx, f)
  88. }