report_selection_log.go 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. package cygx
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxReportSelectionLog struct {
  7. ArticleSunId int `orm:"column(article_sun_id);pk"description:"子级报告id"`
  8. ArticleId int `description:"父级报告Id"`
  9. ChartPermissionId int `description:"行业ID"`
  10. CreateTime time.Time `description:"创建时间"`
  11. Body string `description:"内容"`
  12. IndustrialSubjectId string `description:"标的ID"`
  13. SubjectName string `description:"标的名称"`
  14. IndustrialManagementId string `description:"产业资源包Id 多个用 , 隔开"`
  15. IndustrialManagementNames string `description:"产业资源包名称 多个用 , 隔开"`
  16. CompanyLabel string `description:"公司标签多个用{|}隔开"`
  17. OverviewArticleId int `description:"关联的综述报告ID"`
  18. IsNew int `description:"是否为New标签"`
  19. IsShowOverviewArticle int `description:"是否展示综述报告 1展示,0隐藏"`
  20. ThirdId string `description:"类似产业、标的的三方ID"`
  21. ThirdName string `description:"类似产业、标的的三方名称"`
  22. }
  23. type CygxReportSelectionLogRep struct {
  24. Sort string `description:"排序"`
  25. ChartPermissionId int `description:"行业ID"`
  26. ChartPermissionName string `description:"行业名称"`
  27. ChartPermissionSort string `description:"行业排序"`
  28. Body string `description:"内容"`
  29. ReportLink string `description:"报告链接"`
  30. IcoLink string `description:"图标链接"`
  31. }
  32. type AddCygxReportSelectionLog struct {
  33. ChartPermissionId int `description:"行业ID"`
  34. IndustrialSubjectId string `description:"标的ID"`
  35. SubjectName string `description:"标的名称"`
  36. IndustrialSubjectName string `description:"标的ID"`
  37. Body string `description:"内容"`
  38. IndustrialManagementId string `description:"产业资源包Id 多个用 , 隔开"`
  39. IndustrialManagementName string `description:"产业资源包Id 多个用 , 隔开"`
  40. IndustrialManagementNames string `description:"产业资源包Id 多个用 , 隔开"`
  41. CompanyLabel []string `description:"公司标签"`
  42. Label string `description:"公司标签"`
  43. OverviewArticleId int `description:"综述报告Id"`
  44. IsNew int `description:"是否为New标签"`
  45. IsShowOverviewArticle int `description:"是否展示综述报告 1展示,0隐藏"`
  46. ThirdId string `description:"类似产业、标的的三方ID"`
  47. ThirdName string `description:"类似产业、标的的三方名称"`
  48. }
  49. type CygxReportSelectionLogResp struct {
  50. ChartPermissionId int `description:"行业ID"`
  51. IndustrialSubjectId string `description:"标的ID"`
  52. SubjectName string `description:"标的名称"`
  53. ShowName string `description:"产业与标的展示名称"`
  54. IndustrialSubjectName string `description:"标的ID"`
  55. Body string `description:"内容"`
  56. IndustrialManagementId string `description:"产业资源包Id 多个用 , 隔开"`
  57. IndustrialManagementName string `description:"产业资源包Id 多个用 , 隔开"`
  58. IndustrialManagementNames string `description:"产业资源包Id 多个用 , 隔开"`
  59. CompanyLabel []string `description:"公司标签"`
  60. Label string `description:"公司标签"`
  61. OverviewArticleId int `description:"综述报告Id"`
  62. OverviewArticleTitle string `description:"综述报告标题"`
  63. IsNew int `description:"是否为New标签"`
  64. IsShowOverviewArticle int `description:"是否展示综述报告 1展示,0隐藏"`
  65. ChartPermissionSort int `description:"品种排序"`
  66. ThirdId string `description:"类似产业、标的的三方ID"`
  67. ThirdName string `description:"类似产业、标的的三方名称"`
  68. }
  69. type CygxReportSelectionChart struct {
  70. ChartPermissionId int `description:"行业ID"`
  71. ChartPermissionName string `description:"行业名称"`
  72. List []*CygxReportSelectionLogResp `description:"列表内容’"`
  73. BodyChartSummary string `description:"行业核心逻辑汇总"`
  74. }
  75. func GetCygxReportSelectionLogRepListSon(articleId, chartPermissionId int) (items []*CygxReportSelectionLogResp, err error) {
  76. o := orm.NewOrmUsingDB("hz_cygx")
  77. sql := `SELECT
  78. l.*, l.company_label as label,
  79. l.subject_name as industrial_subject_name,
  80. ( SELECT GROUP_CONCAT( DISTINCT m.industry_name SEPARATOR ',' ) AS sellerName FROM cygx_industrial_management AS m WHERE m.industrial_management_id IN ( l.industrial_management_id ) ) AS industrial_management_name
  81. FROM
  82. cygx_report_selection_log AS l
  83. LEFT JOIN cygx_industrial_subject AS s ON s.industrial_subject_id = l.industrial_subject_id
  84. WHERE 1= 1 AND l.article_id=? AND l.chart_permission_id =? `
  85. _, err = o.Raw(sql, articleId, chartPermissionId).QueryRows(&items)
  86. return
  87. }
  88. func GetCygxReportSelectionSjdpList(articleId int, typeStr string) (items []*CygxReportSelectionLogRep, err error) {
  89. o := orm.NewOrmUsingDB("hz_cygx")
  90. sql := `SELECT l.* FROM cygx_research_summary_log AS l
  91. WHERE 1= 1 AND l.article_id=? AND l.type =? `
  92. _, err = o.Raw(sql, articleId, typeStr).QueryRows(&items)
  93. return
  94. }
  95. type CygxReportSelectionLoglist struct {
  96. ArticleSunId int `description:"子级报告id"`
  97. ArticleId int `description:"父级报告Id"`
  98. ChartPermissionId int `description:"行业ID"`
  99. PermissionName string `description:"行业ID"`
  100. CreateTime time.Time `description:"创建时间"`
  101. Body string `description:"内容"`
  102. IndustrialSubjectId string `description:"标的ID"`
  103. IndustrialManagementId string `description:"产业资源包Id 多个用 , 隔开"`
  104. IndustrialManagementNames string `description:"产业资源包名称 多个用 , 隔开"`
  105. SubjectName string `description:"标的名称"`
  106. ThirdId int `description:"类似产业、标的的三方ID"`
  107. ThirdName string `description:"类似产业、标的的三方名称"`
  108. IcoLink string `orm:"column(image_url)"description:"图标链接"`
  109. OverviewArticleId int `description:"关联的综述报告ID"`
  110. IsNew int `description:"是否为New标签"`
  111. }
  112. // 列表
  113. func GetReportSelectionlogListAll(articleId int) (items []*CygxReportSelectionLoglist, err error) {
  114. o := orm.NewOrmUsingDB("hz_cygx")
  115. sql := `SELECT l.*
  116. FROM
  117. cygx_report_selection_log AS l
  118. WHERE l.article_id = ? `
  119. _, err = o.Raw(sql, articleId).QueryRows(&items)
  120. return
  121. }