industrial_article_group_subject.go 645 B

1234567891011121314151617181920212223
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. // 标的列表
  6. func GetIndustrialArticleGroupSubjectListByHz(IndustrialManagementId int) (items []*IndustrialSubject, err error) {
  7. o := orm.NewOrm()
  8. sql := `SELECT
  9. i.*
  10. FROM
  11. cygx_industrial_subject AS i
  12. INNER JOIN cygx_industrial_article_group_subject AS sg ON sg.industrial_subject_id = i.industrial_subject_id
  13. INNER JOIN cygx_article AS a ON a.article_id = sg.article_id
  14. WHERE
  15. i.industrial_management_id = ?
  16. AND a.article_type_id = 0
  17. GROUP BY
  18. i.industrial_subject_id `
  19. _, err = o.Raw(sql, IndustrialManagementId).QueryRows(&items)
  20. return
  21. }