刚入门mybatis-plus然后出现了这个问题,只是实现查询,但出不来
参考mybatisplus官方测试用例吧
看看 是不是userMapper 没有注入成功?
@MapperScan("com.xxxxx.dao")
public class App {
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
}
在你的主启动类上面添加@MapperScan("com.xxxxx.dao")
com.xxxxx.dao 是你的UserMapper的父目录
声明的Bean : userMapper没成功,空指针了。你可以打个断点看一下