edb_data_calculate_zjpj.go 750 B

123456789101112131415161718192021222324252627
  1. package data_manage
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // EdbDataCalculateZjpj 直接拼接数据结构体
  7. type EdbDataCalculateZjpj 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. // GetAllEdbDataCalculateZjpjByEdbInfoId 根据指标id获取全部的数据
  19. func GetAllEdbDataCalculateZjpjByEdbInfoId(edbInfoId int) (items []*EdbDataCalculateZjpj, err error) {
  20. o := orm.NewOrm()
  21. sql := ` SELECT * FROM edb_data_calculate_zjpj WHERE edb_info_id=? ORDER BY data_time DESC `
  22. _, err = o.Raw(sql, edbInfoId).QueryRows(&items)
  23. return
  24. }