From 2635d74af582759fef083d23b956b059fd695b47 Mon Sep 17 00:00:00 2001 From: GeHui <313720641@qq.com> Date: Wed, 15 May 2024 13:59:45 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20config(common):=20pagehelp?= =?UTF-8?q?er=E5=A4=9A=E6=95=B0=E6=8D=AE=E6=BA=90=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=AF=86=E5=88=AB=E5=AF=B9=E5=BA=94=E6=96=B9=E8=A8=80=E7=9A=84?= =?UTF-8?q?=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.yaml里的配置是pagehelper-spring-boot-starter 的,对pagehelper来说没用 2.使用配置类PagehelperConfig (cherry picked from commit 2303b18a78679a3211f1caf620eb2adbdfd3cedc) (cherry picked from commit f066ec91bc93f5a81aa7f826d227fb1b4d3fed04) --- .../java/com/ruoyi/common/orm/config/PagehelperConfig.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ruoyi-common/ruoyi-common-orm/src/main/java/com/ruoyi/common/orm/config/PagehelperConfig.java b/ruoyi-common/ruoyi-common-orm/src/main/java/com/ruoyi/common/orm/config/PagehelperConfig.java index bc404b3..d7ac75c 100644 --- a/ruoyi-common/ruoyi-common-orm/src/main/java/com/ruoyi/common/orm/config/PagehelperConfig.java +++ b/ruoyi-common/ruoyi-common-orm/src/main/java/com/ruoyi/common/orm/config/PagehelperConfig.java @@ -4,6 +4,8 @@ import com.github.pagehelper.PageInterceptor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import java.util.Properties; + /** * Pagehelper分页,兼用老项目 * @@ -14,6 +16,11 @@ public class PagehelperConfig { @Bean public PageInterceptor pageInterceptor(){ PageInterceptor pageInterceptor = new PageInterceptor(); + Properties properties = new Properties(); + properties.setProperty("supportMethodsArguments","true"); + properties.setProperty("autoRuntimeDialect","true"); + pageInterceptor.setProperties(properties); + return pageInterceptor; } }