1首先我们要了解到 既然已经使用了mp加boot默认的是全注解开发
而且 sqlsession和boot之类的文件已经收spring管理了
如果你要使用xml
首先告知mp你的xml文件在哪里(在application.yml里写,文件当然创建在你自己的位置)
mybatis-plus:
mapper-locations: classpath:mapper/*.xml
在的mapper类里面加入@Repository
@Repository
@Mapper
public interface EmployeeMapper extends BaseMapper<Employee> {
public int selecthaha();
}
写相关的接口方法
最重要的是第二步
注解开发要用@Mapper,xml开发要用@Repository
两个注解一个不能少
以下是一些插件的解决方案