zoukankan      html  css  js  c++  java
  • 分页查询

    Oracle+Mybits:第一条是纯sql,第二条是map

    select *
      from (select rownum rw, a.*
              from(
              select * from eb_item t
              where t.brand_id = 1003
              and t.show_status = 0
              and t.audit_status = 1
              and t.item_name like '%%'
              ) a
             where rownum < 10) b
     where b.rw > 0;

    ------------------------------------------------

    select *
      from (select rownum rw, a.*
              from (
              select * from eb_item t
              <where>
                  <if test="brandId != null">
                      t.brand_id = #{brandId}
                  </if>
                  <if test="auditStatus != null">
                      and t.audit_status = #{auditStatus}
                  </if>
                  <if test="showStatus != null">
                      and t.show_status = #{showStatus}
                  </if>
                  <if test="itemName != null and itemName != ''">
                      and t.item_name like '%${itemName}%'
                  </if>
              </where>
              order by t.item_id desc
         <![CDATA[
              ) a
             where rownum < #{endNum}) b
     where b.rw > #{startNum}
     ]]>

  • 相关阅读:
    初步学习next.js-1-新建项目
    对象比较-深层,浅层
    制作右键菜单
    使用高德API-初级应用
    启动前后端连载方法
    使用websocket
    关于图片压缩
    归并排序(mergesort)
    冒泡排序
    递归介绍
  • 原文地址:https://www.cnblogs.com/Each-Person-Got-a-Dream/p/9081598.html
Copyright © 2011-2022 走看看