首页 > 代码库 > mybatis oracle insert 返回新增的主键值

mybatis oracle insert 返回新增的主键值

<insert id="insertVmsTemplatePlayItem" parameterType="VmsTemplatePlayItem">
<selectKey resultType="java.lang.Integer" order="BEFORE" keyProperty="playitemId">
SELECT PLAYITEM_SEQ.NEXTVAL FROM DUAL
</selectKey>
insert into VMS_TEMPLATE_PLAYITEM
(PLAYITEM_ID,DELAY,ACTION,CREATE_BY,CREATE_TIME,ZONE_ID,VMS_TYPE,INFOXML,INFO_TYPE,MODIFY_PROJECT,MODIFY_IP)
values
(#{playitemId,jdbcType=NUMERIC},#{delay,jdbcType=NUMERIC},#{action,jdbcType=NUMERIC},
#{createBy,jdbcType=VARCHAR},to_date(#{createTime,jdbcType=VARCHAR},‘yyyy-MM-dd hh24:Mi:ss‘),
#{zoneId,jdbcType=VARCHAR},#{vmsType,jdbcType=VARCHAR},#{infoxml,jdbcType=VARCHAR},
#{infoType,jdbcType=VARCHAR},#{modifyProject,jdbcType=VARCHAR},#{modifyIp,jdbcType=VARCHAR})
</insert>

mybatis oracle insert 返回新增的主键值