edb_info_calculate_mapping.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type EdbInfoCalculateItemReq struct {
  7. EdbCode string `description:"指标编码"`
  8. }
  9. type EdbInfoCalculateMapping struct {
  10. EdbInfoCalculateMappingId int `orm:"column(edb_info_calculate_mapping_id);pk"`
  11. EdbInfoId int `description:"计算指标id"`
  12. Source int `description:"计算指标来源"`
  13. SourceName string `description:"计算指标来源名称"`
  14. EdbCode string `description:"计算指标编码"`
  15. FromEdbInfoId int `description:"基础指标id"`
  16. FromEdbCode string `description:"基础指标编码"`
  17. FromEdbName string `description:"基础指标名称"`
  18. FromSource int `description:"基础指标来源"`
  19. FromSourceName string `description:"基础指标来源名称"`
  20. FromTag string `description:"来源指标标签"`
  21. MoveValue int `description:"移动的值,小于0是提前,0是不变,大于0是滞后"`
  22. Sort int `description:"计算指标名称排序"`
  23. CreateTime time.Time `description:"创建时间"`
  24. ModifyTime time.Time `description:"修改时间"`
  25. }
  26. func GetEdbInfoCalculateMappingByEdbCode(edbCode string) (list []*EdbInfoCalculateMapping, err error) {
  27. o := orm.NewOrm()
  28. sql := ` SELECT * FROM edb_info_calculate_mapping AS a
  29. WHERE a.edb_code=?
  30. ORDER BY a.edb_info_calculate_mapping_id ASC `
  31. _, err = o.Raw(sql, edbCode).QueryRows(&list)
  32. return
  33. }