if (dataList.size() > 0) {
new Thread() {
@Override
public void run() {
//为了防止SQL语句超出长度出错,分成几次插入
if(dataList.size()<=2000){
nodeDataService.save(dataList);
}else{
int times = (int)Math.ceil( dataList.size()/2000.0 );
for(int i=0; i<times; i++ ){
System.out.println("分批插入:"+ i);
nodeDataService.save(dataList.subList (i*2000,Math.min((i+1)*2000, dataList.size()-1)));
}
}
}
}.start();