cygx_morning_meeting_gather.go 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. IndustryName 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. }
  51. func GetCygxMorningMeetingGatherById(condition string, pars []interface{}) (item *CygxMorningMeetingGather, err error) {
  52. o := orm.NewOrm()
  53. sql := `SELECT * FROM cygx_morning_meeting_gather WHERE 1= 1`
  54. if condition != "" {
  55. sql += condition
  56. }
  57. err = o.Raw(sql, pars).QueryRow(&item)
  58. return
  59. }
  60. type CygxMorningMeetingGatherDetailListResp struct {
  61. Id int `description:"ID"`
  62. IndustryId int `description:"产业id"` // 产业id
  63. IndustryName string `description:"产业名称"` // 产业名称
  64. ChartPermissionName string `description:"行业名称"` // 行业名称
  65. ChartPermissionId int `description:"行业id"` // 行业id
  66. MeetingId int `description:"主表id"` // 主表id
  67. Content string `description:"内容"` // 内容
  68. PublishTime string `description:"发布日期"`
  69. ReportLink string `description:"报告链接"`
  70. LinkArticleId int `description:"报告ID链接"`
  71. Title string `description:"标题"`
  72. IndustrialSubjectIds string `description:"标的id"`
  73. ListSubject []*CygxIndustrialSubject `description:"标的列表"`
  74. }
  75. type CygxMorningMeetingGatherDetailResp struct {
  76. HasPermission int `description:"1:有该行业权限,正常展示,2:无该行业权限,不存在权益客户下,3:无该品类权限,已提交过申请,4:无该行业权限,未提交过申请,5:潜在客户,未提交过申请,6:潜在客户,已提交过申请"`
  77. Detail *CygxMorningMeetingGatherDetail
  78. }
  79. type CygxMorningMeetingGatherDetail struct {
  80. Id int `description:"ID"`
  81. Title string `description:"标题"`
  82. PublishTime string `description:"发布日期"`
  83. Department string `description:"作者"`
  84. List []*CygxMorningMeetingGatherDetailListResp
  85. }