Springboot mybatis pagehelper分页不生效的问题

springboot版本

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.1.5.RELEASE</version>
		<relativePath/> <!-- lookup parent from repository -->

按照正常的代码:

        PageHelper.startPage(pageNum,4);
        WechatAccountExample example = new WechatAccountExample();
        List<WechatAccount> accounts = wechatAccountMapper.selectByExample(example);
        PageInfo<WechatAccount>  pageInfo = new PageInfo<>(accounts);
        return pageInfo;

pagehelper配置

#pagehelper分页插件配置
pagehelper:
  helperDialect: mysql
  reasonable: true
  supportMethodsArguments: true
  params: count=countSqle

pom依赖

		<!--分页插件-->
		<dependency>
			<groupId>com.github.pagehelper</groupId>
			<artifactId>pagehelper</artifactId>
			<version>4.1.0</version>
		</dependency>

结果查出来还是没暖用,全部给查出来了。后来查了很多博客有人说加上

		<dependency>
			<groupId>com.github.pagehelper</groupId>
			<artifactId>pagehelper-spring-boot-autoconfigure</artifactId>
			<version>1.2.5</version>
		</dependency>

还是没用,有人说用一个依赖就行了,

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

还是不行!!!!!

无意中把版本改为了1.2.10,妈的出来了。

记录一下。。。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值