mybatis 分页查询设置总数
时间: 2023-10-19 21:00:28 浏览: 148
在Mybatis中进行分页查询并设置总数可以通过以下步骤实现:
1. 在mapper.xml文件中,编写分页查询的sql语句,可以使用limit关键字进行物理分页。例如:SELECT * FROM table_name LIMIT offset, limit。其中,offset表示起始位置,limit表示每页显示的记录数量。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Mybatis分页查询,同时获取数据总数和分页数据列表](https://blog.csdn.net/LYY1448019681/article/details/120757553)[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分页查询代码优化](https://blog.csdn.net/luomaCLX/article/details/127401196)[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 ]
阅读全文