集合批量处理数据
List<DAiCollection> list = aiCollectionDao.getNeedPushAiCollection();
// 每次处理条数 100
int batchCount = 100;
for (int i = 0; i < list.size(); i += batchCount) {
int end = i + batchCount;
end = end > list.size() ? list.size() : end;
// 该批次处理的数据
List<DAiCollection> sendList = list.subList(i, end);
}
不积跬步,无以至千里;不积小流,无以成江海。
浙公网安备 33010602011771号