report_selection_log.go 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxReportSelectionLog struct {
  7. ArticleSunId int `description:"子级报告id"`
  8. ArticleId int `description:"父级报告Id"`
  9. ChartPermissionId int `description:"行业ID"`
  10. PermissionName string `description:"行业ID"`
  11. CreateTime time.Time `description:"创建时间"`
  12. Body string `description:"内容"`
  13. IndustrialSubjectId int `description:"标的ID"`
  14. IndustrialManagementId string `description:"产业资源包Id 多个用 , 隔开"`
  15. IndustrialManagementNames string `description:"产业资源包名称 多个用 , 隔开"`
  16. SubjectName string `description:"标的名称"`
  17. IcoLink string `orm:"column(image_url)"description:"图标链接"`
  18. CompanyLabel []string `description:"公司标签"`
  19. Label string `description:"公司标签"`
  20. OverviewArticleId int `description:"综述报告Id"`
  21. ThirdId int `description:"类似产业、标的的三方ID"`
  22. ThirdName string `description:"类似产业、标的的三方名称"`
  23. }
  24. type CygxReportSelectionLogResp struct {
  25. ArticleSunId int `description:"子级报告id"`
  26. ArticleId int `description:"父级报告Id"`
  27. ChartPermissionId int `description:"行业ID"`
  28. PermissionName string `description:"行业ID"`
  29. CreateTime time.Time `description:"创建时间"`
  30. Body string `description:"内容"`
  31. IndustrialSubjectId int `description:"标的ID"`
  32. IndustrialManagementId string `description:"产业资源包Id 多个用 , 隔开"`
  33. SubjectName string `description:"标的名称"`
  34. IcoLink string `orm:"column(image_url)"description:"图标链接"`
  35. CompanyLabel []string `description:"公司标签"`
  36. Label string `description:"公司标签"`
  37. OverviewArticleId int `description:"综述报告Id"`
  38. }
  39. // 列表
  40. func GetCygxReportSelectionLog(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxReportSelectionLog, err error) {
  41. o := orm.NewOrm()
  42. sql := `SELECT * FROM cygx_report_selection_log as art WHERE 1= 1 `
  43. if condition != "" {
  44. sql += condition
  45. }
  46. sql += ` LIMIT ?,? `
  47. _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
  48. return
  49. }
  50. // 通过ID获取详情
  51. func GetCygxReportSelectionLogDetail(articleId int, subjectName string) (item *CygxReportSelectionLogResp, err error) {
  52. o := orm.NewOrm()
  53. sql := `SELECT * FROM cygx_report_selection_log WHERE article_id=? AND subject_name = ? LIMIT 1 `
  54. err = o.Raw(sql, articleId, subjectName).QueryRow(&item)
  55. return
  56. }