报错
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.xxxx.mapper.SysMenuMapper.xxxx
原因
- 检查xml文件所在package名称是否和Mapper interfacel所在的包名是否一致
<mapper namespace="me.tspace.pm.dao.UserDao">
-
mapper的namespace写的不对!!!注意系修改。
-
UserDao的方法在UserDao.Xml中没有,然后执行UserDao的方法会报此
-
UserDaol的方法返回值是List,而select元素没有正确配置
ResultMap,或者只配置ResultType! -
如果你确认没有以上问题,请任意修改下对应的X文件,比如删除一个空行,保存.问题解决
-
看下mapper的XML配置路径是否正确
mybatis-plus:
type-aliases-package: com.xxx.xxx.common.feign.upms.vo
# xxxMapper.xml 路径
mapper-locations: classpath*:com/xxx/xxx/xxx/xxx/xxx/mapper/**/*.xml
configuration:
# 驼峰下划线转换
map-underscore-to-camel-case: true
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
本人原因是最后一个。