1、报错信息
Field userMapper in com.xxx.xxx.service.impl.UserServiceImpl required a bean of type 'com.xxx.xxx.mapper.UserMapper' that could not be found.
2、原因
没有把UserMapper托管到Spring容器
3、解决办法
第一种:
在UserMapper上面加上@Mapper的注解
第二种:
在该项目的启动类上面加上@MapperScan("这里写放置mapper的包名")