在mybatis的mapper文件中判断对象属性或者字符串是否为空的时候常用以下判断条件: <if test="type!=null and type!=''"> AND type = #{type} </if>