base_from_gie.go 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package data_manage
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type BaseFromTradeEicIndexV2 struct {
  7. BaseFromEicIndexId int `orm:"column(base_from_eic_index_id);pk"`
  8. Type string
  9. EicCode string
  10. Name string
  11. Status string
  12. GasDayStart string
  13. GasInStorage string
  14. GasInStorageCode string
  15. Consumption string
  16. ConsumptionCode string
  17. ConsumptionFull string
  18. ConsumptionFullCode string
  19. Full string
  20. FullCode string
  21. Trend string
  22. TrendCode string
  23. Injection string
  24. InjectionCode string
  25. Withdrawal string
  26. WithdrawalCode string
  27. WorkingGasVolume string
  28. WorkingGasVolumeCode string
  29. InjectionCapacity string
  30. InjectionCapacityCode string
  31. WithdrawalCapacity string
  32. WithdrawalCapacityCode string
  33. Info string
  34. Parent string
  35. CreateTime time.Time
  36. ModifyTime time.Time
  37. }
  38. func GetBaseFromEicIndexMaxDate() (max_date time.Time, err error) {
  39. o := orm.NewOrm()
  40. sql := ` SELECT max(a.gas_day_start)as max_date FROM base_from_trade_eic_index_v2 as a `
  41. err = o.Raw(sql).QueryRow(&max_date)
  42. return
  43. }
  44. func GetBaseFromEicIndexAll(dateStr string) (list []*BaseFromTradeEicIndexV2, err error) {
  45. o := orm.NewOrm()
  46. sql := `SELECT * FROM base_from_trade_eic_index_v2 where gas_day_start >=?`
  47. _, err = o.Raw(sql, dateStr).QueryRows(&list)
  48. return
  49. }
  50. func AddBaseFromEicIndexV2(item *BaseFromTradeEicIndexV2) (lastId int64, err error) {
  51. o := orm.NewOrm()
  52. lastId, err = o.Insert(item)
  53. return
  54. }
  55. type EicIndexResp struct {
  56. Ret int
  57. Msg string
  58. ErrMsg string
  59. ErrCode string
  60. Data []*BaseFromTradeEicIndexV2
  61. }