Commit a3929ab4 authored by 郝彦辉's avatar 郝彦辉

手动跑存数据bak1

parent f2a36a7a
...@@ -21,17 +21,17 @@ public class BaiHangHistoryConstant { ...@@ -21,17 +21,17 @@ public class BaiHangHistoryConstant {
public static final int MAX_COMMIT_COUT = 24000;//大于2万条会出现事务提交过长报错 public static final int MAX_COMMIT_COUT = 24000;//大于2万条会出现事务提交过长报错
public static final String SQL_COMMONE_TEMPLATE_HISTORY = "INSERT xyqb_i_loan_a_m_history_bak " + public static final String SQL_COMMONE_TEMPLATE_HISTORY = "REPLACE INTO rc_syn_to_baihang_report.xyqb_i_loan_a_m_history_bak " +
" select * from xyqb_i_loan_application_manifest_history b " + " select * from rc_real_time_data_pool_v2.xyqb_i_loan_application_manifest_history b " +
" where b.funding_corp_id in (420,520,580,650,670,810,240,640,700) " + " where b.funding_corp_id in (420,520,580,650,670,810,240,640,700) " +
" and b.created_at >= '##STARTTIME##' and b.created_at < '##ENDTIME##'; "; " and b.updated_at >= '##STARTTIME##' and b.updated_at < '##ENDTIME##'; ";
//报送查询 b.loan_paid_at<@t2 公司打款时间 //报送查询 b.loan_paid_at<@t2 公司打款时间
public static final String SQL_COMMONE_TEMPLATE_PLAN = "INSERT xyqb_i_repayment_plan_bak " + public static final String SQL_COMMONE_TEMPLATE_PLAN = "REPLACE INTO rc_syn_to_baihang_report.xyqb_i_repayment_plan_bak " +
"select a.* from xyqb_i_repayment_plan a " + "select a.* from rc_real_time_data_pool_v2.xyqb_i_repayment_plan a " +
" join xyqb_i_loan_a_m_history_bak b " + " join rc_syn_to_baihang_report.xyqb_i_loan_a_m_history_bak b " +
" on a.loan_application_history_id = b.loan_application_history_id " + " on a.loan_application_history_id = b.loan_application_history_id " +
"where b.created_at >= '##STARTTIME##' and b.created_at < '##ENDTIME##'; "; "where b.updated_at >= '##STARTTIME##' and b.updated_at < '##ENDTIME##'; ";
//报送查询 a.repaid_at>=@t2 还款时间 //报送查询 a.repaid_at>=@t2 还款时间
......
...@@ -284,4 +284,25 @@ public class ExZhuDaiBaiHangReSendController { ...@@ -284,4 +284,25 @@ public class ExZhuDaiBaiHangReSendController {
} }
} }
@RequestMapping("/manual/syn_history_by_CreatedAt")
public String syn_history_by_CreatedAt(String p3,String secretKey){
if(manualToolService.checkSecretKey(p3,secretKey)){
//增量同步rc_real_time_data_pool_v2.xyqb_i_loan_application_manifest_history
synLoanInfoHistoryTask.syn_history_by_CreatedAt();
return "syn_history_by_CreatedAt任务调度完成";
}else{
return "syn_history_by_CreatedAt任务调度失败,参数错误";
}
}
@RequestMapping("/manual/syn_plan_by_CreatedAt")
public String syn_plan_by_CreatedAt(String p3,String secretKey){
if(manualToolService.checkSecretKey(p3,secretKey)){
//增量同步rc_real_time_data_pool_v2.xyqb_i_repayment_plan
synLoanInfoHistoryTask.syn_plan_by_CreatedAt();
return "syn_plan_by_CreatedAt任务调度完成";
}else{
return "syn_plan_by_CreatedAt任务调度失败,参数错误";
}
}
} }
...@@ -81,10 +81,10 @@ public class SynLoanInfoHistoryTask { ...@@ -81,10 +81,10 @@ public class SynLoanInfoHistoryTask {
return increment <= 1; return increment <= 1;
} }
@Deprecated
private void syn_history_by_CreatedAt(){ public void syn_history_by_CreatedAt(){
LocalDateTime erlyDate = LocalDateTime.parse("2016-08-23T00:00:00");//2016-08-23T16:29:10 LocalDateTime erlyDate = LocalDateTime.parse("2016-08-23T00:00:00");//created_at=2016-08-23T16:29:10 updated_at=2016-08-23 16:34:43
LocalDateTime endDate = LocalDateTime.parse("2019-11-01T00:00:00");//2019-11-11 12:32:08 LocalDateTime endDate = LocalDateTime.parse("2020-06-02T00:00:00");//
int counter = 0; int counter = 0;
while (true) { while (true) {
Stopwatch startwatch = Stopwatch.createStarted(); Stopwatch startwatch = Stopwatch.createStarted();
...@@ -114,10 +114,10 @@ public class SynLoanInfoHistoryTask { ...@@ -114,10 +114,10 @@ public class SynLoanInfoHistoryTask {
} }
} }
@Deprecated
private void syn_plan_by_CreatedAt(){ public void syn_plan_by_CreatedAt(){
LocalDateTime erlyDate = LocalDateTime.parse("2016-08-23T00:00:00");//2016-08-23T16:29:10 LocalDateTime erlyDate = LocalDateTime.parse("2016-08-23T00:00:00");//created_at=2016-08-23T16:29:10 updated_at=2016-08-23 16:34:43
LocalDateTime endDate = LocalDateTime.parse("2019-11-01T00:00:00");//2019-11-11 12:32:08 LocalDateTime endDate = LocalDateTime.parse("2020-06-02T00:00:00");//
int counter = 0; int counter = 0;
while (true) { while (true) {
Stopwatch startwatch = Stopwatch.createStarted(); Stopwatch startwatch = Stopwatch.createStarted();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment