cygx_morning_meeting_gather.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "github.com/rdlucklib/rdluck_tools/paging"
  5. "time"
  6. )
  7. type CygxMorningMeetingGather struct {
  8. Id int `orm:"column(id);pk"`
  9. MeetingIds string `description:"主表ID多个用 , 隔开"`
  10. PublishTime string `description:"发布日期"`
  11. CreateTime time.Time `description:"创建时间"`
  12. ModifyTime time.Time `description:"更新时间"`
  13. Title string `description:"标题"`
  14. Status int `description:"0:未发布,1:已发布"`
  15. }
  16. // 添加
  17. func AddCygxMorningMeetingGather(item *CygxMorningMeetingGather) (err error) {
  18. o := orm.NewOrm()
  19. _, err = o.Insert(item)
  20. return
  21. }
  22. func GetCygxMorningMeetingGatherCount(condition string, pars []interface{}) (count int, err error) {
  23. o := orm.NewOrm()
  24. sql := `SELECT COUNT(1) AS count FROM cygx_morning_meeting_gather WHERE 1=1 `
  25. if condition != "" {
  26. sql += condition
  27. }
  28. err = o.Raw(sql, pars).QueryRow(&count)
  29. return
  30. }
  31. type CygxMorningMeetingGatherResp struct {
  32. Id int `description:"ID"`
  33. Title string `description:"标题"`
  34. SubjectNames string `description:"多个标的名称"`
  35. }
  36. type CygxMorningMeetingGatherListResp struct {
  37. Paging *paging.PagingItem `description:"分页数据"`
  38. List []*CygxMorningMeetingGatherResp
  39. }
  40. // 列表
  41. func GetCygxMorningMeetingGatherList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxMorningMeetingGather, err error) {
  42. o := orm.NewOrm()
  43. sql := `SELECT * FROM cygx_morning_meeting_gather WHERE 1=1 `
  44. if condition != "" {
  45. sql += condition
  46. }
  47. sql += ` LIMIT ?,? `
  48. _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
  49. return
  50. }