diff --git a/src/com/engine/organization/util/RefreshIsUsedUtil.java b/src/com/engine/organization/util/RefreshIsUsedUtil.java index 9ea6f8c6..c63c62f0 100644 --- a/src/com/engine/organization/util/RefreshIsUsedUtil.java +++ b/src/com/engine/organization/util/RefreshIsUsedUtil.java @@ -117,8 +117,13 @@ public class RefreshIsUsedUtil { private static void RefreshIsUsedStatus(String tableName, List usedIds) { if (CollectionUtils.isNotEmpty(usedIds)) { List collect = Arrays.stream(String.join(",", usedIds).split(",")).collect(Collectors.toList()); - getRefreshUseMapper().updateIsUsedByIds(tableName, collect, 0); - getRefreshUseMapper().updateIsUsedByIds(tableName, collect, 1); + final int batchSize = 1000; + for (int i = 0; i < collect.size(); i += batchSize) { + int endIndex = Math.min(collect.size(), i + batchSize); + List batch = collect.subList(i, endIndex); + getRefreshUseMapper().updateIsUsedByIds(tableName, batch, 0); + getRefreshUseMapper().updateIsUsedByIds(tableName, batch, 1); + } } else { getRefreshUseMapper().initIsUseStatus(tableName); }