标签:null class XML 开发 ram type find res ESS
为了简化 where 1=1 的条件拼装,我们可以采用where标签来简化开发
<!-- 根据用户信息查询 -->
<select id="findByUser" resultType="user" parameterType="user">
select * from user
<where>
<if test="username!=null and username != ‘‘ ">
and username like #{username}
</if>
<if test="address != null">
and address like #{address}
</if>
</where>
</select>
标签:null class XML 开发 ram type find res ESS
原文地址:https://www.cnblogs.com/Y-wee/p/13835156.html