@Mapper与@MapperScan不可同时使用
看看缺少依赖包了没有
StudentMapper.xml 文件放到 src/test/resources/mapper 目录试试吧
加个配置类:
@Configuration
public class MPConfig {
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
return interceptor;
}
}
确认一下配置文件中是否有指定mapper 的目录