标签:
<insert id="xxx" parameterType="yyy" useGeneratedKeys="true" keyProperty="id">
....
</insert>
<insert id="xxx" parameterType="yyy">
<selectKey keyProperty="id" resultType="long" order="BEFORE">
select my_seq.nextval from dual
</selectKey>
....
</insert>
<insert id="xxx" parameterType="yyy" useGeneratedKeys="true">
insert into table(...) values (...)
<selectKey resultType="long" order="AFTER" keyProperty="id">
SELECT LAST_INSERT_ID() AS id
</selectKey>
</insert>
mybatis 做 insert操作的时候返回插入的那条数据的id
标签:
原文地址:http://www.cnblogs.com/yanduanduan/p/5159435.html