<if test="status!= null and status!= ''"> status=#{status}, </if>
在mybatis中這樣寫的話,若是是String類型的話是沒有任何問題的,可是若是是傳入的Integer的話就會出現傳入0被判斷爲空的現象,可是也不是必現的,爲何不是必現的也不太清,可是若是變量的值是0,即 status= 0, mybatis在進行 status!= ‘’ 的時候會認爲 status的值是空字符串, 即 status== ‘’ 爲true。因此若是是Integer類型只須要判斷 != null 便可mybatis