RowBounds paging

No longer use SQL to implement paging 1. Interface

List<User> getUserByRowBounds();

2.mapper.xml

<select id="getUserByRowBounds" resultMap="UserMap">
    select * from mybatis.user
</select>

3. The test

@Test public void getUserByRowBounds(){ SqlSession sqlSession = MybatisUtils.getSqlSession(); //RowBounds implements RowBounds RowBounds = new RowBounds(1,2); // Paging List<User> userList = sqlSession.selectList("com.jialidun.dao.UserDap.getUserByRowBounds",null,rowBounds); for(User user:userList){ System.out.println(user); } sqlSession.close(); }