MyBatis动态SQL中的参数判空 null:未传此参数或传的值为null int <if test="id != null"> `SQL语句` </if> String <if test='str!= null and str != ""'> `SQL语句` </if> 集合类 使用size()的前提是list不为null <!-- map 同--> <if test="list!= null and list.size > 0 "> `SQL语句` </if>