欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

pagehelper和springboot混合使用

程序员文章站 2022-05-31 19:59:28
...
<dependency>
			<groupId>com.github.pagehelper</groupId>
			<artifactId>pagehelper-spring-boot-starter</artifactId>
			<version>1.3.0</version>
		</dependency>
pagehelper:
  helper-dialect: mysql
  reasonable: true
  support-methods-arguments: true
  params: count=countsql
@RequestMapping("/test3")
    public String test3(){
        PageHelper.startPage(1,10);
        PageInfo<TestVo> pageInfo = new PageInfo<>(testMapper.selectAll());
        System.out.println(pageInfo.getList());
        System.out.println(pageInfo.getTotal());
        return pageInfo.getList().toString();
    }
相关标签: 搭建