Browse Source

Merge branch 'gie'

zwxi 1 year ago
parent
commit
da3c367e96
4 changed files with 51 additions and 1 deletions
  1. 1 0
      .gitignore
  2. 47 0
      models/base_from_gie.go
  3. 1 1
      models/base_from_icpi.go
  4. 2 0
      services/index.go

+ 1 - 0
.gitignore

@@ -9,3 +9,4 @@ hongze_edb_lib
 binlog/
 binlog/
 /hongze_edb_lib.exe~
 /hongze_edb_lib.exe~
 /*.exe
 /*.exe
+eta_data_pubish

+ 47 - 0
models/base_from_gie.go

@@ -0,0 +1,47 @@
+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
+}
+

+ 1 - 1
models/base_from_icpi.go

@@ -67,7 +67,7 @@ type BaseFromIcpiIndexView struct {
 	ModifyTime             string `description:"修改时间"`
 	ModifyTime             string `description:"修改时间"`
 }
 }
 
 
-func GetIcpiIndex(startDate, endDate string) (items []*BaseFromIcpiIndexView, err error) {
+func GetIcpiIndex(startDate, endDate string) (items []*BaseFromIcpiIndex, err error) {
 	o := orm.NewOrm()
 	o := orm.NewOrm()
 	sql := ` SELECT * FROM base_from_icpi_index WHERE end_date >= ? AND end_date <= ?  `
 	sql := ` SELECT * FROM base_from_icpi_index WHERE end_date >= ? AND end_date <= ?  `
 	_, err = o.Raw(sql, startDate, endDate).QueryRows(&items)
 	_, err = o.Raw(sql, startDate, endDate).QueryRows(&items)

+ 2 - 0
services/index.go

@@ -22,6 +22,8 @@ func GetIndexList(source int, startDate, endDate string) (list interface{}, err
 		list, err = models.GetChangesVisitorsCovid(startDate, endDate)
 		list, err = models.GetChangesVisitorsCovid(startDate, endDate)
 	case utils.DATA_SOURCE_EIA_STEO:
 	case utils.DATA_SOURCE_EIA_STEO:
 		list, err = models.GetEiaSteoIndex(startDate, endDate)
 		list, err = models.GetEiaSteoIndex(startDate, endDate)
+	case utils.DATA_SOURCE_GIE:
+		list, err = models.GetEicIndex(startDate, endDate)
 	case utils.DATA_SOURCE_COM_TRADE:
 	case utils.DATA_SOURCE_COM_TRADE:
 		indexList := make([]*models.ComTradeIndex, 0)
 		indexList := make([]*models.ComTradeIndex, 0)
 		mappingList := make([]*models.ComTradeCodeMapping, 0)
 		mappingList := make([]*models.ComTradeCodeMapping, 0)