resource_data_industrial_group_management.go 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // 首页资源表与产业的关系
  7. type CygxResourceDataIndustrialGroupManagement struct {
  8. Id int `orm:"column(id);pk" description:"主键ID"`
  9. ResourceDataId int `description:"cygx_resource_data 主键ID"`
  10. SourceId int `description:"资源ID"`
  11. Source string `description:"资源类型 报告 :article 、图表 :newchart、微路演 :roadshow、活动 :activity、活动视频:activityvideo、活动音频:activityvoice、专项调研活动:activityspecial"`
  12. IndustrialManagementId int `description:"cygx_industrial_management表的主键ID"`
  13. CreateTime time.Time `description:"创建时间"`
  14. }
  15. // 首页资源表与产业的关系
  16. type CygxResourceDataIndustrialGroupSubject struct {
  17. Id int `orm:"column(id);pk" description:"主键ID"`
  18. ResourceDataId int `description:"cygx_resource_data 主键ID"`
  19. SourceId int `description:"资源ID"`
  20. Source string `description:"资源类型 报告 :article 、图表 :newchart、微路演 :roadshow、活动 :activity、活动视频:activityvideo、活动音频:activityvoice、专项调研活动:activityspecial"`
  21. IndustrialSubjectId int `description:"cygx_industrial_subject表的主键ID"`
  22. CreateTime time.Time `description:"创建时间"`
  23. }
  24. // 关联产业列表
  25. func GetCygxResourceDataIndustrialGroupManagementList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxResourceDataIndustrialGroupManagement, err error) {
  26. o := orm.NewOrm()
  27. sql := `SELECT * FROM cygx_resource_data_industrial_group_management as a WHERE 1= 1 `
  28. if condition != "" {
  29. sql += condition
  30. }
  31. if startSize+pageSize > 0 {
  32. sql += ` LIMIT ?,? `
  33. _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
  34. } else {
  35. _, err = o.Raw(sql, pars).QueryRows(&items)
  36. }
  37. return
  38. }
  39. // 关联标的列表
  40. func GetCygxResourceDataIndustrialGroupSubjectList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxResourceDataIndustrialGroupSubject, err error) {
  41. o := orm.NewOrm()
  42. sql := `SELECT * FROM cygx_resource_data_industrial_group_subject as a WHERE 1= 1 `
  43. if condition != "" {
  44. sql += condition
  45. }
  46. if startSize+pageSize > 0 {
  47. sql += ` LIMIT ?,? `
  48. _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
  49. } else {
  50. _, err = o.Raw(sql, pars).QueryRows(&items)
  51. }
  52. return
  53. }