//查询所有
List<PmsProduct> list1 = pmsProductService.list(new QueryWrapper<PmsProduct>()); 1 //根据条件查询 eq List<PmsProduct> list2 = pmsProductService.list(new QueryWrapper<PmsProduct>().eq("id",2)); 1 //关键字查询 like // 左 likelift %t ,右 likeRight t% //notLike不包含 List<PmsProduct> list3 = pmsProductService.list(new QueryWrapper<PmsProduct>().eq("id",2).like("name","小王")); 1 //排序 orderBy List<PmsProduct> list4 = pmsProductService.list(new QueryWrapper<PmsProduct>().eq("id",2).like("name","小王").orderByDesc("age")); 1 //不等于 ne 大于gt 大于等于ge 小于lt List<PmsProduct> list5 = pmsProductService.list(new QueryWrapper<PmsProduct>().eq("id",2).like("name","小王").orderByDesc("age").ne("name","www")); 1 查询不为空的某字段 isNotNull List<PmsProduct> list1 = pmsProductService.list(Wrappers.<PmsProduct>lambdaQuery().isNotNull(PmsProduct::getBrandName)); 1 //分页page Page<PmsProduct> pmsProductPage = pmsProductService.page(new Page<PmsProduct>(1, 10), new QueryWrapper<>(new PmsProduct())); 1 //筛选对像的某一个具体属性 select Integer countyId = sysAreaService.getObj(new QueryWrapper<SysArea>().select("id").eq("name", location.getCity()), o -> (Integer) o); 1 //在某个范围内 between // 分页查询 10 条姓名为‘张三’、性别为男,且年龄在18至50之间的用户记录 List<User> userList = userMapper.selectPage( new Page<User>(1, 10), new EntityWrapper<User>().eq("name", "张三") .eq("sex", 0) .between("age", "18", "50")