首页 > 其他 > 详细

mybatis 全查 分页 模糊查询一体

时间:2018-10-04 14:50:07      阅读:335      评论:0      收藏:0      [点我收藏+]
<!-- 全查 分页 模糊-->
  <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 全查 分页 模糊查询一体

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!