edb_data_baiinfo.go 605 B

1234567891011121314151617181920
  1. package data_manage
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. type BaseFromBaiinfoDataSimple struct {
  6. BaiinfoDataId int `orm:"column(baiinfo_data_id);pk"`
  7. BaseFromBaiinfoIndexId int
  8. IndexCode string
  9. DataTime string
  10. Value string
  11. }
  12. func GetEdbDataBaiinfoMaxAndMinDate(edbCode string) (min_date, max_date string, err error) {
  13. o := orm.NewOrmUsingDB("data")
  14. sql := ` SELECT MIN(data_time) AS min_date,MAX(data_time) AS max_date FROM edb_data_baiinfo WHERE edb_code=? `
  15. err = o.Raw(sql, edbCode).QueryRow(&min_date, &max_date)
  16. return
  17. }