This commit is contained in:
开源海哥 2023-05-16 09:19:20 +08:00
commit 75d520fc98
3 changed files with 26 additions and 3 deletions

View File

@ -596,9 +596,10 @@ public interface BaseMapper<T> {
//重置 selectColumns
CPI.setSelectColumns(queryWrapper, selectColumns);
int offset = page.getPageSize() * (page.getPageNumber() - 1);
queryWrapper.limit(offset, page.getPageSize());
//分页pageSize最大值限制
int pageSize = Math.min(page.getPageSize(), 10000);
int offset = pageSize * (page.getPageNumber() - 1);
queryWrapper.limit(offset, pageSize);
List<T> rows = selectListByQuery(queryWrapper);
page.setRecords(rows);
return page;

View File

@ -29,6 +29,16 @@
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure-processor</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.scripting</groupId>
<artifactId>mybatis-freemarker</artifactId>

12
pom.xml
View File

@ -133,6 +133,18 @@
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure-processor</artifactId>
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>