问题描述:
idea在做springboot项目时,dao层获取数据报错:
Checks autowiring problems in a bean class.
问题分析:
意思是bean没注入,我反复查看了service和dao层,发现dao层上少了注解@Repository
解决:
@Repository
@Mapper
public interface MiaoshaUserDao {
@Select("select * from miaosha_user where mobile=#{mobile}")
public MiaoshaUser getByMoblie(@Param("mobile") String mobile);
}