LambdaQueryWrapper 查询parentId
时间: 2023-10-15 19:26:15 浏览: 81
LambdaQueryWrapper可以用于构建查询条件,其中eq方法可以用于设置等值查询条件。在引用中的代码示例中,LambdaQueryWrapper的实例queryWrapper通过eq方法设置了一个等值查询条件,即查询parentId等于给定的参数parentId的记录。同时,在代码中注释中解释了GoodsType::getParentId的含义,即获取GoodsType对象的parentId属性值。
所以,LambdaQueryWrapper查询parentId的操作可以通过eq方法进行,代码示例如下:
```
LambdaQueryWrapper<GoodsType> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(GoodsType::getParentId, parentId);
```
这段代码将会返回一个查询条件设置了parentId等于给定值的LambdaQueryWrapper对象。<span class="em">1</span><span class="em">2</span>
#### 引用[.reference_title]
- *1* [LambdaQueryWrapper lambda表达式](https://blog.csdn.net/LMY0210/article/details/128748750)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [LambdaQueryWrapper用法简单介绍](https://blog.csdn.net/weixin_41629964/article/details/122836988)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文