1.問題提示
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
2.問題原因
在mybatis中dao接口與mapper配置文件在做映射綁定的時候出現問題,簡單說,就是接口與xml要麼是找不到,要麼是找到了卻匹配不到。
3.解決辦法
- 如果使用Mybatis框架操作數據庫時, 需要正確配置application.properties中mybatis.mapper-locations = classpath*:mapper/*.xml
- 如果使用Mybatis-plus框架操作數據庫時, 需要正確配置application.properties中mybatis-plus.mapper-locations = classpath*:mapper/*.xml