|
@@ -759,17 +759,30 @@ func GetEdbInfoCalculateListByCondition(condition string, pars []interface{}) (i
|
|
|
}
|
|
|
|
|
|
// GetEdbInfoAllCalculateByEdbInfoIdList 根据指标id集合 获取基础指标对应的所有计算指标
|
|
|
-func GetEdbInfoAllCalculateByEdbInfoIdList(edbInfoIdList []int) (list []*EdbInfo, err error) {
|
|
|
- num := len(edbInfoIdList)
|
|
|
+func GetEdbInfoAllCalculateByEdbInfoIdList(fromEdbInfoIdList []int) (list []*EdbInfo, err error) {
|
|
|
+ num := len(fromEdbInfoIdList)
|
|
|
if num <= 0 {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- sql := ` SELECT DISTINCT b.* FROM edb_info_calculate_mapping AS a
|
|
|
+ edbEdbInfoIdList := make([]int, 0)
|
|
|
+ sql := ` SELECT DISTINCT b.edb_info_id FROM edb_info_calculate_mapping AS a
|
|
|
INNER JOIN edb_info AS b ON a.edb_info_id=b.edb_info_id
|
|
|
WHERE a.from_edb_info_id in (` + utils.GetOrmInReplace(num) + `)
|
|
|
ORDER BY b.edb_info_id ASC `
|
|
|
- err = global.DmSQL["data"].Raw(sql, edbInfoIdList).Scan(&list).Error
|
|
|
+ err = global.DmSQL["data"].Raw(sql, fromEdbInfoIdList).Scan(&edbEdbInfoIdList).Error
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 查询来的实际id集合
|
|
|
+ num = len(edbEdbInfoIdList)
|
|
|
+ if num <= 0 {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ sql = ` SELECT * FROM edb_info WHERE edb_info_id IN (` + utils.GetOrmInReplace(num) + `) ORDER BY edb_info_id ASC `
|
|
|
+ err = global.DmSQL["data"].Raw(sql, edbEdbInfoIdList).Find(&list).Error
|
|
|
|
|
|
return
|
|
|
}
|