|
@@ -210,7 +210,21 @@ public class ReportServiceImpl implements ReportService {
|
|
|
LambdaQueryWrapper<ReportDO> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(ReportDO::getDeleted, 0);
|
|
|
queryWrapper.eq(ReportDO::getIsTemp, 0);
|
|
|
- queryWrapper.in(ReportDO::getId, reportIdList);
|
|
|
+// queryWrapper.in(ReportDO::getId, reportIdList);
|
|
|
+ // 每1000个元素分一个List (oracle的in最多接收1000)
|
|
|
+ int chunkSize = 1000;
|
|
|
+ List<List<Long>> reportIdGroupList = IntStream.range(0, (reportIdList.size() + chunkSize - 1) / chunkSize).mapToObj(i -> reportIdList.subList(i * chunkSize, Math.min((i + 1) * chunkSize, reportIdList.size()))).collect(Collectors.toList());
|
|
|
+ int lastIndex = reportIdGroupList.size() - 1;
|
|
|
+ queryWrapper.and(qw -> {
|
|
|
+ for (int i = 0; i <= lastIndex; i++) {
|
|
|
+ List<Long> idList = reportIdGroupList.get(i);
|
|
|
+ qw.in(ReportDO::getId, idList);
|
|
|
+ // 判断是否是最后一个元素
|
|
|
+ if (i != lastIndex) {
|
|
|
+ qw.or();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
queryWrapper.eq(StrUtil.isNotBlank(reqVO.getReportType()), ReportDO::getReportType, reqVO.getReportType());
|
|
|
queryWrapper.orderByDesc(ReportDO::getCreateTime);
|
|
|
if (reqVO.getReportYear() != null) {
|