mybatis-plus 获取新增id
2024-09-30 13:46:35
<insert id="insert" parameterType="com.xxx.xxxx.pojo.User">
insert into t_user (name)
values (#{user.name})
<selectKey resultType="Integer" order="AFTER" keyProperty="user.userId">
SELECT LAST_INSERT_ID() AS userId
</selectKey>
</insert>
第二种方法
<insert id="insert" parameterType="Spares"
useGeneratedKeys="true" keyProperty="id">
insert into system(name) values(#{name})
</insert>
然后在调用的时候就可以用对象的get属性方法来获取了
最新文章
- UIScrollView解决无法触发手势
- Map/Reduce 工作机制分析 --- 数据的流向分析
- Delphi 使用CHM文件制作系统帮助文档(上下文感知帮助的制作)
- WEB项目后端跨域请求
- mysql-binlog日志恢复数据库
- SPRING IN ACTION 第4版笔记-第三章ADVANCING WIRING-007-给BEAN运行时注入值placeholder、@Value
- WebLogic12c 注册windows系统服务
- 设置UIScrollView只可以水平或者竖直滚动
- JS代码混淆 支持PHP .NET PERL
- CodeForces 446B DZY Loves Modification
- windows下spark开发环境配置
- SpringBoot开发案例之整合Dubbo分布式服务
- 算法:60.第k个排列
- Painting the Fence Gym - 101911E(构造)
- ECMAscript5 新增数组内函数
- csu oj 1341 string and arrays
- jquery操作checked
- “error : unknown filesystem”的解决的方法
- 淘宝开源Web服务器Tengine基本安装步骤
- TEXTBOX属性TEXTMODE设置为PASSWORD后,后台不能给这个TEXTBOX赋值原因
热门文章
- WebLogic中";域";的概念
- CEF3研究(三)
- 从日志文件解决ArcGIS Server性能低下问题的步骤(1)
- request.getAttribute()与request.setAttribute()
- FancyCoverFlow
- 关于axis2.1.6与websphere7的包冲突问题的解决方式
- What are some advantages of using Node.js over a Flask API?
- bzoj2461: [BeiJing2011]符环
- python库学习笔记——BeautifulSoup处理子标签、后代标签、兄弟标签和父标签
- BZOJ_1532_[POI2005]Kos-Dicing_二分+网络流