predict_edb_conf_calculate_mapping.go 1.6 KB

123456789101112131415161718192021222324252627282930
  1. package models
  2. import (
  3. "eta_gn/eta_index_lib/global"
  4. "time"
  5. )
  6. // PredictEdbConfCalculateMapping 预测基础指标规则 与 计算预测指标关联关系表
  7. type PredictEdbConfCalculateMapping struct {
  8. PredictEdbConfCalculateMappingId int `gorm:"primaryKey;autoIncrement;column:predict_edb_conf_calculate_mapping_id"`
  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. sql := ` SELECT * from predict_edb_conf_calculate_mapping WHERE edb_info_id=? ORDER BY predict_edb_conf_calculate_mapping_id ASC `
  24. err = global.DEFAULT_DmSQL.Raw(sql, edbInfoId).Find(&list).Error
  25. return
  26. }