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>

  

posted @ 2020-03-04 17:56  Scorpicat  阅读(137)  评论(0编辑  收藏  举报