edb_data_calculate_ljztbpj.go 790 B

123456789101112131415161718192021222324252627
  1. package data_manage
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // EdbDataCalculateLjztbpj 累计值同比拼接数据结构体
  7. type EdbDataCalculateLjztbpj struct {
  8. EdbDataId int `orm:"column(edb_data_id);pk"`
  9. EdbInfoId int
  10. EdbCode string
  11. DataTime string
  12. Value float64
  13. Status int
  14. CreateTime time.Time
  15. ModifyTime time.Time
  16. DataTimestamp int64
  17. }
  18. // GetAllEdbDataCalculateLjztbpjByEdbInfoId 根据指标id获取全部的数据
  19. func GetAllEdbDataCalculateLjztbpjByEdbInfoId(edbInfoId int) (items []*EdbDataCalculateLjztbpj, err error) {
  20. o := orm.NewOrmUsingDB("data")
  21. sql := ` SELECT * FROM edb_data_calculate_ljztbpj WHERE edb_info_id=? ORDER BY data_time DESC `
  22. _, err = o.Raw(sql, edbInfoId).QueryRows(&items)
  23. return
  24. }