mybatis返回list<map<string,object>>
时间: 2023-12-08 18:05:27 浏览: 289
mybatis返回List<Map<String, Object>>的好处在于不需要再定义一个实体类对象,可以直接接收返回的数据。这种返回类型通常用于连接查询,当查询结果涉及多个表时,可以使用这种方式来接收返回的数据。\[2\]在xml文件中,可以使用resultType="java.util.HashMap"来定义返回类型为List<Map<String, Object>>。\[1\]这样,查询结果会以List的形式返回,每个元素都是一个Map,其中Key为String类型,Value为Object类型。这样的返回结果可以方便地进行遍历和操作。\[3\]
#### 引用[.reference_title]
- *1* [mybatis 查询返回List<String>、Map<String,Object>、List<Map<String,Object>>](https://blog.csdn.net/li1325169021/article/details/114003291)[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^v91^control_2,239^v12^insert_chatgpt"}} ] [.reference_item]
- *2* [Mybatis查询返回Map<String,Object>类型](https://blog.csdn.net/Syals/article/details/125333637)[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^v91^control_2,239^v12^insert_chatgpt"}} ] [.reference_item]
- *3* [mybatis返回结果为List<Map<String, Object>>的写法](https://blog.csdn.net/weixin_43860634/article/details/124401119)[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^v91^control_2,239^v12^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文