报错原因是配置文件没有加: mybatis.mapper-locations=classpath:mapper/*.xml mybatis没有找到mapper里的xml,如果不是上述原因也可能是xml里名称或包名错误等相关原因