MyBatis中动态SQL语句完成多条件查询

时间:2018-03-26 23:58:58   收藏:0   阅读:992
http://blog.csdn.net/yanggaosheng/article/details/46685565
MyBatis中动态SQL语句完成多条件查询
 
<select id="queryEmp"  resultType="cn.test.entity.Emp">
          select * from emp where 1=1
          <if test="deptNo!=null">
          and deptno=#{deptNO}
          </if>
          <if test="deptName!=null">
          and deptno=#{deptName}
          </if>
          </select>

原文:https://www.cnblogs.com/2016-cxp/p/8654727.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!