由于我们使用的是Mapper组件,然后用的是import tk.mybatis.spring.annotation.MapperScan; 去扫描的包,而并没有向容器放入usermapper,所以我们这里就报错了 改为false即可