12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- package data_manage
- import (
- "eta_gn/eta_chart_lib/global"
- "time"
- )
- type MultipleGraphConfig struct {
- MultipleGraphConfigId int `gorm:"column:multiple_graph_config_id;primaryKey" description:"多图配置ID" orm:"column(multiple_graph_config_id);pk"`
- EdbInfoIdA int `gorm:"column:edb_info_id_a" description:"指标A"`
- EdbInfoIdB int `gorm:"column:edb_info_id_b" description:"指标B"`
- Curve string `gorm:"column:curve" description:"曲线图配置"`
- Correlation string `gorm:"column:correlation" description:"相关性配置"`
- RollingCorrelation string `gorm:"column:rolling_correlation" description:"滚动相关性配置"`
- SysUserId int `gorm:"column:sys_user_id" description:"操作人id"`
- SysUserRealName string `gorm:"column:sys_user_real_name" description:"操作人真实姓名"`
- ModifyTime time.Time `gorm:"column:modify_time" description:"最近一次修改时间"`
- CreateTime time.Time `gorm:"column:create_time" description:"添加时间"`
- }
- func AddMultipleGraphConfig(item *MultipleGraphConfig) (err error) {
- o := global.DmSQL["data"]
- err = o.Create(item).Error
- return
- }
- func (item *MultipleGraphConfig) Update(cols []string) (err error) {
- o := global.DmSQL["data"]
- err = o.Model(item).Select(cols).Updates(item).Error
- return
- }
- func GetMultipleGraphConfigById(id int) (item *MultipleGraphConfig, err error) {
- o := global.DmSQL["data"]
- sql := `SELECT * FROM multiple_graph_config WHERE multiple_graph_config_id = ? `
- err = o.Raw(sql, id).First(&item).Error
- return
- }
- type CurveConfig struct {
- DateType int `description:"日期类型:1:00年至今,2:10年至今,3:15年至今,4:年初至今,5:自定义时间"`
- StartDate string `description:"自定义开始日期"`
- EndDate string `description:"自定义结束日期"`
- LeftMin float64 `description:"图表左侧最小值"`
- LeftMax float64 `description:"图表左侧最大值"`
- RightMin float64 `description:"图表右侧最小值"`
- RightMax float64 `description:"图表右侧最大值"`
- IsOrder bool `description:"true:正序,false:逆序"`
- EdbInfoType bool `description:"true:标准指标,false:领先指标"`
- LeadValue int `description:"领先值"`
- LeadUnit string `description:"领先单位"`
- }
- type CorrelationConfig struct {
- LeadValue int `description:"领先期数"`
- LeadUnit string `description:"频度"`
- CalculateValue int `description:"计算窗口"`
- CalculateUnit string `description:"计算频度"`
- }
- type RollingCorrelationConfig struct {
- LeadValue int `description:"领先期数"`
- LeadUnit string `description:"频度"`
- CalculateValue int `description:"计算窗口"`
- CalculateUnit string `description:"计算频度"`
- }
|