Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pagehelper-spring-boot-starter1.4.3分页失败导致全量查询 #745

Open
1 task
LeiYuBoGitHub opened this issue May 26, 2023 · 2 comments
Open
1 task

Comments

@LeiYuBoGitHub
Copy link

  • 我已在 issues 搜索类似问题,并且不存在相同的问题.

依赖模块

spring-boot-starter-web [3.0.6]
mysql-connector-java [5.1.46]
druid [1.2.17]
mybatis-plus-boot-starter [3.5.3.1]
pagehelper-spring-boot-starter [1.4.3]

分页代码

 try (Page<Object> page = PageHelper.startPage(request.getPage(), 10)) {
            StudentParam param = new StudentParam();
            param.setId(request.getStudentId());
            param.setPhone(request.getPhone());
            param.setCardNo(request.getCardNo());
            param.setAccount(request.getAccount());
            beanList = studentRepository.getList(param);
            total = Long.valueOf(page.getTotal()).intValue();
        }

问题 分页失败 导致全量查询 数据库IO请求飙升

解决方案

升级 pagehelper-spring-boot-starter 从1.4.3 到1.4.6 即可解决

需求

能否简单解释下为什么导致此问题 还是因为1.4.3不支持spring boot 过高版本

@abel533
Copy link
Collaborator

abel533 commented May 26, 2023

可以看看更新日志中有没有对这里有影响的。

@quccwang
Copy link

quccwang commented Jun 1, 2023

遇到和你一样的问题,就是版本依赖不兼容导致的,这得看源码了,springboot高版本必须匹配高版本的第三方jar包,或者降低springboot的版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants