基于Oracle数据库 的Ibatis分页sql配置

select * from
        (select top $endCount$ * from sys_news
        where  news_type = #newsType# and isdelete=#isdelete#
          <dynamic prepend=" and ">
         <isNotEmpty prepend=" and " property="title">title like '%$title$%'</isNotEmpty>
         </dynamic>
         order by create_date desc
         ) ns
      where ns.newsid not in  
         (  select top $startCount$ newsId from sys_news
          where news_type = #newsType# and isdelete=#isdelete#
          <dynamic prepend=" and ">
         <isNotEmpty prepend=" and " property="title">title like '%$title$%'</isNotEmpty>
         </dynamic>
         order by create_date desc
         )
                   
             select * from (
             select sn.*,rownum r from sys_news sn
                where rownum &lt;= $endCount$ and  sn.news_type =#newsType# and sn.isdelete=#isdelete#
               
                    <dynamic prepend=" and ">
                         <isNotEmpty prepend=" and " property="title">title like '%$title$%'</isNotEmpty>
                         </dynamic>
                order by create_date desc) where r &gt; $startCount$

 

 

 

<![CDATA[  
                SELECT * FROM (SELECT row_.*, rownum r FROM
                  (select sn.* from sys_news sn
                    where sn.news_type =#newsType# and sn.isdelete =#isdelete#
                        
                       ) row_ WHERE rownum <= $endCount$ )row_ WHERE r > $startCount$
                        ORDER BY create_date desc
                         ]]> 

 

 

 

 

 select * from (
             select sn.*,rownum r from sys_news sn
                where rownum &lt;= $endCount$ and  sn.news_type ='$newsType$' and sn.isdelete='$isdelete$'
               
                    <dynamic prepend=" and ">
                         <isNotEmpty prepend=" and " property="title">title like '%$title$%'</isNotEmpty>
                         </dynamic>
                order by create_date desc) where r &gt; $startCount$

 

你可能感兴趣的:(oracle数据库)