|
@@ -12,6 +12,7 @@ type ChartEdbInfoMapping struct {
|
|
|
EdbInfoId int `description:"指标id"`
|
|
|
SourceName string `description:"来源名称"`
|
|
|
Source int `description:"来源id"`
|
|
|
+ SubSource int `description:"来源id"`
|
|
|
EdbCode string `description:"指标编码"`
|
|
|
EdbName string `description:"指标名称"`
|
|
|
EdbAliasName string `description:"指标名称(别名)"`
|
|
@@ -61,7 +62,7 @@ type ChartEdbInfoMappingList struct {
|
|
|
func GetMappingListByChartInfoId(chartInfoId int) (list []*ChartEdbInfoMapping, err error) {
|
|
|
aField := `a.chart_edb_mapping_id,a.chart_info_id,a.edb_info_id,a.create_time,a.modify_time,a.unique_code,a.max_data,a.min_data,a.is_order,a.is_axis,a.edb_info_type,a.lead_value,a.lead_unit,a.chart_style,a.chart_color,a.predict_chart_color,a.chart_width,a.source as mapping_source`
|
|
|
|
|
|
- sql := ` SELECT ` + aField + `,b.source_name,b.source,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 ` + aField + `,b.source_name,b.source,b.sub_source,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
|
|
|
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=?
|
|
@@ -73,7 +74,7 @@ func GetMappingListByChartInfoId(chartInfoId int) (list []*ChartEdbInfoMapping,
|
|
|
|
|
|
// GetMappingListByEdbInfoId 根据指标ID获取指标映射列表
|
|
|
func GetMappingListByEdbInfoId(edbInfoStr string) (list []*ChartEdbInfoMapping, err error) {
|
|
|
- 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(` + edbInfoStr + `) ORDER BY FIELD(edb_info_id,` + edbInfoStr + `) `
|
|
|
+ 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 FROM edb_info WHERE edb_info_id IN(` + edbInfoStr + `) ORDER BY FIELD(edb_info_id,` + edbInfoStr + `) `
|
|
|
err = global.MYSQL["data"].Raw(sql).Scan(&list).Error
|
|
|
return
|
|
|
}
|
|
@@ -81,7 +82,7 @@ func GetMappingListByEdbInfoId(edbInfoStr string) (list []*ChartEdbInfoMapping,
|
|
|
// GetEtaEdbChartEdbMapping 商品曲线图查询对应的普通指标
|
|
|
func GetEtaEdbChartEdbMapping(chartInfoId int) (item *ChartEdbInfoMappingList, err error) {
|
|
|
aField := `a.chart_edb_mapping_id,a.chart_info_id,a.edb_info_id,a.create_time,a.modify_time,a.unique_code,a.max_data,a.min_data,a.is_order,a.is_axis,a.edb_info_type,a.lead_value,a.lead_unit,a.chart_style,a.chart_color,a.predict_chart_color,a.chart_width,a.source as mapping_source`
|
|
|
- sql := ` SELECT ` + aField + `,b.source_name,b.source,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
|
|
|
+ sql := ` SELECT ` + aField + `,b.source_name,b.source,b.sub_source,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
|
|
|
FROM chart_edb_mapping AS a
|
|
|
INNER JOIN edb_info AS b ON a.edb_info_id=b.edb_info_id
|
|
|
WHERE a.chart_info_id=? AND a.source = ?
|
|
@@ -116,7 +117,7 @@ func GetFutureGoodEdbChartEdbMappingList(chartInfoId int) (items []*ChartEdbInfo
|
|
|
|
|
|
// GetChartEdbMappingByEdbInfoId 根据指标id获取edb_mapping
|
|
|
func GetChartEdbMappingByEdbInfoId(edbInfoId int) (item *ChartEdbInfoMapping, err error) {
|
|
|
- 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
|
|
|
+ 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
|
|
|
FROM edb_info
|
|
|
WHERE edb_info_id = ? limit 1`
|
|
|
err = global.MYSQL["data"].Raw(sql, edbInfoId).First(&item).Error
|
|
@@ -129,7 +130,7 @@ func GetChartEdbMappingListByEdbInfoIdList(edbIdList []int) (list []*ChartEdbInf
|
|
|
if num <= 0 {
|
|
|
return
|
|
|
}
|
|
|
- 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
|
|
|
+ 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
|
|
|
FROM edb_info
|
|
|
WHERE edb_info_id IN(?)
|
|
|
ORDER BY FIELD(edb_info_id,?)
|