package data_manage import ( "github.com/beego/beego/v2/client/orm" "time" ) type ChartEdbMapping struct { ChartEdbMappingId int `orm:"column(chart_edb_mapping_id);pk"` ChartInfoId int `description:"图表id"` EdbInfoId int `description:"指标id"` CreateTime time.Time `description:"创建时间"` ModifyTime time.Time `description:"修改时间"` UniqueCode string `description:"唯一编码"` MaxData float64 `description:"上限"` MinData float64 `description:"下限"` IsOrder bool `description:"true:正序,false:逆序"` IsAxis int `description:"true:左轴,false:右轴"` EdbInfoType int `description:"true:标准指标,false:领先指标"` LeadValue int `description:"领先值"` LeadUnit string `description:"领先单位"` ChartStyle string `description:"图表类型"` ChartColor string `description:"颜色"` PredictChartColor string `description:"预测数据的颜色"` ChartWidth float64 `description:"线条大小"` Source int `description:"1:ETA图库;2:商品价格曲线"` EdbAliasName string `description:"中文别名"` IsConvert int `description:"是否数据转换 0不转 1转"` ConvertType int `description:"数据转换类型 1乘 2除 3对数"` ConvertValue float64 `description:"数据转换值"` ConvertUnit string `description:"数据转换单位"` ConvertEnUnit string `description:"数据转换单位"` } func GetChartEdbMappingTotal() (total int, err error) { o := orm.NewOrmUsingDB("data") sql := ` SELECT COUNT(1) AS count FROM chart_edb_mapping ` err = o.Raw(sql).QueryRow(&total) return } func GetChartEdbMappingList(startSize, pageSize int) (items []*ChartEdbMapping, err error) { o := orm.NewOrmUsingDB("data") sql := ` SELECT * FROM chart_edb_mapping WHERE 1=1 ` sql += " LIMIT ?,? " _, err = o.Raw(sql, startSize, pageSize).QueryRows(&items) return }