edb_data_mysteel_chemical.go 485 B

12345678910111213
  1. package data_manage
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. // GetEdbDataMysteelChemicalMaxOrMinDate 根据钢联化工指标code获取最大、最小日期
  6. func GetEdbDataMysteelChemicalMaxOrMinDate(edbCode string) (minDate, maxDate string, err error) {
  7. o := orm.NewOrmUsingDB("data")
  8. sql := ` SELECT MIN(data_time) AS minDate,MAX(data_time) AS maxDate FROM edb_data_mysteel_chemical WHERE edb_code=? `
  9. err = o.Raw(sql, edbCode).QueryRow(&minDate, &maxDate)
  10. return
  11. }