<if test="status != null and status != ''" > and status = #{status} </if>test
当status类型为Integer时,且status不为null时好比Integer类型的0,1, if条件添加不上。由于Integer类型的status不可能为''; 注意传入Integer类型的参数时,不要判断 and status != '' 只判断 != null便可。参数