flow_entity.go 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // ==========================================================================
  2. // This is auto-generated by gf cli tool. You may not really want to edit it.
  3. // ==========================================================================
  4. package wf_flow
  5. import (
  6. "database/sql"
  7. "github.com/gogf/gf/database/gdb"
  8. )
  9. // Entity is the golang structure for table wf_flow.
  10. type Entity struct {
  11. Id uint `orm:"id,primary" json:"id"` //
  12. Type string `orm:"type" json:"type"` // 流程类别
  13. FlowName string `orm:"flow_name" json:"flow_name"` // 流程名称
  14. FlowDesc string `orm:"flow_desc" json:"flow_desc"` // 描述
  15. SortOrder uint `orm:"sort_order" json:"sort_order"` // 排序
  16. Status uint `orm:"status" json:"status"` // 0不可用1正常
  17. IsDel uint `orm:"is_del" json:"is_del"` //
  18. Uid uint64 `orm:"uid" json:"uid"` // 添加用户
  19. AddTime int `orm:"add_time" json:"add_time"` // 添加时间
  20. }
  21. // OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
  22. // the data and where attributes for empty values.
  23. func (r *Entity) OmitEmpty() *arModel {
  24. return Model.Data(r).OmitEmpty()
  25. }
  26. // Inserts does "INSERT...INTO..." statement for inserting current object into table.
  27. func (r *Entity) Insert() (result sql.Result, err error) {
  28. return Model.Data(r).Insert()
  29. }
  30. // InsertIgnore does "INSERT IGNORE INTO ..." statement for inserting current object into table.
  31. func (r *Entity) InsertIgnore() (result sql.Result, err error) {
  32. return Model.Data(r).InsertIgnore()
  33. }
  34. // Replace does "REPLACE...INTO..." statement for inserting current object into table.
  35. // If there's already another same record in the table (it checks using primary key or unique index),
  36. // it deletes it and insert this one.
  37. func (r *Entity) Replace() (result sql.Result, err error) {
  38. return Model.Data(r).Replace()
  39. }
  40. // Save does "INSERT...INTO..." statement for inserting/updating current object into table.
  41. // It updates the record if there's already another same record in the table
  42. // (it checks using primary key or unique index).
  43. func (r *Entity) Save() (result sql.Result, err error) {
  44. return Model.Data(r).Save()
  45. }
  46. // Update does "UPDATE...WHERE..." statement for updating current object from table.
  47. // It updates the record if there's already another same record in the table
  48. // (it checks using primary key or unique index).
  49. func (r *Entity) Update() (result sql.Result, err error) {
  50. return Model.Data(r).Where(gdb.GetWhereConditionOfStruct(r)).Update()
  51. }
  52. // Delete does "DELETE FROM...WHERE..." statement for deleting current object from table.
  53. func (r *Entity) Delete() (result sql.Result, err error) {
  54. return Model.Where(gdb.GetWhereConditionOfStruct(r)).Delete()
  55. }