edb_data_gl.go 521 B

1234567891011121314151617
  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. }
  11. type GlData struct {
  12. InputValue string `orm:"column(DATA_VALUE)" description:"日期"`
  13. DataTime string `orm:"column(DATA_DATE)" description:"值"`
  14. }