<insert id="addMetadataField" parameterType="List"
useGeneratedKeys="false">
INSERT INTO XXX(ID,NAME, FIELD,
ISUNIQUE, DICNAME,
DEFAULTVALUE, LENGTH, NULLABLE,
METADATAID,FIELDTYPE,NECESSARY)
SELECT SEQ_ARC_METADATA_FIELD.NEXTVAL, m.name,m.field,m.isUnique,m.dicName
,m.defaultValue,m.length,m.nullable,m.metadataId,m.fieldType,m.necessary FROM(
<foreach collection="list" item="item" separator="union all">
select
#{item.name} name,#{item.field} field,
<if test="item.isUnique==true">
1 isUnique,
</if>
<if test="item.isUnique==false">
0 isUnique,
</if>
#{item.dicName} dicName,#{item.defaultValue} defaultvALUE,#{item.length} length,
<if test="item.nullable==true">
1 nullable,
</if>
<if test="item.nullable==false">
0 nullable,
</if>
#{item.metadataId} metadataId,
#{item.fieldType} fieldType,
#{item.necessary} necessary
from dual
</foreach>
)m
</insert>
MyBatis向Orcale批量添加数据(带序列)
最新推荐文章于 2024-03-29 10:53:53 发布