minutesSummary.go 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. type DetailCygxMinutesSummaryRep struct {
  6. ArticleId int `description:"报告Id"`
  7. Title string `description:"标题"`
  8. Department string `description:"作者"`
  9. PublishDate string `description:"发布时间"`
  10. VideoUrl string `description:"链接"`
  11. VideoPlaySeconds string `description:"时长"`
  12. VideoName string `description:"音频名称"`
  13. Abstract string `description:"摘要"`
  14. VisibleRange int `description:"设置可见范围1全部,0内部"`
  15. }
  16. type MinutesSummaryLetailRespV4 struct {
  17. Detail *DetailCygxMinutesSummaryRep
  18. HasPermission int `description:"1:有该行业权限,正常展示,2:无该行业权限,不存在权益客户下,3:无该品类权限,已提交过申请,4:无该行业权限,未提交过申请,5:潜在客户,未提交过申请,6:潜在客户,已提交过申请"`
  19. List []*ResearchSummaryChartPermission
  20. IsShow bool `description:"是否展示"`
  21. }
  22. type MinutesSummaryLetailResp struct {
  23. Detail *DetailCygxMinutesSummaryRep
  24. HasPermission int `description:"1:有该行业权限,正常展示,2:无该行业权限,不存在权益客户下,3:无该品类权限,已提交过申请,4:无该行业权限,未提交过申请,5:潜在客户,未提交过申请,6:潜在客户,已提交过申请"`
  25. List []*MinutesSummaryChartPermission
  26. IsShow bool `description:"是否展示"`
  27. }
  28. type MinutesSummaryChartPermission struct {
  29. PermissionName string `description:"行业名称"`
  30. ChartPermissionId int `description:"行业ID"`
  31. IcoLink string `orm:"column(image_url)"description:"图标链接"`
  32. List []*CygxMinutesSummaryLogDetail
  33. }
  34. type CygxMinutesSummaryLogDetail struct {
  35. Body string `description:"内容"`
  36. ReportLink string `orm:"column(link_article_id)"description:"报告链接"`
  37. VideoUrl string `description:"链接"`
  38. IsHaveVideo bool `description:"是否含有音频文件"`
  39. }
  40. type IndustriaMinutesSummary struct {
  41. IndustrialManagementId int `description:"产业Id"`
  42. IndustryName string `description:"产业名称"`
  43. }
  44. type MinutesSummaryId struct {
  45. ArticleId int `description:"报告I"`
  46. }
  47. // 通过纪要ID获取详情
  48. func GetCygxMinutesSummaryInfoById(articleId int) (item *DetailCygxMinutesSummaryRep, err error) {
  49. o := orm.NewOrm()
  50. sql := `SELECT * FROM cygx_minutes_summary WHERE article_id=? AND publish_status = 1 `
  51. err = o.Raw(sql, articleId).QueryRow(&item)
  52. return
  53. }
  54. // 列表
  55. func GetMinutesSummarylogListAllV4(articleId int) (items []*ResearchSummaryChartPermission, err error) {
  56. o := orm.NewOrm()
  57. //sql := `SELECT c.permission_name ,c.image_url,l.*
  58. // FROM
  59. // cygx_minutes_summary_log AS l
  60. // INNER JOIN chart_permission AS c ON c.chart_permission_id = l.chart_permission_id
  61. // WHERE l.article_id = ?
  62. // GROUP BY l.chart_permission_id
  63. // ORDER BY l.chart_permission_sort ASC `
  64. sql := `SELECT l.*
  65. FROM cygx_minutes_summary_log AS l
  66. WHERE l.article_id = ?
  67. GROUP BY l.type
  68. ORDER BY l.sort ASC`
  69. _, err = o.Raw(sql, articleId).QueryRows(&items)
  70. return
  71. }
  72. // 列表
  73. func GetMinutesSummarylogListAll(articleId int) (items []*MinutesSummaryChartPermission, err error) {
  74. o := orm.NewOrm()
  75. sql := `SELECT l.*
  76. FROM
  77. cygx_minutes_summary_log AS l
  78. WHERE l.article_id = ?
  79. GROUP BY l.chart_permission_id
  80. ORDER BY l.chart_permission_sort ASC `
  81. _, err = o.Raw(sql, articleId).QueryRows(&items)
  82. return
  83. }
  84. // 列表
  85. func GetMinutesSummarylogSonListAll(articleId, chartPermissionId int) (items []*CygxMinutesSummaryLogDetail, err error) {
  86. o := orm.NewOrm()
  87. sql := `SELECT l.link_article_id,l.body ,a.video_url
  88. FROM
  89. cygx_minutes_summary_log AS l
  90. LEFT JOIN cygx_article as a ON a.article_id = l.link_article_id
  91. WHERE l.article_id = ? AND l.chart_permission_id =?`
  92. _, err = o.Raw(sql, articleId, chartPermissionId).QueryRows(&items)
  93. return
  94. }
  95. // 列表
  96. func GetMinutesSummarylogSonListSecond(articleId int, artType string) (items []*CygxResearchSummaryLogSecond, err error) {
  97. o := orm.NewOrm()
  98. sql := `SELECT l.*
  99. FROM
  100. cygx_minutes_summary_log AS l
  101. WHERE l.article_id = ? AND l.type =?
  102. GROUP BY l.chart_permission_id
  103. ORDER BY l.chart_permission_sort ASC`
  104. _, err = o.Raw(sql, articleId, artType).QueryRows(&items)
  105. return
  106. }
  107. // 列表
  108. func GetMinutesSummarylogListThird(articleId, chartPermissionId int, artType string) (items []*CygxResearchSummaryLogThird, err error) {
  109. o := orm.NewOrm()
  110. sql := `SELECT l.link_article_id,l.body ,a.video_url
  111. FROM cygx_minutes_summary_log AS l
  112. LEFT JOIN cygx_article as a ON a.article_id = l.link_article_id
  113. WHERE l.article_id = ? AND l.type =? AND l.chart_permission_id = ?
  114. ORDER BY l.chart_permission_sort ASC `
  115. _, err = o.Raw(sql, articleId, artType, chartPermissionId).QueryRows(&items)
  116. return
  117. }