sys_job_entity.go 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // ==========================================================================
  2. // This is auto-generated by gf cli tool. You may not really want to edit it.
  3. // ==========================================================================
  4. package sys_job
  5. import (
  6. "database/sql"
  7. "github.com/gogf/gf/database/gdb"
  8. )
  9. // Entity is the golang structure for table sys_job.
  10. type Entity struct {
  11. JobId int64 `orm:"job_id,primary" json:"job_id"` // 任务ID
  12. JobName string `orm:"job_name,primary" json:"job_name"` // 任务名称
  13. JobParams string `orm:"job_params" json:"job_params"` // 参数
  14. JobGroup string `orm:"job_group,primary" json:"job_group"` // 任务组名
  15. InvokeTarget string `orm:"invoke_target" json:"invoke_target"` // 调用目标字符串
  16. CronExpression string `orm:"cron_expression" json:"cron_expression"` // cron执行表达式
  17. MisfirePolicy int `orm:"misfire_policy" json:"misfire_policy"` // 计划执行策略(1多次执行 2执行一次)
  18. Concurrent int `orm:"concurrent" json:"concurrent"` // 是否并发执行(0允许 1禁止)
  19. Status int `orm:"status" json:"status"` // 状态(0正常 1暂停)
  20. CreateBy uint64 `orm:"create_by" json:"create_by"` // 创建者
  21. CreateTime uint64 `orm:"create_time" json:"create_time"` // 创建时间
  22. UpdateBy uint64 `orm:"update_by" json:"update_by"` // 更新者
  23. UpdateTime uint64 `orm:"update_time" json:"update_time"` // 更新时间
  24. Remark string `orm:"remark" json:"remark"` // 备注信息
  25. }
  26. // OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
  27. // the data and where attributes for empty values.
  28. func (r *Entity) OmitEmpty() *arModel {
  29. return Model.Data(r).OmitEmpty()
  30. }
  31. // Inserts does "INSERT...INTO..." statement for inserting current object into table.
  32. func (r *Entity) Insert() (result sql.Result, err error) {
  33. return Model.Data(r).Insert()
  34. }
  35. // InsertIgnore does "INSERT IGNORE INTO ..." statement for inserting current object into table.
  36. func (r *Entity) InsertIgnore() (result sql.Result, err error) {
  37. return Model.Data(r).InsertIgnore()
  38. }
  39. // Replace does "REPLACE...INTO..." statement for inserting current object into table.
  40. // If there's already another same record in the table (it checks using primary key or unique index),
  41. // it deletes it and insert this one.
  42. func (r *Entity) Replace() (result sql.Result, err error) {
  43. return Model.Data(r).Replace()
  44. }
  45. // Save does "INSERT...INTO..." statement for inserting/updating current object into table.
  46. // It updates the record if there's already another same record in the table
  47. // (it checks using primary key or unique index).
  48. func (r *Entity) Save() (result sql.Result, err error) {
  49. return Model.Data(r).Save()
  50. }
  51. // Update does "UPDATE...WHERE..." statement for updating current object from table.
  52. // It updates the record if there's already another same record in the table
  53. // (it checks using primary key or unique index).
  54. func (r *Entity) Update() (result sql.Result, err error) {
  55. return Model.Data(r).Where(gdb.GetWhereConditionOfStruct(r)).Update()
  56. }
  57. // Delete does "DELETE FROM...WHERE..." statement for deleting current object from table.
  58. func (r *Entity) Delete() (result sql.Result, err error) {
  59. return Model.Where(gdb.GetWhereConditionOfStruct(r)).Delete()
  60. }