依赖引入:

    1. <!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper-spring-boot-starter -->
    2. <dependency>
    3. <groupId>com.github.pagehelper</groupId>
    4. <artifactId>pagehelper-spring-boot-starter</artifactId>
    5. <version>1.3.0</version>
    6. </dependency>

    代码示例:

    PageHelper.startPage(pageNum,pageSize);
    List<XX> list = xxMapper.selectAll();
    PageInfo<XX> pageInfo = PageInfo.of(list);