package models import ( "github.com/beego/beego/v2/client/orm" "time" ) type BaseFromTradeEicIndexV2 struct { BaseFromEicIndexId int `orm:"column(base_from_eic_index_id);pk"` Type string EicCode string Name string Status string GasDayStart string GasInStorage string GasInStorageCode string Consumption string ConsumptionCode string ConsumptionFull string ConsumptionFullCode string Full string FullCode string Trend string TrendCode string Injection string InjectionCode string Withdrawal string WithdrawalCode string WorkingGasVolume string WorkingGasVolumeCode string InjectionCapacity string InjectionCapacityCode string WithdrawalCapacity string WithdrawalCapacityCode string Info string Parent string CreateTime time.Time ModifyTime time.Time } func GetEicIndex(startDate, endDate string) (list []*BaseFromTradeEicIndexV2, err error) { o := orm.NewOrm() sql := `SELECT * FROM base_from_trade_eic_index_v2 WHERE create_time>=? AND create_time<=? ` _, err = o.Raw(sql, startDate, endDate).QueryRows(&list) return }