chart_series_edb_mapping.go 2.3 KB

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