在spring boot配置文件里加上这句: mybatis.mapper-locations: classpath:mapper/*.xml type-aliases-package:com.abu.entity 就成功运行