pageHelper不生效,sql没有自动加上limit

文章目录

问题引入

我原本在SSM项目中使用过pageHelper插件,引入依赖 + 修改mybaits核心配置文件,分页插件可以正常使用。

这次我在springboot项目中使用pageHelper进行分页查询时没有起作用(sql语句中没有拼接上limit),查询出来了全部的数据。

问题解决

SSM项目 中使用pageHelper插件需要引入的依赖是这样的:

<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper</artifactId>
    <version>5.3.0</version>
</dependency>

SpringBoot项目 中引入的依赖跟SSM项目不同:

<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper-spring-boot-starter</artifactId>
    <version>1.4.2</version>
</dependency>

猜你喜欢

转载自blog.csdn.net/qq_46095164/article/details/125972196