分批处理大集合list的方法:
/**
* 分批处理
*
* @param standards
*/
public void splitStandardList(List<JbStandard> standards) {
int pointsDataLimit = 1000;
List<JbStandard> newList = new ArrayList<>();
for (int i = 0; i < standards.size(); i++) {//分批次处理
newList.add(standards.get(i));
if (pointsDataLimit == newList.size() || i == standards.size() - 1) {
jbStandardMapper.batchUpdateStandardForSubNo(newList);
newList.clear();
// System.out.println("i===" + i);
}
}
}