|
@@ -45,6 +45,7 @@ type ChartEdbInfoMapping struct {
|
|
|
LeadUnitEn string `description:"领先英文单位"`
|
|
|
PredictChartColor string `description:"预测数据的颜色"`
|
|
|
ChartType int `description:"生成样式:1:曲线图,2:季节性图,3:面积图,4:柱状图,5:散点图,6:组合图"`
|
|
|
+ MappingSource int `description:"1:ETA图库;2:商品价格曲线"`
|
|
|
}
|
|
|
|
|
|
type ChartEdbInfoMappingList struct {
|
|
@@ -55,7 +56,9 @@ type ChartEdbInfoMappingList struct {
|
|
|
|
|
|
// GetMappingListByChartInfoId 根据图表ID获取指标映射列表
|
|
|
func GetMappingListByChartInfoId(chartInfoId int) (list []*ChartEdbInfoMapping, err error) {
|
|
|
- sql := ` SELECT a.*,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
|
|
|
+ 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
|
|
|
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=?
|
|
@@ -74,7 +77,8 @@ func GetMappingListByEdbInfoId(edbInfoStr string) (list []*ChartEdbInfoMapping,
|
|
|
|
|
|
// GetEtaEdbChartEdbMapping 商品曲线图查询对应的普通指标
|
|
|
func GetEtaEdbChartEdbMapping(chartInfoId int) (item *ChartEdbInfoMappingList, err error) {
|
|
|
- sql := ` SELECT a.*,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
|
|
|
+ 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
|
|
|
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 = ?
|
|
@@ -85,7 +89,8 @@ func GetEtaEdbChartEdbMapping(chartInfoId int) (item *ChartEdbInfoMappingList, e
|
|
|
|
|
|
// GetFutureGoodEdbChartEdbMapping 商品曲线图查询对应的商品指标
|
|
|
func GetFutureGoodEdbChartEdbMapping(chartInfoId int) (item *ChartEdbInfoMappingList, err error) {
|
|
|
- sql := ` SELECT a.*,b.future_good_edb_info_id,b.future_good_edb_code as edb_code,b.future_good_edb_name as edb_name,b.start_date,b.end_date,b.modify_time,b.latest_date,b.latest_value
|
|
|
+ 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.future_good_edb_info_id,b.future_good_edb_code as edb_code,b.future_good_edb_name as edb_name,b.start_date,b.end_date,b.modify_time,b.latest_date,b.latest_value
|
|
|
FROM chart_edb_mapping AS a
|
|
|
INNER JOIN future_good_edb_info AS b ON a.edb_info_id=b.future_good_edb_info_id
|
|
|
WHERE a.chart_info_id=? AND a.source = ?
|