edb_info_refresh.go 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package data_manage
  2. // SaveRelationEdbRefreshStatusReq
  3. // @Description: 设置被引用的指标的刷新状态
  4. type SaveRelationEdbRefreshStatusReq struct {
  5. Source int `description:"来源"`
  6. /*ClassifyId string `description:"分类id,支持多选,用英文,隔开"`
  7. SysUserId string `description:"操作人id,支持多选,用英文,隔开"`
  8. Frequency string `description:"频度,支持多选,用英文,隔开"`
  9. Status string `description:"状态,枚举值:启用、暂停"`
  10. EdbInfoType int `description:"1计算指标,2预测指标"`
  11. Keyword string `description:"关键字"`
  12. IsSelectAll bool `description:"是否选择所有指标"`*/
  13. EdbSelectIdList []int `description:"选择的指标id列表"`
  14. ModifyStatus string `description:"需要更改的状态,枚举值:启用、暂停"`
  15. }
  16. // 查询指标引用列表
  17. /*func GetEdbInfoRelationList(condition string, pars []interface{}, addFieldStr, joinTableStr, orderBy string, startSize, pageSize int) (total int, items []*BaseRelationEdbInfo, err error) {
  18. o := orm.NewOrmUsingDB("data")
  19. // 数量汇总
  20. totalSql := ` SELECT count(1) FROM edb_info e LEFT JOIN (
  21. SELECT count(edb_info_id) as relation_num, edb_info_id, max(relation_time) as relation_time FROM edb_info_relation GROUP BY edb_info_id) r on e.edb_info_id=r.edb_info_id `
  22. if joinTableStr != "" {
  23. totalSql += joinTableStr
  24. }
  25. totalSql += ` WHERE 1=1 `
  26. if condition != "" {
  27. totalSql += condition
  28. }
  29. err = o.Raw(totalSql, pars).QueryRow(&total)
  30. if err != nil {
  31. return
  32. }
  33. fieldStr := ` e.edb_info_id, e.classify_id,e.edb_code,e.edb_name,e.sys_user_id,e.sys_user_real_name,e.frequency,e.no_update as is_stop, r.relation_num, r.relation_time ` + addFieldStr
  34. // 列表数据
  35. sql := ` SELECT ` + fieldStr + ` from edb_info e LEFT JOIN (
  36. SELECT count(edb_info_id) as relation_num, edb_info_id, max(relation_time) as relation_time FROM edb_info_relation GROUP BY edb_info_id) r on e.edb_info_id=r.edb_info_id `
  37. if joinTableStr != "" {
  38. sql += joinTableStr
  39. }
  40. sql += ` WHERE 1=1 `
  41. if condition != "" {
  42. sql += condition
  43. }
  44. if orderBy != "" {
  45. sql += ` ORDER BY ` + orderBy
  46. } else {
  47. sql += ` ORDER BY edb_info_id ASC `
  48. }
  49. sql += ` LIMIT ?,? `
  50. _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
  51. return
  52. }*/