|
@@ -12,31 +12,34 @@ type BaseFromCoalmineMapping struct {
|
|
|
CreateTime time.Time `description:"时间"`
|
|
|
}
|
|
|
|
|
|
-type BaseFromCoalmineIndex struct {
|
|
|
- BaseFromCoalmineIndexId int `orm:"column(base_from_coalmine_index_id);pk"`
|
|
|
- IndexName string `description:"持买单量指标名称"`
|
|
|
- IndexCode string `description:"持买单量指标编码"`
|
|
|
- Exchange string `description:"样本统计类别"`
|
|
|
- DealValue string `description:"成交量"`
|
|
|
- DataTime string `description:"数据日期"`
|
|
|
- Source string `description:"来源"`
|
|
|
- Province string `description:"省份"`
|
|
|
- Description string `description:"描述"`
|
|
|
- CreateTime time.Time `description:"插入时间"`
|
|
|
- ModifyTime time.Time `description:"修改时间"`
|
|
|
+type BaseFromCoalmineJsmIndex struct {
|
|
|
+ BaseFromCoalmineJsmIndexId int `orm:"column(base_from_coalmine_jsm_index_id);pk"`
|
|
|
+ IndexName string `description:"持买单量指标名称"`
|
|
|
+ IndexCode string `description:"持买单量指标编码"`
|
|
|
+ Exchange string `description:"样本统计类别"`
|
|
|
+ DealValue string `description:"成交量"`
|
|
|
+ DataTime string `description:"数据日期"`
|
|
|
+ Source string `description:"来源"`
|
|
|
+ Province string `description:"省份"`
|
|
|
+ Description string `description:"描述"`
|
|
|
+ Unit string `description:"单位"`
|
|
|
+ Frequency string `description:"频率"`
|
|
|
+ CreateTime time.Time `description:"插入时间"`
|
|
|
+ ModifyTime time.Time `description:"修改时间"`
|
|
|
}
|
|
|
|
|
|
-
|
|
|
type BaseFromCoalmineCompanyIndex struct {
|
|
|
BaseFromCoalmineCompanyIndexId int `orm:"column(base_from_coalmine_company_index_id);pk"`
|
|
|
IndexName string `description:"持买单量指标名称"`
|
|
|
IndexCode string `description:"持买单量指标编码"`
|
|
|
DealValue string `description:"成交量"`
|
|
|
DataTime string `description:"数据日期"`
|
|
|
- Source string `description:"来源"`
|
|
|
- Province string `description:"省份"`
|
|
|
- City string `description:"城市"`
|
|
|
- GroupName string `description:"集团名称"`
|
|
|
+ Source string `description:"来源"`
|
|
|
+ Province string `description:"省份"`
|
|
|
+ City string `description:"城市"`
|
|
|
+ GroupName string `description:"集团名称"`
|
|
|
+ Unit string `description:"单位"`
|
|
|
+ Frequency string `description:"频率"`
|
|
|
CreateTime time.Time `description:"插入时间"`
|
|
|
ModifyTime time.Time `description:"修改时间"`
|
|
|
}
|
|
@@ -59,47 +62,30 @@ func GetBaseFromCoalmineMapping() (items []*BaseFromCoalmineMapping, err error)
|
|
|
}
|
|
|
|
|
|
//查询数据
|
|
|
-func GetBaseFromCoalmineIndex() (items []*BaseFromCoalmineIndex, err error) {
|
|
|
+func GetBaseFromCoalmineIndex() (items []*BaseFromCoalmineJsmIndex, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
o.Using("data")
|
|
|
- sql := `SELECT * FROM base_from_coalmine_index`
|
|
|
+ sql := `SELECT * FROM base_from_coalmine_jsm_index`
|
|
|
_, err = o.Raw(sql).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func UpdateBaseFromCoalmineIndex(item *BaseFromCoalmineIndex) (err error) {
|
|
|
+func UpdateBaseFromCoalmineIndex(item *BaseFromCoalmineJsmIndex) (err error) {
|
|
|
o := orm.NewOrm()
|
|
|
o.Using("data")
|
|
|
- sql := `UPDATE base_from_coalmine_index SET deal_value=? WHERE index_name=? AND data_time = ?`
|
|
|
+ sql := `UPDATE base_from_coalmine_jsm_index SET deal_value=? WHERE index_name=? AND data_time = ?`
|
|
|
_, err = o.Raw(sql, item.DealValue, item.IndexName, item.DataTime).Exec()
|
|
|
return
|
|
|
}
|
|
|
|
|
|
//添加数据
|
|
|
-func AddBaseFromCoalmineIndex(item *BaseFromCoalmineIndex) (lastId int64, err error) {
|
|
|
+func AddBaseFromCoalmineIndex(item *BaseFromCoalmineJsmIndex) (lastId int64, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
o.Using("data")
|
|
|
lastId, err = o.Insert(item)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-////添加公司指标
|
|
|
-//func AddBaseFromCoalmineCompanyMapping(item *BaseFromCoalmineCompanyMapping) (lastId int64, err error) {
|
|
|
-// o := orm.NewOrm()
|
|
|
-// o.Using("data")
|
|
|
-// lastId, err = o.Insert(item)
|
|
|
-// return
|
|
|
-//}
|
|
|
-//
|
|
|
-////查询指标
|
|
|
-//func GetBaseFromCoalmineCompanyMapping() (items []*BaseFromCoalmineCompanyMapping, err error) {
|
|
|
-// o := orm.NewOrm()
|
|
|
-// o.Using("data")
|
|
|
-// sql := `SELECT * FROM base_from_coalmine_company_mapping`
|
|
|
-// _, err = o.Raw(sql).QueryRows(&items)
|
|
|
-// return
|
|
|
-//}
|
|
|
-
|
|
|
//添加公司指标
|
|
|
func AddBaseFromCoalmineCompanyIndex(item *BaseFromCoalmineCompanyIndex) (lastId int64, err error) {
|
|
|
o := orm.NewOrm()
|
|
@@ -109,7 +95,7 @@ func AddBaseFromCoalmineCompanyIndex(item *BaseFromCoalmineCompanyIndex) (lastId
|
|
|
}
|
|
|
|
|
|
//查询公司指标
|
|
|
-func GetBaseFromCoalmineCompanyIndex() (items []*BaseFromCoalmineCompanyIndex,err error){
|
|
|
+func GetBaseFromCoalmineCompanyIndex() (items []*BaseFromCoalmineCompanyIndex, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
o.Using("data")
|
|
|
sql := `SELECT * FROM base_from_coalmine_company_index`
|
|
@@ -123,4 +109,4 @@ func UpdateBaseFromCoalmineCompanyIndex(item *BaseFromCoalmineCompanyIndex) (err
|
|
|
sql := `UPDATE base_from_coalmine_company_index SET deal_value=? WHERE index_name=? AND data_time = ?`
|
|
|
_, err = o.Raw(sql, item.DealValue, item.IndexName, item.DataTime).Exec()
|
|
|
return
|
|
|
-}
|
|
|
+}
|