|
@@ -1,8 +1,10 @@
|
|
|
package chart_edb_mapping
|
|
|
|
|
|
import (
|
|
|
+ "fmt"
|
|
|
"hongze/hongze_yb/global"
|
|
|
"hongze/hongze_yb/utils"
|
|
|
+ "strings"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
@@ -128,10 +130,14 @@ func GetChartEdbMappingListByEdbInfoIdList(edbIdList []int) (list []*ChartEdbInf
|
|
|
}
|
|
|
sql := ` SELECT edb_info_id,source_name,source,edb_code,edb_name,edb_name_en,frequency,unit,unit_en,start_date,end_date,modify_time,latest_date,latest_value,unique_code,edb_info_type AS edb_info_category_type,max_value,min_value
|
|
|
FROM edb_info
|
|
|
- WHERE edb_info_id IN(` + utils.GetOrmInReplace(num) + `)
|
|
|
- ORDER BY FIELD(edb_info_id,` + utils.GetOrmInReplace(num) + `)
|
|
|
+ WHERE edb_info_id IN(?)
|
|
|
+ ORDER BY FIELD(edb_info_id,?)
|
|
|
`
|
|
|
- err = global.MYSQL["data"].Raw(sql, edbIdList, edbIdList).Find(&list).Error
|
|
|
+ edbIdStrList := make([]string, 0)
|
|
|
+ for _, v := range edbIdList {
|
|
|
+ edbIdStrList = append(edbIdStrList, fmt.Sprint(v))
|
|
|
+ }
|
|
|
+ err = global.MYSQL["data"].Raw(sql, edbIdList, strings.Join(edbIdStrList, ",")).Find(&list).Error
|
|
|
|
|
|
return
|
|
|
}
|