码迷,mamicode.com
首页 > 其他好文 > 详细

Mybatis 分页

时间:2017-06-02 23:02:10      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:大于等于   public   doc   app   end   dex   order by   from   ati   

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="user.page">

<!-- 分页查询
在xml文件中小于号是标签的开始. 不能使用.
小于 -> &lt; less than
大于 -> &gt;
小于等于 -> &lte; less than and equals
大于等于 -> &gte;
<![CDATA[]]> -> 代表在标签体内编写所有的信息,都是纯文本.不需要做任何的标签解析,xml解析.
-->
<select id="selectUserByPage" resultType="User">
<![CDATA[
select u2.id, u2.name, u2.password, u2.age from
(select u1.id, u1.name, u1.password, u1.age, u1.rn from
(select id, name, password, age, rownum as rn
from tb_user order by id) u1
where u1.rn < #{endIndex} ) u2
where u2.rn > #{startIndex}
]]>
</select>

</mapper>

Mybatis 分页

标签:大于等于   public   doc   app   end   dex   order by   from   ati   

原文地址:http://www.cnblogs.com/Itbin/p/Mybatis.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!