|
@@ -41,9 +41,9 @@ type BaseFromGprRiskIndexList struct {
|
|
|
Sort int
|
|
|
CreateTime string
|
|
|
ModifyTime string
|
|
|
- EdbExist int `description:"指标库是否已添加:0-否;1-是"`
|
|
|
- DataList []*BaseFromGprRiskData
|
|
|
- Paging *paging.PagingItem `description:"分页数据"`
|
|
|
+ EdbExist int `description:"指标库是否已添加:0-否;1-是"`
|
|
|
+ DataList []*BaseFromGprRiskData `gorm:"-"`
|
|
|
+ Paging *paging.PagingItem `description:"分页数据" gorm:"-"`
|
|
|
}
|
|
|
type BaseFromGprRiskIndexSearchList struct {
|
|
|
List []*BaseFromGprRiskIndexList
|
|
@@ -76,13 +76,13 @@ func GetGprRiskIndexByClassifyId(classifyId int) (items []*BaseFromGprRiskIndex,
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func GetGprRiskIndex(condition string, pars interface{}) (items []*BaseFromGprRiskIndexList, err error) {
|
|
|
+func GetGprRiskIndex(condition string, pars []interface{}) (items []*BaseFromGprRiskIndexList, err error) {
|
|
|
sql := ` SELECT * FROM base_from_gpr_risk_index WHERE 1=1 `
|
|
|
if condition != "" {
|
|
|
sql += condition
|
|
|
}
|
|
|
sql += ` ORDER BY sort ASC, base_from_gpr_risk_index_id asc`
|
|
|
- err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
|
|
|
+ err = global.DbMap[utils.DbNameIndex].Raw(sql, pars...).Find(&items).Error
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -118,7 +118,8 @@ func GetGprRiskIndexDataByDataTime(indexCodes []string, startDate, endDate strin
|
|
|
}
|
|
|
|
|
|
func GetGprRiskIndexDataTimePageByCodes(indexCodes []string, startSize, pageSize int) (dataTimes []string, err error) {
|
|
|
- sql := ` SELECT data_time FROM base_from_gpr_risk_data WHERE index_code in (` + utils.GetOrmInReplace(len(indexCodes)) + `) GROUP BY data_time ORDER BY data_time DESC LIMIT ?,? `
|
|
|
+ //sql := ` SELECT data_time FROM base_from_gpr_risk_data WHERE index_code in (` + utils.GetOrmInReplace(len(indexCodes)) + `) GROUP BY data_time ORDER BY data_time DESC LIMIT ?,? `
|
|
|
+ sql := ` SELECT data_time FROM base_from_gpr_risk_data WHERE index_code in ? GROUP BY data_time ORDER BY data_time DESC LIMIT ?,? `
|
|
|
err = global.DbMap[utils.DbNameIndex].Raw(sql, indexCodes, startSize, pageSize).Find(&dataTimes).Error
|
|
|
return
|
|
|
}
|