Field demoDao in com.example.demo.service.impl.DemoServiceImpl required a bean of type 'com.example.demo.dao.DemoDao' that could not be found.
原因:在编译之后没有生成相应的接口实现类
解决办法:
方法一、在每个dao层添加@Mapper注解:
方法二、在启动类添加注解@MapperScan("com.example.demo.dao")
Field demoDao in com.example.demo.service.impl.DemoServiceImpl required a bean of type 'com.example.demo.dao.DemoDao' that could not be found.
原因:在编译之后没有生成相应的接口实现类
解决办法:
方法一、在每个dao层添加@Mapper注解:
方法二、在启动类添加注解@MapperScan("com.example.demo.dao")