|
@@ -30,6 +30,11 @@ type ChartEdbMapping struct {
|
|
|
ChartWidth float64 `description:"线条大小"`
|
|
|
Source int `description:"1:ETA图库;2:商品价格曲线"`
|
|
|
EdbAliasName string `description:"中文别名"`
|
|
|
+ IsConvert int `description:"是否数据转换 0不转 1转"`
|
|
|
+ ConvertType int `description:"数据转换类型 1乘 2除 3对数"`
|
|
|
+ ConvertValue float64 `description:"数据转换值"`
|
|
|
+ ConvertUnit string `description:"数据转换单位"`
|
|
|
+ ConvertEnUnit string `description:"数据转换单位"`
|
|
|
}
|
|
|
|
|
|
func AddChartEdbMapping(items []*ChartEdbMapping) (err error) {
|
|
@@ -78,10 +83,12 @@ func GetChartEdbMappingListByEdbInfoIdList(edbIdList []int) (list []*ChartEdbInf
|
|
|
return
|
|
|
}
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
- 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) + `)
|
|
|
+ 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
|
|
|
+ WHERE a.edb_info_id IN(` + utils.GetOrmInReplace(num) + `)
|
|
|
+ ORDER BY FIELD(a.edb_info_id,` + utils.GetOrmInReplace(num) + `)
|
|
|
`
|
|
|
_, err = o.Raw(sql, edbIdList, edbIdList).QueryRows(&list)
|
|
|
return
|