springboot + mybatis 自动生成相关实体映射 required a bean of type 'xx.xx.xxMapper' that could not be found

springboot + mybatis 自动生成相关实体映射

报错信息:required a bean of type 'xx.xx.xxMapper' that could not be found

springboot + mybatis 自动生成相关实体映射 required a bean of type 'xx.xx.xxMapper' that could not be found

解决办法:

1、在你对应的实体上边添加@Mapper

springboot + mybatis 自动生成相关实体映射 required a bean of type 'xx.xx.xxMapper' that could not be found

2、在 main函数上添加扫描注解:@MapperScan("对应包的路径")(该方法没有测试成功)

springboot + mybatis 自动生成相关实体映射 required a bean of type 'xx.xx.xxMapper' that could not be found