|
@@ -15,15 +15,15 @@ import (
|
|
|
)
|
|
|
|
|
|
type DataList struct {
|
|
|
- TradeCode string `orm:"column(TRADE_CODE)" description:"指标编码"`
|
|
|
- SecName string `orm:"column(SEC_NAME)" description:"指标名称"`
|
|
|
- Unit string `orm:"column(UNIT)" description:"单位"`
|
|
|
- Remark string `orm:"column(REMARK)" description:"备注"`
|
|
|
+ TradeCode string `gorm:"column:TRADE_CODE" description:"指标编码"`
|
|
|
+ SecName string `gorm:"column:SEC_NAME" description:"指标名称"`
|
|
|
+ Unit string `gorm:"column:UNIT" description:"单位"`
|
|
|
+ Remark string `gorm:"column(REMARK)" description:"备注"`
|
|
|
Frequency string `description:"频度"`
|
|
|
ClassifyId int `description:"分类id"`
|
|
|
ClassifyName string `description:"分类名称"`
|
|
|
- Dt string `orm:"column(DT)" description:"录入日期"`
|
|
|
- Close float64 `orm:"column(CLOSE)" description:"录入值"`
|
|
|
+ Dt string `gorm:"column:DT" description:"录入日期"`
|
|
|
+ Close float64 `gorm:"column:CLOSE" description:"录入值"`
|
|
|
ModifyTime string `description:"修改时间"`
|
|
|
}
|
|
|
|
|
@@ -74,17 +74,17 @@ type DataAddReq struct {
|
|
|
}
|
|
|
|
|
|
type Edbdata struct {
|
|
|
- TradeCode string `orm:"column(TRADE_CODE);pk" description:"指标编码"`
|
|
|
- Dt string `orm:"column(DT)" description:"日期"`
|
|
|
- Close string `orm:"column(CLOSE)" description:"值"`
|
|
|
- ModifyTime time.Time `orm:"column(modify_time)" description:"修改时间"`
|
|
|
+ TradeCode string `gorm:"column:TRADE_CODE;pk" description:"指标编码"`
|
|
|
+ Dt string `gorm:"column:DT" description:"日期"`
|
|
|
+ Close string `gorm:"column:CLOSE" description:"值"`
|
|
|
+ ModifyTime time.Time `gorm:"column:modify_time" description:"修改时间"`
|
|
|
}
|
|
|
|
|
|
type EdbDataNextDateTime struct {
|
|
|
- TradeCode string `orm:"column(TRADE_CODE);pk" description:"指标编码"`
|
|
|
- Dt string `orm:"column(DT)" description:"日期"`
|
|
|
- Close string `orm:"column(CLOSE)" description:"值"`
|
|
|
- ModifyTime time.Time `orm:"column(modify_time)" description:"修改时间"`
|
|
|
+ TradeCode string `gorm:"column:TRADE_CODE;pk" description:"指标编码"`
|
|
|
+ Dt string `gorm:"column:DT" description:"日期"`
|
|
|
+ Close string `gorm:"column:CLOSE" description:"值"`
|
|
|
+ ModifyTime time.Time `gorm:"column:modify_time" description:"修改时间"`
|
|
|
|
|
|
NextDateTime string `description:"下期日期"`
|
|
|
}
|
|
@@ -126,10 +126,10 @@ func EditEdbdata(item *Edbdata) (err error) {
|
|
|
|
|
|
type EdbdataDeleteRecord struct {
|
|
|
Id int `gorm:"column:id;primaryKey;autoIncrement"`
|
|
|
- TradeCode string `orm:"column(TRADE_CODE)" description:"指标编码"`
|
|
|
- Dt string `orm:"column(DT)" description:"日期"`
|
|
|
- Close string `orm:"column(CLOSE)" description:"值"`
|
|
|
- ModifyTime time.Time `orm:"column(modify_time)" description:"修改时间"`
|
|
|
+ TradeCode string `gorm:"column:TRADE_CODE" description:"指标编码"`
|
|
|
+ Dt string `gorm:"column:DT" description:"日期"`
|
|
|
+ Close string `gorm:"column:CLOSE" description:"值"`
|
|
|
+ ModifyTime time.Time `gorm:"column:modify_time" description:"修改时间"`
|
|
|
CreateTime time.Time
|
|
|
SysUserId int
|
|
|
}
|
|
@@ -161,19 +161,19 @@ func DeleteAllEdbData(tradeCode string) (err error) {
|
|
|
}
|
|
|
|
|
|
type Edbinfo struct {
|
|
|
- TradeCode string `orm:"column(TRADE_CODE);pk" description:"指标code"`
|
|
|
- SecName string `orm:"column(SEC_NAME);" description:"指标名称"`
|
|
|
- Unit string `orm:"column(UNIT);" description:"单位"`
|
|
|
- Remark string `orm:"column(REMARK);" description:"备注"`
|
|
|
- Frequency string `orm:"column(frequency)" description:"频度"`
|
|
|
- ClassifyId int `orm:"column(classify_id)" description:"分类id"`
|
|
|
- ClassifyName string `orm:"-" description:"分类名称"`
|
|
|
- CreateDate string `orm:"column(create_date)" description:"创建时间"`
|
|
|
- UserId int `orm:"column(user_id)" description:"录入用户id"`
|
|
|
- UserName string `orm:"column(user_name)" description:"录入用户名称"`
|
|
|
- NoticeTime string `orm:"column(notice_time)" description:"通知时间"`
|
|
|
- Mobile string `orm:"column(mobile)" description:"录入者手机号"`
|
|
|
- Sort int `orm:"column(sort)" description:"排序"`
|
|
|
+ TradeCode string `gorm:"column:TRADE_CODE;autoIncrement:false;primaryKey" description:"指标code"`
|
|
|
+ SecName string `gorm:"column:SEC_NAME;" description:"指标名称"`
|
|
|
+ Unit string `gorm:"column:UNIT;" description:"单位"`
|
|
|
+ Remark string `gorm:"column:REMARK;" description:"备注"`
|
|
|
+ Frequency string `gorm:"column:frequency" description:"频度"`
|
|
|
+ ClassifyId int `gorm:"column:classify_id" description:"分类id"`
|
|
|
+ ClassifyName string `gorm:"-" description:"分类名称"`
|
|
|
+ CreateDate string `gorm:"column:create_date" description:"创建时间"`
|
|
|
+ UserId int `gorm:"column:user_id" description:"录入用户id"`
|
|
|
+ UserName string `gorm:"column:user_name" description:"录入用户名称"`
|
|
|
+ NoticeTime string `gorm:"column:notice_time" description:"通知时间"`
|
|
|
+ Mobile string `gorm:"column:mobile" description:"录入者手机号"`
|
|
|
+ Sort int `gorm:"column:sort" description:"排序"`
|
|
|
ModifyTime string `description:"最近一次更新时间"`
|
|
|
IsJoinEdb int8 `description:"指标库是否已添加:0-否;1-是"`
|
|
|
StartDate string `description:"数据开始日期"`
|
|
@@ -243,7 +243,7 @@ func GetEdbinfoListCount(condition string, pars []interface{}, mobile string, ro
|
|
|
}
|
|
|
|
|
|
type EdbinfoItem struct {
|
|
|
- TradeCode string `gorm:"column:TRADE_CODE;primaryKey" orm:"column(TRADE_CODE);pk" description:"指标code"`
|
|
|
+ TradeCode string `gorm:"column:TRADE_CODE;primaryKey;autoIncrement:false;" orm:"column(TRADE_CODE);pk" description:"指标code"`
|
|
|
SecName string `gorm:"column:SEC_NAME" orm:"column(SEC_NAME);" description:"指标名称"`
|
|
|
Unit string `gorm:"column:UNIT" orm:"column(UNIT);" description:"单位"`
|
|
|
Remark string `gorm:"column:REMARK" orm:"column(REMARK);" description:"备注"`
|
|
@@ -291,8 +291,8 @@ func GetEdbinfoItemList(condition string, pars []interface{}, startSize, pageSiz
|
|
|
|
|
|
// EdbParamsInfo 指标数据结构体
|
|
|
type EdbParamsInfo struct {
|
|
|
- Unit string `orm:"column(UNIT);" description:"单位" gorm:"column:UNIT"`
|
|
|
- Frequency string `orm:"column(frequency);" description:"单位"`
|
|
|
+ Unit string `gorm:"column(UNIT);" description:"单位" gorm:"column:UNIT"`
|
|
|
+ Frequency string `gorm:"column:frequency;" description:"单位"`
|
|
|
}
|
|
|
|
|
|
// GetEdbUnitList 获取指标单位
|
|
@@ -497,7 +497,7 @@ func GetEdbdataClassify(userId int64) (items []*EdbdataClassifyList, err error)
|
|
|
}
|
|
|
|
|
|
type ManualUserClassify struct {
|
|
|
- ManualUserClassifyId int `orm:"column(manual_user_classify_id);pk"`
|
|
|
+ ManualUserClassifyId int `gorm:"column:manual_user_classify_id;primaryKey"`
|
|
|
AdminId int
|
|
|
ClassifyId int
|
|
|
CreateTime time.Time
|
|
@@ -587,15 +587,15 @@ func GetFailList(sysUserId int) (items []*EdbdataImportFail, err error) {
|
|
|
}
|
|
|
|
|
|
type DataListForExport struct {
|
|
|
- TradeCode string `orm:"column(TRADE_CODE)" description:"指标code"`
|
|
|
- SecName string `orm:"column(SEC_NAME)" description:"指标名称"`
|
|
|
- Unit string `orm:"column(UNIT)" description:"单位"`
|
|
|
+ TradeCode string `gorm:"column:TRADE_CODE" description:"指标code"`
|
|
|
+ SecName string `gorm:"column:SEC_NAME" description:"指标名称"`
|
|
|
+ Unit string `gorm:"column:UNIT" description:"单位"`
|
|
|
Frequency string `description:"频度"`
|
|
|
ClassifyId int `description:"分类id"`
|
|
|
NoticeTime string `description:"通知时间"`
|
|
|
ClassifyName string
|
|
|
- Dt string `orm:"column(DT)" description:"日期"`
|
|
|
- Close float64 `orm:"column(CLOSE)" description:"值"`
|
|
|
+ Dt string `gorm:"column:DT" description:"日期"`
|
|
|
+ Close float64 `gorm:"column:CLOSE" description:"值"`
|
|
|
}
|
|
|
|
|
|
//func GetDataListForExport(startDate, endDate, frequency, keyWord string, classifyId int) (items []*DataListForExport, err error) {
|
|
@@ -759,10 +759,10 @@ func GetResearcherEntryByMobile(mobile string) (items []*Researcher, err error)
|
|
|
}
|
|
|
|
|
|
type EdbinfoItems struct {
|
|
|
- TradeCode string `orm:"column(TRADE_CODE);pk" description:"指标code"`
|
|
|
- SecName string `orm:"column(SEC_NAME);" description:"指标名称"`
|
|
|
- Unit string `orm:"column(UNIT);" description:"单位"`
|
|
|
- Remark string `orm:"column(REMARK);" description:"备注"`
|
|
|
+ TradeCode string `gorm:"column:TRADE_CODE;autoIncrement:false;primaryKey" description:"指标编码"`
|
|
|
+ SecName string `gorm:"column:SEC_NAME;" description:"指标名称"`
|
|
|
+ Unit string `gorm:"column:UNIT;" description:"单位"`
|
|
|
+ Remark string `gorm:"column:REMARK;" description:"备注"`
|
|
|
Frequency string `description:"频度"`
|
|
|
ClassifyId int `description:"分类id"`
|
|
|
ClassifyName string `description:"分类名称"`
|
|
@@ -1095,15 +1095,22 @@ type TargetCheckResp struct {
|
|
|
}
|
|
|
|
|
|
type EdbdataExportList struct {
|
|
|
- TradeCode string `orm:"column(TRADE_CODE);" description:"指标code"`
|
|
|
- SecName string `orm:"column(SEC_NAME);" description:"指标名称"`
|
|
|
- Unit string `orm:"column(UNIT);" description:"单位"`
|
|
|
- Remark string `orm:"column(REMARK);" description:"备注"`
|
|
|
+ TradeCode string `gorm:"column:TRADE_CODE;" description:"指标code"`
|
|
|
+ SecName string `gorm:"column:SEC_NAME;" description:"指标名称"`
|
|
|
+ Unit string `gorm:"column:UNIT;" description:"单位"`
|
|
|
+ Remark string `gorm:"column:REMARK;" description:"备注"`
|
|
|
Frequency string `description:"频度"`
|
|
|
ClassifyId int `description:"分类id"`
|
|
|
ClassifyName string `description:"分类名称"`
|
|
|
CreateDate string `description:"创建时间"`
|
|
|
- Dt string `orm:"column(Dt);" description:"最新一次录入时间"`
|
|
|
+ Dt string `gorm:"column:DT;" description:"最新一次录入时间"`
|
|
|
+}
|
|
|
+
|
|
|
+// AfterFind 在该模型上设置钩子函数,把日期转成正确的string,所以查询函数只能用Find函数,First或者Scan是不会触发该函数的来获取数据
|
|
|
+func (m *EdbdataExportList) AfterFind(db *gorm.DB) (err error) {
|
|
|
+ m.Dt = utils.GormDateStrToDateStr(m.Dt)
|
|
|
+
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
func GetEdbdataSecName(condition string, pars []interface{}) (items []*EdbdataExportList, err error) {
|
|
@@ -1160,7 +1167,14 @@ func GetEdbDataFrequencyByKeyord(keyword string) (items []string, err error) {
|
|
|
}
|
|
|
|
|
|
type EdbdataList struct {
|
|
|
- Dt string `orm:"column(DT);" description:"录入时间"`
|
|
|
+ Dt string `gorm:"column:DT;" description:"录入时间"`
|
|
|
+}
|
|
|
+
|
|
|
+// AfterFind 在该模型上设置钩子函数,把日期转成正确的string,所以查询函数只能用Find函数,First或者Scan是不会触发该函数的来获取数据
|
|
|
+func (m *EdbdataList) AfterFind(db *gorm.DB) (err error) {
|
|
|
+ m.Dt = utils.GormDateStrToDateStr(m.Dt)
|
|
|
+
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
func GetEdbdataList(tradeCode string) (items []*EdbdataList, err error) {
|
|
@@ -1171,9 +1185,16 @@ func GetEdbdataList(tradeCode string) (items []*EdbdataList, err error) {
|
|
|
}
|
|
|
|
|
|
type EdbdataItem struct {
|
|
|
- TradeCode string `orm:"column(TRADE_CODE);" description:"指标code"`
|
|
|
- Dt string `orm:"column(DT);" description:"最新一次录入时间"`
|
|
|
- Close float64 `orm:"column(CLOSE);" description:"值"`
|
|
|
+ TradeCode string `gorm:"column:TRADE_CODE;" description:"指标code"`
|
|
|
+ Dt string `gorm:"column:DT;" description:"最新一次录入时间"`
|
|
|
+ Close float64 `gorm:"column:CLOSE;" description:"值"`
|
|
|
+}
|
|
|
+
|
|
|
+// AfterFind 在该模型上设置钩子函数,把日期转成正确的string,所以查询函数只能用Find函数,First或者Scan是不会触发该函数的来获取数据
|
|
|
+func (m *EdbdataItem) AfterFind(db *gorm.DB) (err error) {
|
|
|
+ m.Dt = utils.GormDateStrToDateStr(m.Dt)
|
|
|
+
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
func GetEdbdataValueByTradeCode(tradeCode, dt string) (item *EdbdataItem, err error) {
|
|
@@ -1209,7 +1230,7 @@ func GetLzPriceClassify() (items []*LzPriceClassify, err error) {
|
|
|
}
|
|
|
|
|
|
type Longzhongpriceinfo struct {
|
|
|
- LongzhongpriceinfoId int `orm:"column(longzhongpriceinfo_id);pk"`
|
|
|
+ LongzhongpriceinfoId int `gorm:"column:longzhongpriceinfo_id;primaryKey"`
|
|
|
Standard string
|
|
|
ModelName string
|
|
|
Unit string
|
|
@@ -1252,7 +1273,7 @@ func GetLongzhongPriceDataMaxCount(productName string) (count int, err error) {
|
|
|
}
|
|
|
|
|
|
type LongzhongpricedataItems struct {
|
|
|
- LongzhongpricedataId int `orm:"column(longzhongpricedata_id);pk"`
|
|
|
+ LongzhongpricedataId int `gorm:"column:longzhongpricedata_id;primaryKey"`
|
|
|
LongzhongpriceinfoId int
|
|
|
PriceDate string
|
|
|
Memo string
|
|
@@ -1285,7 +1306,7 @@ func GetLzSurveyClassify() (items []*LzPriceClassify, err error) {
|
|
|
}
|
|
|
|
|
|
type LongzhongSurveyProduct struct {
|
|
|
- SurveyProductId int `orm:"column(survey_product_id);pk"`
|
|
|
+ SurveyProductId int `gorm:"column:survey_product_id;primaryKey"`
|
|
|
ProjectQuotaId int64
|
|
|
BreedId string
|
|
|
BreedName string
|
|
@@ -1349,10 +1370,10 @@ func GetLzFrequency(productName string) (items []*int, err error) {
|
|
|
|
|
|
// EdbInfoItem
|
|
|
type EdbInfoItem struct {
|
|
|
- TradeCode string `orm:"column(TRADE_CODE);pk" description:"指标code"`
|
|
|
- SecName string `orm:"column(SEC_NAME);" description:"指标名称"`
|
|
|
- Unit string `orm:"column(UNIT);" description:"单位"`
|
|
|
- Remark string `orm:"column(REMARK);" description:"备注"`
|
|
|
+ TradeCode string `gorm:"column:TRADE_CODE;autoIncrement:false;primaryKey" description:"指标编码"`
|
|
|
+ SecName string `gorm:"column:SEC_NAME;" description:"指标名称"`
|
|
|
+ Unit string `gorm:"column:UNIT;" description:"单位"`
|
|
|
+ Remark string `gorm:"column:REMARK;" description:"备注"`
|
|
|
Frequency string `description:"频度"`
|
|
|
ClassifyId int `description:"分类id"`
|
|
|
ClassifyName string `description:"分类名称"`
|
|
@@ -1432,8 +1453,8 @@ left join edbdata b on a.TRADE_CODE=b.TRADE_CODE `
|
|
|
//}
|
|
|
|
|
|
type lzSurveyData struct {
|
|
|
- DataTime string `orm:"column(data_time)" description:"日期"`
|
|
|
- InputValue string `orm:"column(input_value)" description:"值"`
|
|
|
+ DataTime string `gorm:"column:data_time" description:"日期"`
|
|
|
+ InputValue string `gorm:"column:input_value" description:"值"`
|
|
|
}
|
|
|
|
|
|
// GetLzItemListByCode 根据code查询隆众数据列表
|
|
@@ -1581,10 +1602,10 @@ type EdbInfoGroupCount struct {
|
|
|
//}
|
|
|
|
|
|
type EdbdataFloat struct {
|
|
|
- TradeCode string `orm:"column(TRADE_CODE);pk" description:"指标编码"`
|
|
|
- Dt string `orm:"column(DT)" description:"日期"`
|
|
|
- Close float64 `orm:"column(CLOSE)" description:"值"`
|
|
|
- ModifyTime time.Time `orm:"column(modify_time)" description:"修改时间"`
|
|
|
+ TradeCode string `gorm:"column:TRADE_CODE;autoIncrement:false;primaryKey" description:"指标编码"`
|
|
|
+ Dt string `gorm:"column:DT" description:"日期"`
|
|
|
+ Close float64 `gorm:"column:CLOSE" description:"值"`
|
|
|
+ ModifyTime time.Time `gorm:"column:modify_time" description:"修改时间"`
|
|
|
}
|
|
|
|
|
|
//func GetTargetsDataFloat(tradeCode, dt string) (item *EdbdataFloat, err error) {
|