cygx_morning_meeting_review_chapter.go 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // CygxMorningMeetingReviewChapter [...]
  7. type CygxMorningMeetingReviewChapter struct {
  8. Id int `orm:"column(id);pk"`
  9. MeetingTime time.Time `json:"meetingTime"` // 晨会日期
  10. CreateTime time.Time `json:"createTime"`
  11. ModifyTime time.Time `json:"modifyTime"`
  12. IndustryId int `json:"industryId"` // 产业id
  13. IndustryName string `json:"industryName"` // 产业名称
  14. ChartPermissionName string `json:"chartPermissionName"` // 行业名称
  15. ChartPermissionId int `json:"chartPermissionId"` // 行业id
  16. IndustrialSubjectIds string `json:"industrialSubjectId"` // 标的id
  17. MeetingId int64 `json:"meetingId"` // 主表id
  18. Content string `json:"content"` // 内容
  19. }
  20. // 通过ID获取详情
  21. func GetCygxMorningMeetingReviewChapterDetail(id int) (item *CygxMorningMeetingReviewChapter, err error) {
  22. o := orm.NewOrm()
  23. sql := `SELECT * FROM cygx_morning_meeting_review_chapter WHERE id =? `
  24. err = o.Raw(sql, id).QueryRow(&item)
  25. return
  26. }
  27. // 列表
  28. func GetCygxMorningMeetingReviewChapterList(condition string, pars []interface{}) (items []*CygxMorningMeetingGatherDetailListResp, err error) {
  29. o := orm.NewOrm()
  30. sql := `SELECT c.*,r.publish_time
  31. FROM cygx_morning_meeting_review_chapter as c
  32. INNER JOIN cygx_morning_meeting_reviews as r ON r.id = c.meeting_id WHERE 1 = 1 AND r.status = 1 `
  33. if condition != "" {
  34. sql += condition
  35. }
  36. _, err = o.Raw(sql, pars).QueryRows(&items)
  37. return
  38. }
  39. type IndustrialSubjectItem struct {
  40. IndustrialSubjectId int `orm:"column(industrial_subject_id);pk" description:"标的id"`
  41. SubjectName string `description:"标的名称"`
  42. }
  43. type CygxMorningMeetingReviewChapterRespItem struct {
  44. Id int `orm:"column(id);pk"`
  45. MeetingTime time.Time `json:"meetingTime"` // 晨会日期
  46. CreateTime time.Time `json:"createTime"`
  47. ModifyTime time.Time `json:"modifyTime"`
  48. IndustryId int `json:"industryId"` // 产业id
  49. IndustryName string `json:"industryName"` // 产业名称
  50. ChartPermissionName string `json:"chartPermissionName"` // 行业名称
  51. ChartPermissionId int `json:"chartPermissionId"` // 行业id
  52. IndustrialSubjectList []*IndustrialSubjectItem `json:"industrialSubjectList"` // 标的list
  53. MeetingId int64 `json:"meetingId"` // 主表id
  54. Content string `json:"content"` // 内容
  55. }
  56. type CygxMorningMeetingReviewChapterResp struct {
  57. MeetingTime string
  58. Status int
  59. List []*CygxMorningMeetingReviewChapterRespItem
  60. }
  61. func GetCygxMorningMeetingReviewsListByIndustrialIds(industrialIds string) (items []*CygxMorningMeetingReviewChapter, err error) {
  62. o := orm.NewOrm()
  63. sql := `SELECT * FROM cygx_morning_meeting_review_chapter WHERE industry_id IN (` + industrialIds + `) `
  64. _, err = o.Raw(sql).QueryRows(&items)
  65. return
  66. }