predict_edb_conf_calculate_mapping.go 1.6 KB

1234567891011121314151617181920212223242526272829303132
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // PredictEdbConfCalculateMapping 预测基础指标规则 与 计算预测指标关联关系表
  7. type PredictEdbConfCalculateMapping struct {
  8. PredictEdbConfCalculateMappingId int `orm:"column(predict_edb_conf_calculate_mapping_id);pk"`
  9. EdbInfoId int `description:"指标id"`
  10. ConfigId int `description:"配置id"`
  11. FromEdbInfoId int `description:"基础指标id"`
  12. FromEdbCode string `description:"基础指标编码"`
  13. FromEdbName string `description:"基础指标名称"`
  14. FromSource int `description:"基础指标来源"`
  15. FromSourceName string `description:"基础指标来源名称"`
  16. FromTag string `description:"来源指标标签"`
  17. Sort int `description:"计算指标名称排序"`
  18. CreateTime time.Time `description:"创建时间"`
  19. ModifyTime time.Time `description:"修改时间"`
  20. }
  21. // GetPredictEdbConfCalculateMappingListByEdbInfoId 根据预测指标id获取所有关联指标
  22. func GetPredictEdbConfCalculateMappingListByEdbInfoId(edbInfoId int) (list []*PredictEdbConfCalculateMapping, err error) {
  23. o := orm.NewOrm()
  24. sql := ` SELECT * from predict_edb_conf_calculate_mapping
  25. WHERE edb_info_id=? ORDER BY predict_edb_conf_calculate_mapping_id ASC `
  26. _, err = o.Raw(sql, edbInfoId).QueryRows(&list)
  27. return
  28. }