chart_series_edb_mapping.go 1.4 KB

123456789101112131415161718192021222324252627282930
  1. package models
  2. import (
  3. "eta_gn/eta_chart_lib/global"
  4. "time"
  5. )
  6. type ChartSeriesEdbMapping struct {
  7. ChartSeriesEdbMappingId int `gorm:"column:chart_series_edb_mapping_id;primaryKey" description:"系列指标映射ID" orm:"column(chart_series_edb_mapping_id);pk"`
  8. ChartSeriesId int `gorm:"column:chart_series_id" description:"系列ID"`
  9. ChartInfoId int `gorm:"column:chart_info_id" description:"图表ID"`
  10. EdbInfoId int `gorm:"column:edb_info_id" description:"指标id"`
  11. DateConfName string `gorm:"column:date_conf_name" description:"引用日期配置名称"`
  12. DateConfType int `gorm:"column:date_conf_type" description:"日期类型,0指标最新日期,1引用日期"`
  13. DateConf string `gorm:"column:date_conf" description:"日期配置名称"`
  14. ModifyTime time.Time `gorm:"column:modify_time" description:"修改时间"`
  15. CreateTime time.Time `gorm:"column:create_time" description:"创建时间"`
  16. }
  17. func (c *ChartSeriesEdbMapping) TableName() string {
  18. return "chart_series_edb_mapping"
  19. }
  20. func GetChartSeriesEdbByChartInfoId(chartInfoId int) (items []*ChartSeriesEdbMapping, err error) {
  21. o := global.DmSQL["data"]
  22. sql := "SELECT * FROM chart_series_edb_mapping WHERE chart_info_id = ?"
  23. err = o.Raw(sql, chartInfoId).Scan(&items).Error
  24. return
  25. }