minutes_summary_log.go 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. package cygx
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxMinutesSummaryLog struct {
  7. ArticleSunId int `orm:"column(article_sun_id);pk"description:"子级报告id"`
  8. ArticleId int `description:"父级报告Id"`
  9. Type string `description:"类型'SSGS:上市公司调研纪要,’CYDYJY:产业调研纪要’,’YANX:研选"`
  10. Sort string `description:"排序"`
  11. ChartPermissionId int `description:"行业ID"`
  12. ChartPermissionSort string `description:"行业排序"`
  13. CreateTime time.Time `description:"创建时间"`
  14. Body string `description:"内容"`
  15. ReportLink string `description:"报告链接"`
  16. LinkArticleId int `description:"报告ID链接"`
  17. }
  18. type CygxMinutesSummaryLogRep struct {
  19. Sort string `description:"排序"`
  20. ChartPermissionId int `description:"行业ID"`
  21. ChartPermissionName string `description:"行业名称"`
  22. ChartPermissionSort string `description:"行业排序"`
  23. Body string `description:"内容"`
  24. ReportLink string `description:"报告链接"`
  25. IcoLink string `description:"图标链接"`
  26. }
  27. type AddCygxMinutesSummaryLog struct {
  28. Body string `description:"内容"`
  29. ReportLink string `description:"报告链接"`
  30. Sort string `description:"排序"`
  31. }
  32. type CygxMSlChartPermission struct {
  33. ChartPermissionId int `description:"行业ID"`
  34. ChartPermissionSort string `description:"行业排序"`
  35. List []*AddCygxMinutesSummaryLog
  36. }
  37. type CygxMSlChartPermissionIco struct {
  38. ChartPermissionId int `description:"行业ID"`
  39. ChartPermissionName string `description:"行业名称"`
  40. ChartPermissionSort string `description:"行业排序"`
  41. IcoLink string `description:"图标链接"`
  42. List []*AddCygxMinutesSummaryLog
  43. }
  44. type CygxMSlChartPermissionIcoTmp struct {
  45. ChartPermissionId int `description:"行业ID"`
  46. ChartPermissionName string `description:"行业名称"`
  47. ChartPermissionSort string `description:"行业排序"`
  48. IcoLink string `description:"图标链接"`
  49. List []string
  50. //List make([]string, 0)
  51. }
  52. type CygxMSlFirstList struct {
  53. ListSdbg []*CygxRSlChartPermission `description:"类型——’SDBG:深度报告片篇’"`
  54. SortSdbg string `description:"深度报告排序"`
  55. ListCydyjy []*CygxRSlChartPermission `description:"类型——’CYDYJY:产业调研纪要’"`
  56. SortCydyjy string `description:"产业调研纪要排序"`
  57. ListSjdp []*AddCygxMinutesSummaryLog `description:"类型——’SJDP:事件点评"`
  58. SortSjdp string `description:"事件点评排序"`
  59. ListBzchjh []*CygxRSlChartPermission `description:"类型——’BZCHJH:本周晨会精华’"`
  60. SortBzchjh string `description:"本周晨会精华排序"`
  61. }
  62. func GetCygxMinutesSummaryLogRepList(articleId int, typeStr string) (items []*CygxMinutesSummaryLogRep, err error) {
  63. o := orm.NewOrmUsingDB("hz_cygx")
  64. sql := `SELECT l.*
  65. FROM cygx_minutes_summary_log AS l
  66. WHERE 1= 1 AND article_id=? AND type =? GROUP BY l.chart_permission_id `
  67. _, err = o.Raw(sql, articleId, typeStr).QueryRows(&items)
  68. return
  69. }
  70. func GetCygxMinutesSummaryLogRepListSon(articleId, chartPermissionId int, typeStr string) (items []*AddCygxResearchSummaryLog, err error) {
  71. o := orm.NewOrmUsingDB("hz_cygx")
  72. sql := `SELECT l.* FROM cygx_minutes_summary_log AS l
  73. WHERE 1= 1 AND l.article_id=? AND l.chart_permission_id =? AND l.type =? `
  74. _, err = o.Raw(sql, articleId, chartPermissionId, typeStr).QueryRows(&items)
  75. return
  76. }
  77. func GetCygxMinutesSummaryYanxList(articleId int, typeStr string) (items []*AddCygxMinutesSummaryLog, err error) {
  78. o := orm.NewOrmUsingDB("hz_cygx")
  79. sql := `SELECT l.* FROM cygx_minutes_summary_log AS l
  80. WHERE 1= 1 AND l.article_id=? AND l.type =? `
  81. _, err = o.Raw(sql, articleId, typeStr).QueryRows(&items)
  82. return
  83. }