public void delectAndSave(List<CcbStatement> list, Date dateParam){
ccbStatementMapper.deleteSelective(dateParam);
if(list.size()<=2000){
ccbStatementMapper.insertBatch(list);
}else{
int times = (int)Math.ceil( list.size()/2000.0 );
for(int i=0; i<times; i++ ){
System.out.println("分批插入:"+ i);
ccbStatementMapper.insertBatch(list.subList(i*2000, Math.min((i+1)*2000, list.size()-1)));
}

}
}
posted on 2020-01-02 12:30  一抹书香  阅读(3843)  评论(0编辑  收藏  举报