edb_data_pb.go 652 B

123456789101112131415161718192021222324252627
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type EdbDataPb 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. Ticker string
  16. Field string
  17. DataTimestamp int64
  18. }
  19. func GetEdbDataPb(indexCode, startDate, endDate string) (list []*EdbDataPb, err error) {
  20. o := orm.NewOrm()
  21. sql := `SELECT * FROM edb_data_pb WHERE edb_code=? AND create_time>=? AND create_time<=? `
  22. _, err = o.Raw(sql, indexCode, startDate, endDate).QueryRows(&list)
  23. return
  24. }