- MyBatis+Oracle+Sequence批量插入
<insert id="batchInsertInpNurseInOutVolume" useGeneratedKeys="true" parameterType="java.util.List">
<selectKey resultType="long" keyProperty="id" order="BEFORE">
SELECT
BHIS.SEQ_INP_NURSE_IN_OUT_VOLUME.NEXTVAL
FROM
DUAL
</selectKey>
insert into BHIS.INP_NURSE_IN_OUT_VOLUME
(
NURSE_VOLUME_ID,
NURSE_RECORD_ID,
TYPE,
VOLUME_NAME,
VOLUME_MEASURE,
COLOUR_CHARACTER,
CREATED_BY,
CREATED_DATE,
REMARK,
STATUS
) SELECT BHIS.SEQ_INP_NURSE_IN_OUT_VOLUME.NEXTVAL, DETAIL.* FROM (
<foreach collection="list" item="item" index="index" separator="UNION ALL" >
SELECT
#{item.nurseRecordId, jdbcType=DECIMAL},
#{item.type, jdbcType=VARCHAR},
#{item.volumeName, jdbcType=DECIMAL},
#{item.volumeMeasure, jdbcType=VARCHAR},
#{item.colourCharacter, jdbcType=VARCHAR},
#{item.createdBy, jdbcType=DECIMAL},
#{item.createdDate, jdbcType=TIMESTAMP},
#{item.remark, jdbcType=TIMESTAMP},
#{item.status, jdbcType=DECIMAL}
FROM
DUAL
</foreach>
) DETAIL
</insert>