本文内容整理来源:http://blog.csdn.net/john1337/article/details/70230563 今天在使用mybatis时遇到一个问题,Java代码中传递的整数0在mybatis中被识别成null [html] view plain copy <where> <if test="status != null and status !=''"> and status=#{status,jdbcType=INTEGER} </if> </where> 如果java代码需要往mybatis传递整数0,那么需要使用增强版的判断,具体如下所示: [html] view plain copy <where> <if test="status != null and status !='' or status==0"> and status=#{status,jdbcType=INTEGER} </if> </where>