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、加标签后运行正常!

 

posted @ 2021-06-01 11:55  Mr.攻城师  阅读(170)  评论(0编辑  收藏  举报