edb_data_sci.go 370 B

123456789101112
  1. package data_manage
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. func GetEdbDataSciMaxAndMinDate(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_sci WHERE edb_code=? `
  8. err = o.Raw(sql, edbCode).QueryRow(&min_date, &max_date)
  9. return
  10. }