解决
//Integer类型入参,动态sql判断只需要判null即可 <if test="status != null "> and status = #{status}</if>
原因
mybatis源码在预编译sql时,使用OGNL表达式来解析if标签,对于Integer类型属性,(status != '')会当作(status!=0)来判断
//Integer类型入参,动态sql判断只需要判null即可 <if test="status != null "> and status = #{status}</if>
mybatis源码在预编译sql时,使用OGNL表达式来解析if标签,对于Integer类型属性,(status != '')会当作(status!=0)来判断