if (list_share_date.size() < 1000) { shareDateMapper.updateBatchShareAndDate(list_share_date); } else { int len = 1000; int size = list_share_date.size(); int count = (size + len - 1) / len; for (int i = 0; i < count; i++) { List<BgdShareStatisticsDate> subListOK = list_share_date.subList(i * len, ((i + 1) * len > size ? size : len * (i + 1))); shareDateMapper.updateBatchShareAndDate(subListOK); } }
批量更新每次1000,截取list
最新推荐文章于 2024-07-13 02:59:29 发布