if (list == null || list.isEmpty()) { log.info("批量插入或更新数据为空"); return; } int limit = 1000; // 分批插入或更新 int size = list.size(); int count = size / limit; for (int i = 0; i <= count; i++) { int fromIndex = i * limit; int toIndex = (i + 1) * limit; if (toIndex > size) { toIndex = size; } List<SocStEventOverview> subList = list.subList(fromIndex, toIndex); socStEventOverviewMapper.insertOrUpdateBatch(subList); }
批量插入更新
最新推荐文章于 2024-07-15 22:27:18 发布