Mybatis Plus分页查询
一、配置 /** * @author beth * @data 2019-10-14 20:01 */ @Configuration public class MybatisPlusConfig { @Bean public PaginationInterceptor paginationInterceptor(){ return new PaginationInterceptor(); } } 二、分页查询 /** * 分页查询 */ @Test public void selectPage() { QueryWrapper<UserInfo> queryWrapper = new QueryWrapper<UserInfo>(); queryWrapper.ge("age",26); Page<UserInfo> page = new Page<UserInfo>(1,2); IPage<UserInfo> iPage = userInfoMapper.selectPage(page,queryWrapper); System.out.println("总页数"+iPage.getPages()); System.out.println("总记录数"+iPage.getTotal()); List<UserInfo> userInfoList = iPage