|
@@ -45,7 +45,9 @@ func AddChartEdbMapping(items []*ChartEdbMapping) (err error) {
|
|
|
|
|
|
func GetChartEdbMappingList(chartInfoId int) (list []*ChartEdbInfoMapping, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
- sql := ` SELECT a.*,b.source_name,b.source,b.sub_source,b.classify_id,b.edb_code,b.edb_name,b.edb_name_en,b.frequency,b.unit,b.unit_en,b.start_date,b.end_date,b.modify_time,b.latest_date,b.latest_value,b.unique_code,b.edb_info_type AS edb_info_category_type,b.edb_type
|
|
|
+ sql := ` SELECT a.*,b.source_name,b.source,b.sub_source,b.classify_id,b.edb_code,b.edb_name,b.edb_name_en,b.frequency,b.unit,b.unit_en,b.start_date,
|
|
|
+b.end_date,b.modify_time,b.latest_date,b.latest_value,b.unique_code,b.edb_info_type AS edb_info_category_type,b.edb_type,
|
|
|
+b.is_convert, b.convert_type, b.convert_value, b.convert_unit, b.convert_en_unit
|
|
|
FROM chart_edb_mapping AS a
|
|
|
INNER JOIN edb_info AS b ON a.edb_info_id=b.edb_info_id
|
|
|
WHERE chart_info_id=?
|
|
@@ -83,12 +85,10 @@ func GetChartEdbMappingListByEdbInfoIdList(edbIdList []int) (list []*ChartEdbInf
|
|
|
return
|
|
|
}
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
- sql := ` SELECT a.edb_info_id,a.source_name,a.source,a.sub_source,a.edb_code,a.edb_name,a.edb_name_en,a.frequency,a.unit,
|
|
|
- a.unit_en,a.start_date,a.end_date,a.modify_time,a.latest_date,a.latest_value,a.unique_code,a.edb_info_type AS edb_info_category_type,a.max_value,min_value,a.edb_type,
|
|
|
- b.is_convert, b.convert_type, b.convert_value, b.convert_unit, b.convert_en_unit
|
|
|
- FROM edb_info as a left join chart_edb_mapping as b on a.edb_info_id=b.edb_info_id
|
|
|
- WHERE a.edb_info_id IN(` + utils.GetOrmInReplace(num) + `)
|
|
|
- ORDER BY FIELD(a.edb_info_id,` + utils.GetOrmInReplace(num) + `)
|
|
|
+ sql := ` SELECT edb_info_id,source_name,source,sub_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,edb_type
|
|
|
+ FROM edb_info
|
|
|
+ WHERE edb_info_id IN(` + utils.GetOrmInReplace(num) + `)
|
|
|
+ ORDER BY FIELD(edb_info_id,` + utils.GetOrmInReplace(num) + `)
|
|
|
`
|
|
|
_, err = o.Raw(sql, edbIdList, edbIdList).QueryRows(&list)
|
|
|
return
|