1. 程式人生 > >MyBatis中動態SQL語句完成多條件查詢

MyBatis中動態SQL語句完成多條件查詢

null nbsp mybatis myba 查詢 from ref HR OS

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>

MyBatis中動態SQL語句完成多條件查詢