mybatis的mapper返回map结果集(springboot)
2023-09-14 09:03:39 时间
通过MapKey指定map的key值
@MapKey("id")
Map<Long, UserInfo> getUserInfoMap();
@MapKey("id")
Map<Long, Map<String,Object>> getUserValueMap();
map的value为java类
<resultMap id="UserResultMap" type="com.xixicat.domain.UserInfo">
<result property="id" column="id" />
<result property="username" column="username" />
<result property="sex" column="sex" />
</resultMap>
<select id="getUserInfoMap" resultMap="UserResultMap">
select id,username,sex from user_info
</select>
map的value为map
<select id="getUserValueMap" resultType="map" >
select id,username,sex from user_info
from user_info
</select>
相关文章
- springboot启动原理总结_Springboot启动流程
- SpringBoot的启动流程_springboot启动卡住了
- Spring学习笔记(二十四)——springboot实现邮箱服务
- Springboot&websocket实现IP数据实时统计
- SpringBoot框架:第二章:SpringBoot中static和templates二个目录下的页面和静态资源访问的三个常见问题
- MAP遍历_map容器遍历
- 5-Springboot进阶1
- SpringBoot快速搭建、自动流程进阶、装配机制、功能扩展点详解
- springBoot整合Mybatis-Plus需要的依赖_springboot中文手册
- springboot使用问题集合
- YAML的基本语法(SpringBoot官方建议的配置文件)
- SpringSchedule 定时任务框架使用步骤(基于SpringBoot)
- SpringBoot集成QQ/网易/Gmail邮箱发送邮件
- SpringBoot版的低代码开发平台,关联无 SQL,性能高10倍!
- IntelliJ IDEA使用spring Initializr快速构建SpringBoot项目
- 【springboot项目】纳米搜索引擎
- SpringBoot(一)走进Springboot的世界详解编程语言
- springboot添加多数据源连接池并配置Mybatis详解编程语言
- springboot 配置热部署详解编程语言
- Redis快速遍历Map的技巧(redis 遍历map)
- 将Map存入Redis一步一步解决方案(将map存到redis中)
- 如何将Map存储在Redis中(将map存到redis中)
- 解决Redis频繁修改Map难题(redis频繁修改map)
- 使用Redis进行Map设置(redis设置map)