赞
踩
<pagehelper-spring-boot.version>1.2.13</pagehelper-spring-boot.version>
<!--pagehelper-->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper-spring-boot.version}</version>
</dependency>
package com.config.DataSource; import com.github.pagehelper.PageInterceptor; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import java.util.Properties; @Configuration public class PageHelperConfig { @Bean PageInterceptor pageInterceptor() { PageInterceptor pageInterceptor = new PageInterceptor(); Properties properties = new Properties(); properties.setProperty("offsetAsPageNum", "false"); properties.setProperty("rowBoundsWithCount", "false"); properties.setProperty("pageSizeZero", "true"); properties.setProperty("reasonable", "false"); properties.setProperty("supportMethodsArguments", "false"); properties.setProperty("returnPageInfo", "none"); //处理多数据源数据库 properties.setProperty("autoRuntimeDialect", "true"); pageInterceptor.setProperties(properties); return pageInterceptor; } }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。