From 97a237bbdc97b6ccf7be9011be6f9992eadb9462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Fri, 21 May 2021 11:50:47 +0800 Subject: [PATCH] =?UTF-8?q?update=20springboot=20=E5=8D=87=E7=BA=A7=202.3.?= =?UTF-8?q?11=20update=20mybatis-plus=20=E5=8D=87=E7=BA=A7=203.4.3=20?= =?UTF-8?q?=E5=88=86=E9=A1=B5Plus=E5=AF=B9=E8=B1=A1=E9=80=82=E9=85=8D?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 4 +-- .../com/ruoyi/common/core/page/PagePlus.java | 28 +++++++++++++------ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index 1ba56af3..c8b41b20 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ 2.1.1 - 2.3.10.RELEASE + 2.3.11.RELEASE UTF-8 UTF-8 1.8 @@ -26,7 +26,7 @@ 4.1.2 1.7 0.9.1 - 3.4.2 + 3.4.3 5.5.8 2.2.6.RELEASE 11.0 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/page/PagePlus.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/PagePlus.java index 2bffe305..812a683d 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/page/PagePlus.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/page/PagePlus.java @@ -123,15 +123,27 @@ public class PagePlus implements IPage { return this.optimizeCountSql; } - @Override - public boolean isSearchCount() { - return this.total >= 0L && this.isSearchCount; - } + @Override + public long getPages() { + // 解决 github issues/3208 + return IPage.super.getPages(); + } - public PagePlus setSearchCount(boolean isSearchCount) { - this.isSearchCount = isSearchCount; - return this; - } + public static PagePlus of(long current, long size) { + return of(current, size, 0); + } + + public static PagePlus of(long current, long size, long total) { + return of(current, size, total, true); + } + + public static PagePlus of(long current, long size, boolean searchCount) { + return of(current, size, 0, searchCount); + } + + public static PagePlus of(long current, long size, long total, boolean searchCount) { + return new PagePlus<>(current, size, total, searchCount); + } }