无效绑定语句(未找到):mapper文件找不到错误

ibatis.binding.BindingException: Invalid bound statement (not found): 

1.检查自己的规范没有问题

mapper.xml的namespace要写所映射接口的全称类名。
mapper.xml中的每个statement的id要和接口方法的方法名相同
mapper.xml中定义的每个sql的parameterType要和接口方法的形参类型相同
mapper.xml中定义的每个sql的resultType要和接口方法的返回值的类型相同

mapper.xml的命名规范遵守: 接口名+Mapper.xml

2.检查自己mapper-locations: classpath:mapper/**/*.xml 也没问题。

3,后来发现自己的项目依赖是mybatis-plus。

mybatis: 
  type-aliases-package: 
  mapper-locations: 

换成

mybatis-plus: 
  type-aliases-package:
  mapper-locations: 

问题解决

你可能感兴趣的:(mybatis)