chart_edb_mapping.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package models
  2. import (
  3. "eta_gn/eta_index_lib/global"
  4. "time"
  5. )
  6. type ChartEdbMapping struct {
  7. ChartEdbMappingId int `gorm:"primaryKey;autoIncrement;column:chart_edb_mapping_id"`
  8. ChartInfoId int `gorm:"column:chart_info_id" description:"图表id"`
  9. EdbInfoId int `gorm:"column:edb_info_id" description:"指标id"`
  10. CreateTime time.Time `gorm:"column:create_time" description:"创建时间"`
  11. ModifyTime time.Time `gorm:"column:modify_time" description:"修改时间"`
  12. UniqueCode string `gorm:"column:unique_code" description:"唯一编码"`
  13. MaxData float64 `gorm:"column:max_data" description:"上限"`
  14. MinData float64 `gorm:"column:min_data" description:"下限"`
  15. IsOrder bool `gorm:"column:is_order" description:"true:正序,false:逆序"`
  16. IsAxis int `gorm:"column:is_axis" description:"true:左轴,false:右轴"`
  17. EdbInfoType int `gorm:"column:edb_info_type" description:"true:标准指标,false:领先指标"`
  18. LeadValue int `gorm:"column:lead_value" description:"领先值"`
  19. LeadUnit string `gorm:"column:lead_unit" description:"领先单位"`
  20. ChartStyle string `gorm:"column:chart_style" description:"图表类型"`
  21. ChartColor string `gorm:"column:chart_color" description:"颜色"`
  22. ChartWidth float64 `gorm:"column:chart_width" description:"线条大小"`
  23. Source int `gorm:"column:source" description:"1:ETA图库;2:商品价格曲线"`
  24. }
  25. // GetChartEdbMappingListByEdbInfoId 根据指标id获取关联图表列表
  26. func GetChartEdbMappingListByEdbInfoId(edbInfoId int) (list []*ChartEdbMapping, err error) {
  27. sql := ` SELECT *
  28. FROM chart_edb_mapping AS a
  29. WHERE edb_info_id=?
  30. ORDER BY chart_edb_mapping_id ASC `
  31. err = global.DEFAULT_DmSQL.Raw(sql, edbInfoId).Scan(&list).Error
  32. return
  33. }