hsun 1 year ago
parent
commit
7308b0db71
1 changed files with 5 additions and 3 deletions
  1. 5 3
      services/index_data/jiayue_platform.go

+ 5 - 3
services/index_data/jiayue_platform.go

@@ -189,13 +189,15 @@ func GetNewIndexAndDataFromJiaYue() (indexList []*response.IndexResp, err error)
 	indexCond := ``
 	indexPars := make([]interface{}, 0)
 	// TODO:查询两个小时之前的数据(待定)
-	//timeBefore := time.Now().Local().Add(-2 * time.Hour)
+	//timeBefore := time.Now().Local().Add(-2 * time.Hour).Format(utils.FormatDateTime)
 	//indexCond += ` CREATE_TIME <= :1 `
 	//indexPars = append(indexPars, timeBefore.Format(utils.FormatDateTime))
 
 	// TODO:测试
-	indexCond += ` CREATE_TIME <= TO_DATE(:1, 'YYYY-MM-DD HH24:MI:SS') `
-	indexPars = append(indexPars, time.Date(2023, 6, 8, 0, 0, 0, 0, time.Local).Format(utils.FormatDateTime))
+	//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(%s, 'YYYY-MM-DD HH24:MI:SS') `, endTime)
+	//indexPars = append(indexPars, )
 	sourceArr := []string{"bloomberg", "bloomberg_tmp"}
 	if len(sourceArr) > 0 {
 		indexCond += ` AND SOURCE_TYPE IN (:1)`