解决:
在pom加入分页插件mybatis的依赖,然后再springbootapplication那个类加上MapperScan注解
<!-- 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.1.2</version>
</dependency>