解决方法:
每个Mapper类中添加 @Mapper
添加了@Mapper注解之后这个接口在编译时会生成相应的实现类
需要注意的是:这个接口中不可以定义同名的方法,因为会生成相同的id
也就是说这个接口是不支持重载的
或者在application.java启动类前面加上 @MapperScan()
@SpringBootApplication
@MapperScan("com.wangpan.netdisk.dao")
public class NetdiskApplication {
public static void main(String[] args) {
SpringApplication.run(NetdiskApplication.class, args);
@MapperScan()中参数为dao层包的路径