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>

posted on 2017-12-06 14:37  小甜瓜安东泥  阅读(386)  评论(0编辑  收藏  举报