edb_data_ths.go 638 B

12345678910111213141516171819202122232425
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type EdbDataThs struct {
  7. EdbDataId int `orm:"column(edb_data_id);pk"`
  8. EdbInfoId int
  9. EdbCode string
  10. DataTime string
  11. Value float64
  12. Status int
  13. CreateTime time.Time
  14. ModifyTime time.Time
  15. DataTimestamp int64
  16. }
  17. func GetEdbDataThs(indexCode, startDate, endDate string) (list []*EdbDataThs, err error) {
  18. o := orm.NewOrm()
  19. sql := `SELECT * FROM edb_data_ths WHERE edb_code=? AND create_time>=? AND create_time<=? ORDER BY create_time ASC `
  20. _, err = o.Raw(sql, indexCode, startDate, endDate).QueryRows(&list)
  21. return
  22. }