query.go 576 B

123456789101112131415161718
  1. package edb_info_no_permission_admin
  2. import "hongze/hongze_yb/global"
  3. type NoPermissionChart struct {
  4. AdminId int
  5. ChartInfoId int
  6. }
  7. // GetAllChartListByAdminId 根据用户id获取该用户的所有配置
  8. func GetAllChartListByAdminId(adminId int) (items []*NoPermissionChart, err error) {
  9. sql := ` SELECT a.admin_id,b.chart_info_id FROM edb_info_no_permission_admin AS a
  10. JOIN chart_edb_mapping AS b ON a.edb_info_id=b. edb_info_id
  11. WHERE a.admin_id = ? ORDER BY a.create_time desc `
  12. err = global.MYSQL["data"].Raw(sql, adminId).Scan(&items).Error
  13. return
  14. }