edb_data_manual.go 899 B

123456789101112131415161718192021222324252627282930313233
  1. package data_manage
  2. import (
  3. "eta_gn/eta_api/global"
  4. "time"
  5. )
  6. type BaseDataMaxOrMinDate struct {
  7. MinDate string `json:"min_date"`
  8. MaxDate string `json:"max_date"`
  9. }
  10. func GetEdbDataManualMaxOrMinDate(edbCode string) (minDate, maxDate string, err error) {
  11. sql := ` SELECT MIN(data_time) AS min_date,MAX(data_time) AS max_date FROM edb_data_manual WHERE edb_code=? `
  12. var tmpDate BaseDataMaxOrMinDate
  13. err = global.DmSQL["data"].Raw(sql, edbCode).Scan(&tmpDate).Error
  14. if err != nil {
  15. return
  16. }
  17. minDate = tmpDate.MinDate
  18. maxDate = tmpDate.MaxDate
  19. return
  20. }
  21. type ManualEdbdata struct {
  22. TradeCode string `orm:"column(TRADE_CODE);pk" gorm:"primaryKey" description:"指标编码"`
  23. Dt string `orm:"column(DT)" description:"日期"`
  24. Close string `orm:"column(CLOSE)" description:"值"`
  25. ModifyTime time.Time `orm:"column(modify_time)" description:"修改时间"`
  26. }