mybatis出现Invalid bound statement (not found)

mybatis出现问题与mybatis-plus基本一致的,可以先参考我的另一篇文章:https://www.cnblogs.com/zhoushiya/p/12797240.html

但是这里需要注意,mybatis-plus对mapper-locations进行了默认设置,而且与mybatis的不一样。
当mybatis中mapper类与mapper.xml不在同一个命名空间,就需要在application.yml中自定义mapper-locations:

如上图,ArticleMapper.xml在mapper/testdb下,但是ArticleMapper.java在com.zhoushiya.springbootstudy.testdb.mapper下,这时就需要在application.yml中定义mapper.xml的文件位置。

原文地址:https://www.cnblogs.com/zhoushiya/p/12860332.html