IBatis分页显示

<select id="pagedListOrderOpen">
SELECT * FROM (
</select>

 

<sql id="pagedListOrderClose">
) PagedList
<dynamic prepend="WHERE">
<isNotNull prepend="AND" property="StartIndex"><![CDATA[PagedList.rowNum>=#StartIndex#]]></isNotNull>
<isNotNull prepend="AND" property="EndIndex"><![CDATA[PagedList.rowNum<=#EndIndex#]]></isNotNull>
</dynamic>
</sql>

 

<select id="selOrdersWithPaging" parameterClass="OrderSearch" resultClass="Order" extends="pagedListOrderOpen" resultMap="OrderMappingResult">
SELECT O.*,rowNum = ROW_NUMBER() OVER(ORDER BY OrderId DESC)
FROM OrderInfo AS O (NOLOCK)
<include refid="fuzzySearchActivityConfig"/>
<include refid="pagedListOrderClose" />
</select>

 

<sql id="fuzzySearchOrder">
<dynamic prepend="WHERE">
<isNotEmpty property="Caption" prepend="AND">
<![CDATA[O.Caption LIKE '%$Caption$%']]>
</isNotEmpty>
<isNotNull property="SaleStartDate" prepend="AND">
<![CDATA[O.SaleDate >= #SaleStartDate#]]>
</isNotNull>
<isNotNull property="SaleEndDate" prepend="AND">
<![CDATA[O.SaleDate <= #SaleEndDate#]]>
</isNotNull>
<isNotEmpty property="Status" prepend="AND">
<![CDATA[O.Status=#Status#]]>
</isNotEmpty>
</dynamic>
</sql>

 

posted @ 2016-06-01 17:13  zslm___  阅读(174)  评论(0编辑  收藏  举报