1.  Configuration class
@Configuration public class MpConfig { /** * Paging plug-in */ @Bean public
PaginationInterceptor paginationInterceptor() { return new
PaginationInterceptor(); } }
2.  Implementation steps
//1. establish page object // Pass in two parameters : Current page and Number of records per page Page<User> page = new Page<>(1,3);
// call mybatis-plus Paging query method // The first parameter is to encapsulate the paging data into page Inside the object , The second parameter is query filter criteria
userMapper.selectPage(page, null); // Data per page list aggregate
System.out.println(page.getRecords()); // Current page
System.out.println(page.getCurrent()); // Number of records per page
System.out.println(page.getSize()); // Total records System.out.println(page.getTotal());

Technology