package chart_info_correlation

import "hongze/hongze_yb/global"

// GetItemById 主键获取
func (m *ChartInfoCorrelation) GetItemById(primaryId int) (err error) {
	err = global.MYSQL["data"].Model(m).
		Where("correlation_chart_info_id = ?", primaryId).
		First(&m).Error
	return
}

func (m *ChartInfoCorrelation) Update(updateCols []string) (err error) {
	err = global.MYSQL["data"].Model(m).Select(updateCols).Updates(*m).Error
	return
}

// CorrelationChartLegend 相关性图表图例
type CorrelationChartLegend struct {
	LegendName string `description:"图例名称"`
	Color      string `description:"图例颜色"`
	EdbInfoId  int    `description:"指标ID"`
	SeriesId   int    `description:"因子指标系列ID"`
}

// CorrelationSeriesEdbReq 指标系列
type CorrelationSeriesEdbReq struct {
	EdbInfoId int `description:"指标ID"`
	SeriesId  int `description:"因子指标系列ID"`
}

// CorrelationChartInfoExtraConfig 相关性图表额外设置
type CorrelationChartInfoExtraConfig struct {
	LegendConfig []*CorrelationChartLegend `description:"图例设置"`
}
