chart_permission.go 703 B

1234567891011121314151617181920
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. type ChartPermissionResp struct {
  6. ChartPermissionId int `description:"权限id"`
  7. PermissionName string `description:"权限名称"`
  8. AllTracks string `default:"全部赛道";description:"全部赛道"`
  9. List []*IndustrialManagementRep
  10. CheckList []int
  11. }
  12. func GetChartPermissionAll(condition string, pars []interface{}) (items []*ChartPermissionResp, err error) {
  13. o := orm.NewOrmUsingDB("weekly_report")
  14. sql := `SELECT * FROM chart_permission WHERE product_id=2 AND is_report=1 AND permission_type!=2 ` + condition + ` ORDER BY sort ASC `
  15. _, err = o.Raw(sql, pars).QueryRows(&items)
  16. return
  17. }