!31 优化配置自动提示及分页pagesize上限值

Merge pull request !31 from tan90/main
This commit is contained in:
Michael Yang 2023-05-16 01:18:10 +00:00 committed by Gitee
commit 18fb66ca6f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 26 additions and 3 deletions

View File

@ -595,9 +595,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>