在mapper接口上加上 @Component注解 例如: 就可以解决问题 原文链接:https://blog.youkuaiyun.com/Sir_He/article/details/81879854