edb_data_wind.go 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package data_manage
  2. //type EdbDataWind struct {
  3. // EdbDataId int `orm:"column(edb_data_id);pk" gorm:"primaryKey"`
  4. // EdbInfoId int
  5. // EdbCode string
  6. // DataTime string
  7. // Value float64
  8. // Status int
  9. // CreateTime time.Time
  10. // ModifyTime time.Time
  11. // DataTimestamp int64
  12. //}
  13. //func AddEdbDataWind(items []*EdbDataWind) (err error) {
  14. // o := global.DbMap[utils.DbNameIndex]
  15. // err = o.CreateInBatches(items, utils.MultiAddNum).Error
  16. // return
  17. //}
  18. //func ModifyEdbDataWind(edbInfoId int64, edbCode, dataTime string, value float64) (err error) {
  19. // o := global.DbMap[utils.DbNameIndex]
  20. // sql := ` UPDATE edb_data_wind SET edb_info_id=?,value=?,status=1,modify_time=NOW() WHERE edb_code=? AND data_time=? `
  21. // err = o.Exec(sql, edbInfoId, value, edbCode, dataTime).Error
  22. // return
  23. //}
  24. //func ModifyEdbDataWindStatus(edbInfoId int64, edbCode string) (err error) {
  25. // o := global.DbMap[utils.DbNameIndex]
  26. // sql := ` UPDATE edb_data_wind SET edb_info_id=?, status=1,modify_time=NOW() WHERE edb_code=? `
  27. // err = o.Exec(sql, edbInfoId, edbCode).Error
  28. // return
  29. //}
  30. //func GetEdbDataWindCount(edbCode, dataTime string) (count int, err error) {
  31. // o := global.DbMap[utils.DbNameIndex]
  32. // sql := ` SELECT COUNT(1) AS count FROM edb_data_wind WHERE edb_code=? AND data_time=? `
  33. // err = o.Raw(sql, edbCode, dataTime).Scan(&count).Error
  34. // return
  35. //}
  36. //func GetEdbDataWindMaxOrMinDate(edbInfoId int) (min_date, max_date string, err error) {
  37. // o := global.DbMap[utils.DbNameIndex]
  38. // sql := ` SELECT MIN(data_time) AS min_date,MAX(data_time) AS max_date FROM edb_data_wind WHERE edb_info_id=? `
  39. // err = o.Raw(sql, edbInfoId).Row().Scan(&min_date, &max_date)
  40. // return
  41. //}