123456789101112131415161718192021222324252627282930313233343536 |
- package models
- import (
- "eta_gn/eta_task/global"
- "time"
- )
- type EdbInfo struct {
- UserId int
- SecName string `orm:"column(SEC_NAME);" description:"指标名称"`
- NoticeTime string
- Frequency string
- TradeCode string `orm:"column(TRADE_CODE);" description:"指标编码"`
- }
- func GetEdbInfoByFrequencyNotDay() (items []*EdbInfo, err error) {
- sql := `SELECT * FROM edbinfo WHERE frequency!="日度" AND notice_time<>'' and user_id>0 `
- err = global.DmSQL["edb"].Raw(sql).Find(&items).Error
- return
- }
- type Edbdata struct {
- TradeCode string `gorm:"column:TRADE_CODE;primaryKey"` // `orm:"column(TRADE_CODE);pk" description:"指标编码"`
- Dt string `orm:"column(DT)" description:"日期"`
- Close string `orm:"column(CLOSE)" description:"值"`
- ModifyTime time.Time `orm:"column(modify_time)" description:"修改时间"`
- }
- func GetLastEdbdataInfo(tradeCode string) (item *Edbdata, err error) {
- sql := `SELECT * FROM edbdata WHERE TRADE_CODE=? order by DT desc `
- err = global.DmSQL["data"].Raw(sql, tradeCode).Find(&item).Error
- return
- }
|