简单查询(推荐)
LambdaQueryWrapper<User> wrapper = new LambdaQueryWrapper<>(); wrapper.eq(User::getUserId, id); wrapper.like(User::getUserName, userName); List<User> users= userService.selectList(wrapper);
链式查询(不推荐)
List<User> users= new LambdaQueryChainWrapper<>(userService) .eq(User::getUserId, id) .list();
BannerItem bannerItem = new LambdaQueryChainWrapper<>(userService)
.eq(User::getUserId, id)
.one();
判断条件参考
参考链接:
https://blog.csdn.net/liuxing201122013/article/details/120874343
http://events.jianshu.io/p/aec36a1bd2ec
标签:LambdaQueryWrapper,MybatisPlus,wrapper,用法,User,userService,eq,id From: https://www.cnblogs.com/hyhc8848/p/17129050.html