10 MyBatis——分页查询实现
使用map实现分页
java中
int pageSize = 2; int startPage = 0; map.put("pageSize", pageSize); map.put("startPage", startPage); list = session.selectList("cn.xiaohei.mapper.PeopleMapper.selLimit",map);
Mapper中
<select id="selLimit" resultType="cn.xiaohei.pojo.People" parameterType="map"> select * from people limit #{startPage},#{pageSize} </select>