<select id="queryEmp" resultType="entity.Emp" parameterType="Map">
select
<include refid="empColumns"></include>
<!-- -->
from e_emp e where 1=1 //这里为什么添加1=1 请解释一下。谢谢!
<if test="name!=null and name!=''">
and e.ename like '%${name}%'
</if>
<if test="sex != '全部'">
and e.esex = #{sex}
</if>
<if test="marge != 2">
and e.emarge = #{marge}
</if>
</select>
Caballarii
相关分类