package edb_info_no_permission_admin

import "hongze/hongze_yb/global"

type NoPermissionChart struct {
	AdminId     int
	ChartInfoId int
}

// GetAllChartListByAdminId 根据用户id获取该用户的所有配置
func GetAllChartListByAdminId(adminId int) (items []*NoPermissionChart, err error) {
	sql := ` SELECT a.admin_id,b.chart_info_id FROM edb_info_no_permission_admin AS a 
			JOIN chart_edb_mapping AS b ON a.edb_info_id=b. edb_info_id
			WHERE a.admin_id = ? ORDER BY a.create_time desc `
	err = global.MYSQL["data"].Raw(sql, adminId).Scan(&items).Error

	return
}
