码迷,mamicode.com
首页 > 其他好文 > 详细

mybatis 全查 分页 模糊查询一体

时间:2018-10-04 14:57:35      阅读:329      评论:0      收藏:0      [点我收藏+]

标签:name   pre   总数   val   select   ice   highlight   datetime   title   

<!-- 全查 分页 模糊-->
  <select id="selectAll" resultMap="BaseResultMap" >
    SELECT NOTICE_ID,NOTICE_TITLE,TYPE,DATETIME FROM pt_notice
    <where>
      <if test=" type != null and type != ‘‘ ">
        <bind name="fType" value=" ‘%‘ + type + ‘%‘ "></bind>
        type like #{fType}
      </if>
      <if test=" noticeTitle != null and noticeTitle != ‘‘ ">
        <bind name="noticeTitlef" value=" ‘%‘ + noticeTitle + ‘%‘ "></bind>
        AND NOTICE_TITLE like #{noticeTitlef}
      </if>
    </where>
    limit #{startIndex},#{pageSize}
  </select>
  <!--统计总数-->
  <select id="count" resultType="int">
    select count(NOTICE_ID)
    from pt_notice
  </select>

  

mybatis 全查 分页 模糊查询一体

标签:name   pre   总数   val   select   ice   highlight   datetime   title   

原文地址:https://www.cnblogs.com/woshuyuqiang/p/9742202.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!