Oracle
<
insert
id
=
"save"
parameterType
=
"com.threeti.to.ZoneTO"
>
<
selectKey
resultType
=
"java.lang.Long"
keyProperty
=
"id"
order
=
"AFTER"
>
SELECT SEQ_ZONE.CURRVAL AS id from dual
</
selectKey
>
insert into TBL_ZONE (ID, NAME
)
values (SEQ_ZONE.NEXTVAL, #{name,jdbcType=VARCHAR}
)
</
insert
>
<insert id="insertAndGetId" useGeneratedKeys="true" keyProperty="userId" parameterType="com.chenzhou.mybatis.User">
insert into user(userName,password,comment)
values(#{userName},#{password},#{comment})
</insert>