@Autowiredprivate BrandMapper brandMapper;以上代码brandMapper经常爆红,程序却能正常运行,经度娘搜索后得出完美解决方案。网址链接:https://blog.csdn.net/Coder_Knight/article/details/83999139Mapper文件中添加@Repository注解。例如
@Repositorypublic interface BrandMapper extends Mapper<Brand> {}