oracle的分页查询,mabatis的sql配置

<select id="getCardcaseByPage" resultType="Cardcase" >
select * from (
select a.*,rownum rn from (
select * from TAB_SYS_CARDCASE
where oper_id = #{operId}
and status = 1
<if test="serchKey != null and serchKey != '' and serchKey != 'null' ">
and (phone like '%' || #{serchKey} || '%' or user_name like '%' || #{serchKey} || '%' )
</if>
order by id desc
<![CDATA[
) a where rownum <= #{end}
) where rn >= #{start}
]]>
</select>
原文地址:https://www.cnblogs.com/YuyuanNo1/p/7992565.html