report_mapping.go 809 B

12345678910111213141516171819202122232425262728293031
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "hongze/hongze_cygxzs/utils"
  5. )
  6. type ReportMappingResp struct {
  7. CategoryId int `description:"分类ID"`
  8. SubCategoryName string `description:"主题名称"`
  9. MatchTypeName string `description:"匹配类型"`
  10. IsRed bool `description:"是否标红"`
  11. }
  12. // 获取策略下面的所有分类
  13. func GetReportMappingStrategyAll() (items []*IndustrialManagementRep, err error) {
  14. o := orm.NewOrmUsingDB("hz_cygx")
  15. sql := `SELECT
  16. match_type_name AS industry_name,
  17. category_id AS industrial_management_id,
  18. chart_permission_id
  19. FROM
  20. cygx_report_mapping
  21. WHERE
  22. report_type = 1
  23. AND chart_permission_name = ?
  24. ORDER BY
  25. sort ASC `
  26. _, err = o.Raw(sql, utils.CE_LUE_NAME).QueryRows(&items)
  27. return
  28. }