1、检查bean id是否重叠,重复则使用@Qualified搭配@Autowried。
2、检查application.xml(或yaml)配置文件,是否指定mapper路径。
3、mapper.xml中使用了别名,但是没有配置,回到application配置文件,加入对应的包路径:
# 配置MyBatis的XML配置文件路径
mybatis.mapper-locations=classpath:mapper/*.xml
# 配置XML映射文件中指定的实体类别名路径
mybatis.type-aliases-package=com.xxx.entity, com.xxx.domain