• 分页查询


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

  • 相关阅读:
    植物大战僵尸智慧树和金币的简单破解(二)
    植物大战僵尸任意阳光的简单破解(一)
    Bash漏洞分析
    树莓派4 安装vim8.2 编译python3支持
    JAVA实现剑指offer 大神博主网址
    IO流+集合完成功能
    Java学习IO流处理
    Java中拷贝图片IO流
    Java学习list集合练习二
    java学习list集合训练
  • 原文地址:https://www.cnblogs.com/Each-Person-Got-a-Dream/p/9081598.html
Copyright © 2020-2023  润新知