首先在Mapper接口添加@Repository注解 在依赖该接口的模块中的配置文件中添加扫描 <context:component-scan base-package="cn.edu.dao"></context:component-scan>