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