123456789101112131415161718192021222324252627 |
- package data_manage
- import (
- "github.com/beego/beego/v2/client/orm"
- "time"
- )
- type EdbDataPb struct {
- EdbDataId int `orm:"column(edb_data_id);pk"`
- EdbInfoId int
- EdbCode string
- DataTime string
- Value float64
- Status int
- CreateTime time.Time
- ModifyTime time.Time
- Ticker string
- Field string
- DataTimestamp int64
- }
- func GetEdbDataPbMaxOrMinDate(edbCode string) (min_date, max_date string, err error) {
- o := orm.NewOrmUsingDB("data")
- sql := ` SELECT MIN(data_time) AS min_date,MAX(data_time) AS max_date FROM edb_data_pb WHERE edb_code=? `
- err = o.Raw(sql, edbCode).QueryRow(&min_date, &max_date)
- return
- }
|