集合分段

int size = b2BSettlementDetails.size();
for (int begin = 0; begin < size; begin = begin + 10000) {
  int end = (begin + 10000 > size ? size : begin + 10000);
  List<B2BSettlementDetail> list = new ArrayList(b2BSettlementDetails.subList(begin, end));
  b2bSettlementDetailExtendMapper.updateSettlementDetailExtendByDetails(settlementNo, settlement.getCreateBy(),list);
}

 

上一篇:python3面试-将N(N<10000)个人排成一排,从第1个人开始报数;如果报数是M的倍数就出列


下一篇:java中生成1000~10000之间的随机数