当前位置:   article > 正文

SpringBoot中PageHelper的使用_pagehelper-springboot如何使用

pagehelper-springboot如何使用

SpringBoot中PageHelper的使用

一、pom依赖:

		<!-- 引入PageHelper分页插件 -->
		<dependency>
			<groupId>com.github.pagehelper</groupId>
			<artifactId>pagehelper-spring-boot-starter</artifactId>
			<version>1.4.1</version>
		</dependency>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

二、配置

pagehelper.helper-dialect=mysql
  • 1

三、使用

注意PageHelper只会后面第一条查询语句有作用!

        //1为pageNum,从1开始,10为pageSize
        PageHelper.startPage(1, 10, true);
        //List<RoleInfo> list = roleInfoService.list();
  • 1
  • 2
  • 3
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/88112
推荐阅读
相关标签
  

闽ICP备14008679号