123456789101112131415161718192021222324252627282930313233343536 |
- package data_manage
- import (
- "eta_gn/eta_api/global"
- "eta_gn/eta_api/utils"
- "time"
- )
- // PredictEdbRuleData 预测指标,动态规则的计算数据
- type PredictEdbRuleData struct {
- PredictEdbRuleDataId int `orm:"column(predict_edb_rule_data_id);pk" gorm:"primaryKey" `
- EdbInfoId int
- ConfigId int
- DataTime string
- Value float64
- CreateTime time.Time
- ModifyTime time.Time
- DataTimestamp int64
- }
- // GetPredictEdbRuleDataList 根据基础预测指标id集合 获取 所有的普通指标列表数据
- func GetPredictEdbRuleDataList(edbInfoId, configId int, startDate, endDate string) (list []*PredictEdbRuleData, err error) {
- var pars []interface{}
- sql := ` SELECT * FROM predict_edb_rule_data WHERE edb_info_id = ? AND config_id = ? `
- if startDate != "" {
- sql += ` AND data_time>=? `
- pars = append(pars, startDate)
- }
- if endDate != "" {
- sql += ` AND data_time<=? `
- pars = append(pars, endDate)
- }
- sql += ` ORDER BY data_time ASC `
- err = global.DmSQL["data"].Raw(sql, utils.ForwardPars(pars, edbInfoId, configId)...).Find(&list).Error
- return
- }
|