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

总结:mybatis传单个类型参数(String、Integer),在dao层方法中可以不用@param注解,前提是xml中不含有条件表达式(when,if..标签中没有引用到该参数)

1、错误信息:

 2、mapper.xml、dao方法:

     

3、如果把mybatis的<if>标签去掉,就可以正常运行并接收传递的参数。如果想要使用条件表达式,那就要在dao层方法中加@Param("leader")

 4、加标签后运行正常!

原文地址:https://www.cnblogs.com/front-end-develop/p/14836632.html