springBoot + mybatis-plus + paehelper进行分页查询

框架这里就不多做赘述了, 百度一大堆的教程

1.引入pagehelper的依赖, 这里引入的是启动器的依赖

springBoot + mybatis-plus + paehelper进行分页查询

2.配置

遵循springBoot约束大于配置的原则, 建议不配置, 也就是使用pagehelper默认的配置,默认的配置以及够用了, 如果需要用到高级分页功能, 那看我这个博客也没啥学习效果了, 哈哈

3.代码

springBoot + mybatis-plus + paehelper进行分页查询
springBoot + mybatis-plus + paehelper进行分页查询
我这里是自定义了一个封装对象, 大家可以根据自己情况进行定义,

4踩坑

需要注意的是引入的mybatis-plus中依赖的mybatis版本, 一定不能大于pagehelper中的版本, 否则启动会报错. 引入mybatis或者tk.mapper也是一样
springBoot + mybatis-plus + paehelper进行分页查询
可以在maven管理的依赖中查看.