java 批量插入,每次100条
List<Integer> list = new ArrayList<>(); int size = list.size(); int batchSize = 10; for (int i = 0; i < size; i += batchSize) { int fromIndex = i; int toIndex = Math.min(fromIndex + batchSize, size); List<Integer> subList = list.subList(fromIndex, toIndex); }