edb_data_gl.go 367 B

123456789101112
  1. package data_manage
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. func GetEdbDataGlMaxOrMinDate(edbCode string) (min_date, max_date string, err error) {
  6. o := orm.NewOrmUsingDB("data")
  7. sql := ` SELECT MIN(data_time) AS min_date,MAX(data_time) AS max_date FROM edb_data_gl WHERE edb_code=? `
  8. err = o.Raw(sql, edbCode).QueryRow(&min_date, &max_date)
  9. return
  10. }