首页 > 解决方案 > MapperScan 运行良好,但想法显示为错误

问题描述

应用

@SpringBootApplication
@MapperScan("com.xxx.mapper")
public class xxxApplication {

}

用户服务实现

@Service
@Slf4j
public class UserServiceImpl extends ServiceImpl<UserMapper, User>
        implements UserService {
    @Autowired
    UserMapper userMapper; \\Idea Show Error Here: Could not autowire. No beans of 'UserDeviceMapper' type found. 
}

用户映射器

//Without @Repository
public interface UserMapper extends BaseMapper<User> {

是想法的错误还是错误的使用

标签: springspring-bootmybatis

解决方案


推荐阅读