industrial_askserie_video_group_management.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package cygx
  2. import (
  3. //"github.com/beego/beego/v2/client/orm"
  4. "github.com/beego/beego/v2/client/orm"
  5. "hongze/hz_crm_api/utils"
  6. "time"
  7. )
  8. // 首页资源表与产业的关系
  9. type CygxIndustrialAskserieVideoGroupManagement struct {
  10. Id int `orm:"column(id);pk" description:"主键ID"`
  11. AskserieVideoId int `description:"askserie_video_id"`
  12. IndustrialManagementId int `description:"cygx_industrial_management表的主键ID"`
  13. CreateTime time.Time `description:"创建时间"`
  14. }
  15. type IndustrialAskserieVideoManagementRep struct {
  16. AskserieVideoId int `description:"askserie_video_id"`
  17. IndustrialManagementId int `description:"cygx_industrial_management表的主键ID"`
  18. IndustryName string `description:"产业名称"`
  19. ChartPermissionId int `description:"权限id"`
  20. PermissionName string `description:"行业名称"`
  21. }
  22. // 列表GetCygxIndustrialAskserieVideoGroupManagementList
  23. func GetCygxIndustrialAskserieVideoGroupManagementList(askserieVideoIds []int) (items []*IndustrialAskserieVideoManagementRep, err error) {
  24. o := orm.NewOrmUsingDB("hz_cygx")
  25. sql := `SELECT
  26. am.askserie_video_id,
  27. m.chart_permission_id,
  28. m.industrial_management_id,
  29. m.industry_name
  30. FROM
  31. cygx_industrial_askserie_video_group_management AS am
  32. INNER JOIN cygx_industrial_management AS m ON m.industrial_management_id = am.industrial_management_id
  33. WHERE
  34. am.askserie_video_id IN (` + utils.GetOrmInReplace(len(askserieVideoIds)) + `)`
  35. _, err = o.Raw(sql, askserieVideoIds).QueryRows(&items)
  36. return
  37. }