MyBatis中对于字符串blank(null、empty)的判定方法
直接上代码,关键需要进行2个判定,一个是null判定,一个是 ‘’ 判定。
<where> <if test="url!= null and url!=''"> url LIKE #{url} </if> </where>
Doing is better than nothing
<where> <if test="url!= null and url!=''"> url LIKE #{url} </if> </where>