edb_info_delete_log.go 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. package data_stat
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. // EdbInfoDeleteLog 指标删除日志表
  6. type EdbInfoDeleteLog struct {
  7. Id uint64 `orm:"column(id);pk"`
  8. EdbInfoId int `description:"指标ID"`
  9. EdbInfoType int `description:"指标类型,0:普通指标,1:预测指标"`
  10. SourceName string `description:"来源名称"`
  11. Source int `description:"来源id"`
  12. EdbCode string `description:"指标编码"`
  13. EdbName string `description:"指标名称"`
  14. EdbNameEn string `description:"英文指标名称"`
  15. EdbNameSource string `description:"指标名称来源"`
  16. Frequency string `description:"频率"`
  17. Unit string `description:"单位"`
  18. UnitEn string `description:"英文单位"`
  19. StartDate string `description:"起始日期"`
  20. EndDate string `description:"终止日期"`
  21. SysUserId int `description:"创建人ID"`
  22. SysUserRealName string `description:"创建人姓名"`
  23. UniqueCode string `description:"指标唯一编码"`
  24. EdbCreateTime string `description:"指标创建时间"`
  25. EdbModifyTime string `description:"指标修改时间"`
  26. CreateTime string `description:"创建时间即删除时间"`
  27. MinValue float64 `description:"指标最小值"`
  28. MaxValue float64 `description:"指标最大值"`
  29. CalculateFormula string `description:"计算公式"`
  30. EdbType int `description:"指标类型:1:基础指标,2:计算指标"`
  31. LatestDate string `description:"数据最新日期"`
  32. LatestValue float64 `description:"数据最新值"`
  33. MoveType int `description:"移动方式:1:领先(默认),2:滞后"`
  34. MoveFrequency string `description:"移动频度"`
  35. NoUpdate int8 `description:"是否停止更新,0:继续更新;1:停止更新"`
  36. ChartImage string `description:"图表图片"`
  37. Calendar string `description:"公历/农历" orm:"default(公历);"`
  38. DataDateType string `orm:"column(data_date_type);size(255);null;default(交易日)"`
  39. ManualSave int `description:"是否有手动保存过上下限: 0-否; 1-是"`
  40. TerminalCode string `description:"终端编码,用于配置在机器上"`
  41. DelSysUserId int `description:"删除人ID"`
  42. DelSysUserRealName string `description:"删除人姓名"`
  43. DataUpdateTime string `description:"最近一次数据发生变化的时间"`
  44. ErDataUpdateDate string `description:"本次更新,数据发生变化的最早日期"`
  45. }
  46. type EdbInfoDeleteLogNum struct {
  47. Source int `description:"来源id"`
  48. TerminalCode string `description:"终端编码,用于配置在机器上"`
  49. Num int `description:"被删除的指标数据总数"`
  50. }
  51. func GetEdbDeleteLogNumByCreateTime(startDate, endDate string) (item []*EdbInfoDeleteLogNum, err error) {
  52. o := orm.NewOrm()
  53. sql := ` SELECT source, terminal_code, count(*) as num FROM edb_info_delete_log WHERE create_time >= ? and create_time < ? group by source, terminal_code `
  54. _, err = o.Raw(sql, startDate, endDate).QueryRows(&item)
  55. return
  56. }