方法一:

insert id="insert" parameterType="Person" useGeneratedKeys="true" keyProperty="id">
insert into person(name,pswd) values(#{name},#{pswd})
</insert> 

方法二:

<insert id="insert" parameterType="Person">
<selectKey keyProperty="id" resultType="long">
select LAST_INSERT_ID()
</selectKey>
insert into person(name,pswd) values(#{name},#{pswd})
</insert>

最新文章

  1. Tornado学习笔记12 tornado.httpserver-.非阻塞的Http服务器
  2. C# Susan边缘检测(Susan Edge Detection)
  3. Linux_vi编辑器
  4. Memcached 笔记与总结(9)Memcached 与 Session
  5. D3.js 让图表动起来
  6. struts2内Action方法调用
  7. C# 自定义事件
  8. 菜鸟学Java(十九)——WEB项目測试好帮手,Maven+Jetty
  9. 【转】Android官方下拉刷新控件 SwipeRefreshLayout
  10. c# 强制退出程序
  11. maven 阿里云仓库配置
  12. DAY11-Java中的类--接上篇
  13. bzoj2131 免费的馅饼——树状数组优化dp
  14. (网页)jquery-qrcode.js生成二维码
  15. POJ 2823 Sliding Window (单调队列)
  16. 使用java操作kudu
  17. 洛谷 P2596 [ZJOI2006]书架 解题报告
  18. Spring学习笔记--Spring配置文件和依赖注入
  19. zgrep用法
  20. CSS常用样式属性

热门文章

  1. 【python】入门指南1
  2. Q in Q
  3. js常用的数组,,字符串,,Math..正则方法
  4. Jedis cluster命令执行流程剖析
  5. nginx安装扩展 sub_filter&amp;http_ssl_module
  6. 7-OKHttp使用详解,步骤挺详细的,适合初学者使用!
  7. mysql5.7 新增的json字段类型
  8. easyrules
  9. Git 安装和使用教程(更加详细)
  10. 对于读txt文件一点总结