model.go 1.4 KB

12345678910111213141516171819202122232425262728
  1. package factor_edb_series_chart_mapping
  2. import (
  3. "hongze/hongze_yb/global"
  4. "time"
  5. )
  6. // FactorEdbSeriesChartMapping 因子指标系列-图表关联
  7. type FactorEdbSeriesChartMapping struct {
  8. FactorEdbSeriesChartMappingId int `orm:"column(factor_edb_series_chart_mapping_id);pk"`
  9. ChartInfoId int `description:"图表ID"`
  10. Source int `description:"图表来源, 同chart_info表source"`
  11. CalculateType int `description:"计算方式: 1-相关性"`
  12. CalculatePars string `description:"计算参数-JSON(如计算窗口等)"`
  13. CalculateData string `description:"计算数据-JSON(如相关性矩阵等)"`
  14. FactorEdbSeriesId int `description:"因子指标系列ID"`
  15. EdbInfoId int `description:"指标ID"`
  16. EdbUsed int `description:"指标是否使用: 0-否; 1-是"`
  17. CreateTime time.Time `description:"创建时间"`
  18. ModifyTime time.Time `description:"修改时间"`
  19. }
  20. // GetChartUsedFactorSeriesEdb 获取图表引用的系列指标
  21. func GetChartUsedFactorSeriesEdb(chartId int) (items []*FactorEdbSeriesChartMapping, err error) {
  22. sql := `SELECT * FROM factor_edb_series_chart_mapping WHERE chart_info_id = ? AND edb_used = 1`
  23. err = global.MYSQL["data"].Raw(sql, chartId).Scan(&items).Error
  24. return
  25. }