report_mapping_group.go 868 B

1234567891011121314151617181920212223242526272829303132
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxReportMappingGroup struct {
  7. Id int `orm:"column(id);pk" description:"id"`
  8. IdCygx int `description:"分类ID"`
  9. CategoryIdCelue int `description:"分类ID"`
  10. CreateTime time.Time `description:"创建时间"`
  11. ModifyTime time.Time `description:"更新时间"`
  12. }
  13. // 添加
  14. func AddCygxReportMappingGroup(item *CygxReportMappingGroup) (lastId int64, err error) {
  15. o := orm.NewOrm()
  16. lastId, err = o.Insert(item)
  17. return
  18. }
  19. // 列表
  20. func GetCygxReportMappingGroupList(condition string, pars []interface{}) (items []*CygxReportMappingGroup, err error) {
  21. o := orm.NewOrm()
  22. sql := `SELECT * FROM cygx_report_mapping_group WHERE 1= 1 `
  23. if condition != "" {
  24. sql += condition
  25. }
  26. _, err = o.Raw(sql, pars).QueryRows(&items)
  27. return
  28. }