query.go 2.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package predict_edb_conf_calculate_mapping
  2. import (
  3. "hongze/hongze_yb/global"
  4. "time"
  5. )
  6. // GetPredictEdbRuleDataList 根据基础预测指标id集合 获取 所有的普通指标列表数据
  7. func GetPredictEdbRuleDataList(fromEdbInfoIdList []int) (items []*PredictEdbConfCalculateMappingDetail, err error) {
  8. sql := ` SELECT a.predict_edb_conf_calculate_mapping_id,a.edb_info_id,a.from_edb_info_id,a.from_edb_code,a.from_source,a.from_source_name,a.sort,a.create_time,a.modify_time,a.from_tag,b.edb_name_source as from_edb_name,b.start_date,b.end_date,b.edb_type,b.edb_code FROM predict_edb_conf_calculate_mapping AS a
  9. INNER JOIN edb_info AS b ON a.from_edb_info_id=b.edb_info_id
  10. WHERE a.edb_info_id in (?) GROUP BY a.edb_info_id ORDER BY sort ASC `
  11. err = global.MYSQL["data"].Raw(sql, fromEdbInfoIdList).Scan(&items).Error
  12. return
  13. }
  14. type PredictEdbConfCalculateMappingDetail struct {
  15. PredictEdbConfCalculateMappingId int `orm:"column(predict_edb_conf_calculate_mapping_id);pk"`
  16. EdbInfoId int `description:"指标id"`
  17. ConfigId int `description:"配置id"`
  18. FromEdbInfoId int `description:"基础指标id"`
  19. FromEdbCode string `description:"基础指标编码"`
  20. FromEdbName string `description:"基础指标名称"`
  21. FromSource int `description:"基础指标来源"`
  22. FromSourceName string `description:"基础指标来源名称"`
  23. FromTag string `description:"来源指标标签"`
  24. Sort int `description:"计算指标名称排序"`
  25. CreateTime time.Time `description:"创建时间"`
  26. ModifyTime time.Time `description:"修改时间"`
  27. StartDate string `description:"开始日期"`
  28. EndDate string `description:"结束日期"`
  29. EdbType int `description:"指标类型:1:基础指标,2:计算指标"`
  30. EdbCode string `description:"指标code"`
  31. }