|
@@ -265,7 +265,7 @@ type BaseFromCoalmineFirmIndex struct {
|
|
|
ModifyTime string `description:"修改时间"`
|
|
|
}
|
|
|
|
|
|
-//查询指标
|
|
|
+// 查询指标
|
|
|
func GetBaseFromCoalmineFirmIndex(dataTime string) (items []*BaseFromCoalmineFirmIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_firm_index WHERE data_time LIKE `
|
|
@@ -290,7 +290,7 @@ type BaseFromCoalmineCoastalIndex struct {
|
|
|
ModifyTime string `description:"修改时间"`
|
|
|
}
|
|
|
|
|
|
-//查询指标
|
|
|
+// 查询指标
|
|
|
func GetBaseFromCoalmineCoastalIndex(startDate, endDate string) (items []*BaseFromCoalmineCoastalIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_coastal_index WHERE data_time between ? and ? `
|
|
@@ -313,7 +313,7 @@ type BaseFromCoalmineInlandIndex struct {
|
|
|
ModifyTime string `description:"修改时间"`
|
|
|
}
|
|
|
|
|
|
-//查询指标
|
|
|
+// 查询指标
|
|
|
func GetBaseFromCoalmineInlandIndex(startDate, endDate string) (items []*BaseFromCoalmineInlandIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_inland_index WHERE data_time between ? and ? `
|
|
@@ -321,7 +321,7 @@ func GetBaseFromCoalmineInlandIndex(startDate, endDate string) (items []*BaseFro
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-type BaseFromCoalmineClassify struct {
|
|
|
+type BaseFromCoalmineClassifyItem struct {
|
|
|
ClassifyId int
|
|
|
ClassifyName string
|
|
|
Child []CoalChild
|
|
@@ -381,7 +381,7 @@ func GetFrequencyFromCoal(suffix string) (list *string, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询数据
|
|
|
+// 查询数据
|
|
|
func GetBaseFromCoalmineIndexByFrequency(frequency, groupName string) (items []*BaseFromCoalmineJsmIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_jsm_index WHERE frequency=? AND province=?`
|
|
@@ -389,7 +389,7 @@ func GetBaseFromCoalmineIndexByFrequency(frequency, groupName string) (items []*
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询数据
|
|
|
+// 查询数据
|
|
|
func GetGroupNameFromCoalmineIndex(suffix string) (items []*string, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT DISTINCT group_name FROM base_from_coalmine_%s `
|
|
@@ -398,7 +398,7 @@ func GetGroupNameFromCoalmineIndex(suffix string) (items []*string, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询数据
|
|
|
+// 查询数据
|
|
|
func GetProvinceFromCoalmineIndex(suffix string) (items []*string, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT DISTINCT province FROM base_from_coalmine_%s `
|
|
@@ -407,7 +407,7 @@ func GetProvinceFromCoalmineIndex(suffix string) (items []*string, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询数据
|
|
|
+// 查询数据
|
|
|
func GetClassifyCoalmineIndexByGroupName(groupName string) (items []*string, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT DISTINCT index_code FROM base_from_coalmine_jsm_index WHERE province=? `
|
|
@@ -415,7 +415,7 @@ func GetClassifyCoalmineIndexByGroupName(groupName string) (items []*string, err
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询数据
|
|
|
+// 查询数据
|
|
|
func GetPageFromCoalmineIndexByFrequency(frequency, classify string, startSize, pageSize int) (items []*BaseFromCoalmineJsmIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_jsm_index WHERE frequency=? AND index_code=? ORDER BY data_time DESC LIMIT ?,? `
|
|
@@ -423,7 +423,7 @@ func GetPageFromCoalmineIndexByFrequency(frequency, classify string, startSize,
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询数据
|
|
|
+// 查询数据
|
|
|
func GetCountFromJsm(indexCode string) (item int, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT COUNT(1) FROM base_from_coalmine_jsm_index WHERE index_code=? `
|
|
@@ -445,7 +445,7 @@ func GetClassifyJsmByGroupName(groupName string) (items []*string, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询公司指标
|
|
|
+// 查询公司指标
|
|
|
func GetPageFromCoalmineCompanyIndexByFrequency(frequency, classify string, startSize, pageSize int) (items []*BaseFromCoalmineCompanyIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_company_index WHERE frequency=? AND index_code=? ORDER BY data_time DESC LIMIT ?,? `
|
|
@@ -474,7 +474,7 @@ func GetClassifyFirmByGroupName(groupName string) (items []*string, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询指标
|
|
|
+// 查询指标
|
|
|
func GetPageFromCoalmineFirmIndexByFrequency(frequency, classify string, startSize, pageSize int) (items []*BaseFromCoalmineFirmIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_firm_index WHERE frequency=? AND index_code=? ORDER BY data_time DESC LIMIT ?,? `
|
|
@@ -496,7 +496,7 @@ func GetClassifyCoastalByGroupName(groupName string) (items []*string, err error
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询指标
|
|
|
+// 查询指标
|
|
|
func GetPageFromCoalmineCoastalIndexByFrequency(frequency, classify string, startSize, pageSize int) (items []*BaseFromCoalmineCoastalIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_coastal_index WHERE frequency=? AND index_code=? ORDER BY data_time DESC LIMIT ?,? `
|
|
@@ -518,7 +518,7 @@ func GetClassifyInlandByGroupName(groupName string) (items []*string, err error)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询指标
|
|
|
+// 查询指标
|
|
|
func GetPageFromCoalmineInlandIndexByFrequency(frequency, classify string, startSize, pageSize int) (items []*BaseFromCoalmineInlandIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_inland_index WHERE frequency=? AND index_code=? ORDER BY data_time DESC LIMIT ?,? `
|
|
@@ -526,7 +526,7 @@ func GetPageFromCoalmineInlandIndexByFrequency(frequency, classify string, start
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询公司指标
|
|
|
+// 查询公司指标
|
|
|
func GetBaseFromCoalmineCompanyIndexByFrequency(frequency, groupName string) (items []*BaseFromCoalmineCompanyIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_company_index WHERE frequency=? AND group_name=? `
|
|
@@ -534,7 +534,7 @@ func GetBaseFromCoalmineCompanyIndexByFrequency(frequency, groupName string) (it
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询指标
|
|
|
+// 查询指标
|
|
|
func GetBaseFromCoalmineFirmIndexByFrequency(frequency, groupName string) (items []*BaseFromCoalmineFirmIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_firm_index WHERE frequency=? AND group_name=? `
|
|
@@ -542,7 +542,7 @@ func GetBaseFromCoalmineFirmIndexByFrequency(frequency, groupName string) (items
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询指标
|
|
|
+// 查询指标
|
|
|
func GetBaseFromCoalmineCoastalIndexByFrequency(frequency, groupName string) (items []*BaseFromCoalmineCoastalIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_coastal_index WHERE frequency=? AND group_name=? `
|
|
@@ -550,7 +550,7 @@ func GetBaseFromCoalmineCoastalIndexByFrequency(frequency, groupName string) (it
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询指标
|
|
|
+// 查询指标
|
|
|
func GetBaseFromCoalmineInlandIndexByFrequency(frequency, groupName string) (items []*BaseFromCoalmineInlandIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_inland_index WHERE frequency=? AND group_name=? `
|
|
@@ -558,7 +558,7 @@ func GetBaseFromCoalmineInlandIndexByFrequency(frequency, groupName string) (ite
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询数据
|
|
|
+// 查询数据
|
|
|
func GetBaseFromCoalmineIndexByCode(indexCode string) (items []*BaseFromCoalmineJsmIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_jsm_index WHERE index_code=?`
|
|
@@ -566,7 +566,7 @@ func GetBaseFromCoalmineIndexByCode(indexCode string) (items []*BaseFromCoalmine
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询公司指标
|
|
|
+// 查询公司指标
|
|
|
func GetBaseFromCoalmineCompanyIndexByCode(indexCode string) (items []*BaseFromCoalmineCompanyIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_company_index WHERE index_code=? `
|
|
@@ -574,7 +574,7 @@ func GetBaseFromCoalmineCompanyIndexByCode(indexCode string) (items []*BaseFromC
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询指标
|
|
|
+// 查询指标
|
|
|
func GetBaseFromCoalmineFirmIndexByCode(indexCode string) (items []*BaseFromCoalmineFirmIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_firm_index WHERE index_code=? `
|
|
@@ -582,7 +582,7 @@ func GetBaseFromCoalmineFirmIndexByCode(indexCode string) (items []*BaseFromCoal
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询指标
|
|
|
+// 查询指标
|
|
|
func GetBaseFromCoalmineCoastalIndexByCode(indexCode string) (items []*BaseFromCoalmineCoastalIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_coastal_index WHERE index_code=? `
|
|
@@ -590,7 +590,7 @@ func GetBaseFromCoalmineCoastalIndexByCode(indexCode string) (items []*BaseFromC
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//查询指标
|
|
|
+// 查询指标
|
|
|
func GetBaseFromCoalmineInlandIndexByCode(indexCode string) (items []*BaseFromCoalmineInlandIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_inland_index WHERE index_code=? `
|
|
@@ -598,7 +598,6 @@ func GetBaseFromCoalmineInlandIndexByCode(indexCode string) (items []*BaseFromCo
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-
|
|
|
type BaseFromTradeEicIndexV2 struct {
|
|
|
BaseFromEicIndexId int `orm:"column(base_from_eic_index_id);pk"`
|
|
|
Type string
|
|
@@ -687,4 +686,18 @@ func GetFirstBaseFromTradeIndexByDate(exchange string) (item *BaseFromTradeShang
|
|
|
sql := "SELECT * FROM base_from_trade_" + exchange + "_index where rank < 50 order by data_time asc"
|
|
|
err = o.Raw(sql).QueryRow(&item)
|
|
|
return
|
|
|
-}
|
|
|
+}
|
|
|
+
|
|
|
+type BaseFromCoalmineClassify struct {
|
|
|
+ BaseFromCoalmineClassifyId int `orm:"column(base_from_coalmine_classify_id);pk"`
|
|
|
+ ClassifyName string // 分类名称
|
|
|
+ Suffix string // 表名后缀
|
|
|
+ CreateTime time.Time
|
|
|
+}
|
|
|
+
|
|
|
+func GetCoalmineClassifyList() (list []*BaseFromCoalmineClassify, err error) {
|
|
|
+ o := orm.NewOrmUsingDB("data")
|
|
|
+ sql := "SELECT * FROM base_from_coalmine_classify"
|
|
|
+ _,err = o.Raw(sql).QueryRows(&list)
|
|
|
+ return
|
|
|
+}
|