Explorar o código

Merge branch 'feature/jiayue' into debug

hsun hai 1 ano
pai
achega
6e9de8e9c7
Modificáronse 2 ficheiros con 4 adicións e 4 borrados
  1. 3 3
      models/jiayue/dict.go
  2. 1 1
      services/index_data/jiayue_platform.go

+ 3 - 3
models/jiayue/dict.go

@@ -20,10 +20,10 @@ func GetDictIndex(condition string, pars []interface{}, orderRule string) (dictI
 	fields := "ID, CODE, NAME, UNIT, FREQUENCY, DESCRIPTION, TABLE_NAME, SOURCE_TYPE, SOURCE_CODE, SOURCE_DESCRIPTION, INDUSTRY, TYPE, COMMODITY, SJB_ID, USER_ID, ROWS_COUNT, DATE_FIRST, DATE_LAST, TIME_LAST_UPDATE, TIME_LAST_REQUEST, PRIORITY, STATUS, SHORT_NAME, UPDATE_DESCRIPTION, FORECAST_FLAG, MANUAL_FLAG, VARIABLE_FLAG, MARKETDATA_FLAG, CREATE_USER, CREATE_TIME, UPDATE_USER, UPDATE_TIME"
 	order := ``
 	if orderRule != "" {
-		order += fmt.Sprintf(` ORDER BY %s`, orderRule)
+		order += fmt.Sprintf(`ORDER BY %s`, orderRule)
 	}
-	sqlStatement := fmt.Sprintf("SELECT %s, 0 AS no FROM %s WHERE %s %s", fields, IndexTableName, condition, order)
-	global.LOG.Info("GetDictIndex SQL: %s", sqlStatement)
+	sqlStatement := fmt.Sprintf("SELECT %s, 0 AS no FROM %s WHERE %s %s;", fields, IndexTableName, condition, order)
+	global.LOG.Info("GetDictIndex SQL: ", sqlStatement)
 	dictIndexList, err = getDictIndex(sqlStatement, pars)
 	if err != nil {
 		err = fmt.Errorf("查询指标信息失败 %s", err)

+ 1 - 1
services/index_data/jiayue_platform.go

@@ -196,7 +196,7 @@ func GetNewIndexAndDataFromJiaYue() (indexList []*response.IndexResp, err error)
 	// TODO:测试
 	//dataCond += " AND INDEX_DATE >= TO_DATE (:1, 'yyyy-mm-dd')"
 	endTime := time.Date(2023, 6, 8, 0, 0, 0, 0, time.Local).Format(utils.FormatDateTime)
-	indexCond += fmt.Sprintf(` CREATE_TIME <= TO_DATE(':1', 'YYYY-MM-DD HH24:MI:SS')`)
+	indexCond += fmt.Sprintf(`CREATE_TIME <= TO_DATE (:1, 'YYYY-MM-DD HH24:MI:SS')`)
 	indexPars = append(indexPars, endTime)
 	sourceArr := []string{"bloomberg", "bloomberg_tmp"}
 	if len(sourceArr) > 0 {