run_entity.go 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // ==========================================================================
  2. // This is auto-generated by gf cli tool. You may not really want to edit it.
  3. // ==========================================================================
  4. package wf_run
  5. import (
  6. "database/sql"
  7. "github.com/gogf/gf/database/gdb"
  8. )
  9. // Entity is the golang structure for table wf_run.
  10. type Entity struct {
  11. Id uint `orm:"id,primary" json:"id"` //
  12. Pid uint `orm:"pid" json:"pid"` // work_run父流转公文ID 值大于0则这个是子流程,完成后或者要返回父流程
  13. FromTable string `orm:"from_table" json:"from_table"` // 单据表,不带前缀
  14. FromId int `orm:"from_id" json:"from_id"` //
  15. FromTitle string `orm:"from_title" json:"from_title"` // 业务表标题字段
  16. FromStatus string `orm:"from_status" json:"from_status"` // 业务表审批状态字段
  17. PidFlowStep uint `orm:"pid_flow_step" json:"pid_flow_step"` // 父pid的flow_id中的第几步骤进入的,取回这个work_flow_step的child_over决定结束子流程的动作
  18. CacheRunId uint `orm:"cache_run_id" json:"cache_run_id"` // 多个子流程时pid无法识别cache所以加这个字段pid>0
  19. Uid uint `orm:"uid" json:"uid"` //
  20. FlowId uint `orm:"flow_id" json:"flow_id"` // 流程id 正常流程
  21. CatId uint `orm:"cat_id" json:"cat_id"` // 流程分类ID即公文分类ID
  22. RunName string `orm:"run_name" json:"run_name"` // 公文名称
  23. RunFlowId uint `orm:"run_flow_id" json:"run_flow_id"` // 流转到什么流程 最新流程,查询优化,进入子流程时将简化查询,子流程与父流程同步
  24. RunFlowProcess string `orm:"run_flow_process" json:"run_flow_process"` // 流转到第几步
  25. AttIds string `orm:"att_ids" json:"att_ids"` // 公文附件ids
  26. Endtime uint `orm:"endtime" json:"endtime"` // 结束时间
  27. Status uint `orm:"status" json:"status"` // 状态,0流程中,1通过,2回退
  28. IsDel uint `orm:"is_del" json:"is_del"` //
  29. Updatetime uint `orm:"updatetime" json:"updatetime"` //
  30. Dateline uint `orm:"dateline" json:"dateline"` //
  31. IsSing int `orm:"is_sing" json:"is_sing"` //
  32. SingId int `orm:"sing_id" json:"sing_id"` //
  33. }
  34. // OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
  35. // the data and where attributes for empty values.
  36. func (r *Entity) OmitEmpty() *arModel {
  37. return Model.Data(r).OmitEmpty()
  38. }
  39. // Inserts does "INSERT...INTO..." statement for inserting current object into table.
  40. func (r *Entity) Insert() (result sql.Result, err error) {
  41. return Model.Data(r).Insert()
  42. }
  43. // InsertIgnore does "INSERT IGNORE INTO ..." statement for inserting current object into table.
  44. func (r *Entity) InsertIgnore() (result sql.Result, err error) {
  45. return Model.Data(r).InsertIgnore()
  46. }
  47. // Replace does "REPLACE...INTO..." statement for inserting current object into table.
  48. // If there's already another same record in the table (it checks using primary key or unique index),
  49. // it deletes it and insert this one.
  50. func (r *Entity) Replace() (result sql.Result, err error) {
  51. return Model.Data(r).Replace()
  52. }
  53. // Save does "INSERT...INTO..." statement for inserting/updating current object into table.
  54. // It updates the record if there's already another same record in the table
  55. // (it checks using primary key or unique index).
  56. func (r *Entity) Save() (result sql.Result, err error) {
  57. return Model.Data(r).Save()
  58. }
  59. // Update does "UPDATE...WHERE..." statement for updating current object from table.
  60. // It updates the record if there's already another same record in the table
  61. // (it checks using primary key or unique index).
  62. func (r *Entity) Update() (result sql.Result, err error) {
  63. return Model.Data(r).Where(gdb.GetWhereConditionOfStruct(r)).Update()
  64. }
  65. // Delete does "DELETE FROM...WHERE..." statement for deleting current object from table.
  66. func (r *Entity) Delete() (result sql.Result, err error) {
  67. return Model.Where(gdb.GetWhereConditionOfStruct(r)).Delete()
  68. }