ibatis分页查询

<select id="queryPo" parameterClass="po" resultClass="po">
		<isGreaterThan property="start" compareValue="0">
			SELECT * FROM (SELECT PO.*,ROWNUM rn FROM (
		</isGreaterThan>
		<![CDATA[
		   SELECT * FROM PO
	    ]]>
		<dynamic prepend="WHERE">
			<isNotEmpty property="id">
				<isGreaterThan property="id" compareValue="0" prepend="AND">
					id=#id#
				</isGreaterThan>
			</isNotEmpty>
			<isNotEmpty property="poNo" prepend="AND">
				poNo=#poNo#
			</isNotEmpty>
		</dynamic>
		<isGreaterThan property="limit" compareValue="0">
			<![CDATA[
			) PO WHERE ROWNUM >= #start#) WHERE rn < #start#+#limit#
			]]>
		</isGreaterThan>
	</select>
posted @ 2011-08-02 10:05  上善¤若水  阅读(124)  评论(0编辑  收藏  举报