Mybatis中<if test="id!=0">加上后报id在Integer里没有get方法,不加就没事

报错为:
org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'class java.lang.Integer'

Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'class java.lang.Integer'

    <select id="findById" parameterType="int" resultType="user">
        <include refid="selectUser"/>
        <where>
            <if test="id!=0">
                and id=#{id}
            </if>
        </where>
    </select>
</mapper>

想问问为何

Mapper 接口方法的参数上加上 @Param("id") 试试