mybatisplus倒序
时间: 2023-08-26 10:06:17 浏览: 203
MyBatis-plus可以通过使用`QueryWrapper`来进行倒序查询。在使用`QueryWrapper`的时候,可以使用`orderByDesc`方法来指定按照某个字段进行倒序排序。例如,可以按照字段名`sort`进行倒序排序。具体的代码示例如下:
```
QueryWrapper<CategoryEntity> wrapper = new QueryWrapper<>();
wrapper.orderByDesc("sort");
```
这样就可以实现按照`sort`字段进行倒序查询了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [学习 MyBatis-Plus 笔记](https://blog.csdn.net/Wxin0721/article/details/124096470)[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^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [MyBatis-plusSQL语句包装器QueryWrapper,包装器查询倒序返回第一个](https://blog.csdn.net/Be_insighted/article/details/119982137)[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^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文