mybatis双表查询
时间: 2023-08-28 16:22:41 浏览: 151
MyBatis的双表查询是通过使用MyBatis-Plus来实现的。MyBatis-Plus是在MyBatis的基础上进行了扩展,提供了更多方便的操作方法。在进行双表查询时,可以利用MyBatis-Plus提供的API来编写SQL语句。
首先,需要在配置文件中定义两个Mapper接口,分别对应两个表的查询操作。例如,在OrderDao接口中定义一个findAll方法,用于查询订单表的所有数据。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [mybatis-complete:完全保留原始mybatis功能同时,加入一揽子子的便捷功能,以单双表的dsl操作,多数据源,...](https://download.csdn.net/download/weixin_42157567/16051514)[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^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [mybatis多表查询](https://blog.csdn.net/Incuble/article/details/127739477)[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^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Mybatis双表联查](https://blog.csdn.net/IT__cainiao/article/details/120269424)[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^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文