package models import ( "github.com/beego/beego/v2/client/orm" "time" ) type EdbDataThs 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 DataTimestamp int64 } func GetEdbDataThs(indexCode, startDate, endDate string) (list []*EdbDataThs, err error) { o := orm.NewOrm() sql := `SELECT * FROM edb_data_ths WHERE edb_code=? AND create_time>=? AND create_time<=? ORDER BY create_time ASC ` _, err = o.Raw(sql, indexCode, startDate, endDate).QueryRows(&list) return }