com.github.pagehelper
pagehelper-spring-boot-starter
1.2.3
org.mybatis
mybatis
org.mybatis
mybatis-spring
com.baomidou
mybatis-plus-boot-starter
3.1.2
排除pagehelper的依赖mybatis和mybatis-spring的jar包以免与mybatis-plus的冲突,导致报NoClassFound org.mybatis.logging.LoggerFactory
pagehelper:
reasonable: false # 禁用合理化时,如果pageNum<1或pageNum>pages会返回空数据
support-methods-arguments: true
params: count=countSql
row-bounds-with-count: true
helper-dialect: mysql
@Test
public void testSelectPageHelper(){
PageHelper.startPage(0, 5);
List<User> users = userMapper.selectList(null);
PageInfo<User> pageInfo = new PageInfo(users, 5);
System.out.println(pageInfo);
}