导航

mybatis oracle insert 返回新增的主键值

Posted on 2016-10-14 13:38  _eve  阅读(578)  评论(0编辑  收藏  举报

<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>