1、加入Maven依赖信息
<dependency> <groupId>tk.mybatis</groupId> <artifactId>mapper</artifactId> <version>4.0.0-beta3</version> </dependency>
2、修改Spring配置文件
<!-- 原始全类名:MyBatis:org.mybatis.spring.mapper.MapperScannerConfigurer 整合通用Mapper所需要做的配置修改 通用Mapper:tk.mybatis.spring.mapper.MapperScannerConfigurer --> <bean class="tk.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="basePackage" value="com.njf.mapper.mappers"/> </bean>