sys_config_entity.go 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // ==========================================================================
  2. // This is auto-generated by gf cli tool. You may not really want to edit it.
  3. // ==========================================================================
  4. package sys_config
  5. import (
  6. "database/sql"
  7. "github.com/gogf/gf/database/gdb"
  8. )
  9. // Entity is the golang structure for table sys_config.
  10. type Entity struct {
  11. ConfigId uint `orm:"config_id,primary" json:"config_id"` // 参数主键
  12. ConfigName string `orm:"config_name" json:"config_name"` // 参数名称
  13. ConfigKey string `orm:"config_key,unique" json:"config_key"` // 参数键名
  14. ConfigValue string `orm:"config_value" json:"config_value"` // 参数键值
  15. ConfigType int `orm:"config_type" json:"config_type"` // 系统内置(Y是 N否)
  16. CreateBy uint `orm:"create_by" json:"create_by"` // 创建者
  17. CreateTime uint64 `orm:"create_time" json:"create_time"` // 创建时间
  18. UpdateBy uint `orm:"update_by" json:"update_by"` // 更新者
  19. UpdateTime uint64 `orm:"update_time" json:"update_time"` // 更新时间
  20. Remark string `orm:"remark" json:"remark"` // 备注
  21. }
  22. // OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers
  23. // the data and where attributes for empty values.
  24. func (r *Entity) OmitEmpty() *arModel {
  25. return Model.Data(r).OmitEmpty()
  26. }
  27. // Inserts does "INSERT...INTO..." statement for inserting current object into table.
  28. func (r *Entity) Insert() (result sql.Result, err error) {
  29. return Model.Data(r).Insert()
  30. }
  31. // InsertIgnore does "INSERT IGNORE INTO ..." statement for inserting current object into table.
  32. func (r *Entity) InsertIgnore() (result sql.Result, err error) {
  33. return Model.Data(r).InsertIgnore()
  34. }
  35. // Replace does "REPLACE...INTO..." statement for inserting current object into table.
  36. // If there's already another same record in the table (it checks using primary key or unique index),
  37. // it deletes it and insert this one.
  38. func (r *Entity) Replace() (result sql.Result, err error) {
  39. return Model.Data(r).Replace()
  40. }
  41. // Save does "INSERT...INTO..." statement for inserting/updating current object into table.
  42. // It updates the record if there's already another same record in the table
  43. // (it checks using primary key or unique index).
  44. func (r *Entity) Save() (result sql.Result, err error) {
  45. return Model.Data(r).Save()
  46. }
  47. // Update does "UPDATE...WHERE..." statement for updating current object from table.
  48. // It updates the record if there's already another same record in the table
  49. // (it checks using primary key or unique index).
  50. func (r *Entity) Update() (result sql.Result, err error) {
  51. return Model.Data(r).Where(gdb.GetWhereConditionOfStruct(r)).Update()
  52. }
  53. // Delete does "DELETE FROM...WHERE..." statement for deleting current object from table.
  54. func (r *Entity) Delete() (result sql.Result, err error) {
  55. return Model.Where(gdb.GetWhereConditionOfStruct(r)).Delete()
  56. }