int pageSize = 5000;
        int totalSize = rewardAmounts.size();
        int totalPage = totalSize / pageSize;
        if (pageSize > totalSize) {
            rewardAmountService.updateBatch(rewardAmounts);
        } else {
            for (int i = 0; i < totalPage; i++) {
                rewardAmountService.updateBatch(rewardAmounts.subList(i * pageSize, (i + 1) * pageSize));
            }
            if (totalSize % pageSize != 0) {
                rewardAmountService.updateBatch(rewardAmounts.subList(totalSize - totalSize % pageSize, totalSize));
            }
        }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2021-08-12
  • 2021-07-13
  • 2021-04-17
  • 2021-08-17
  • 2022-01-06
猜你喜欢
  • 2022-12-23
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案