<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>