1. BULK INSERT
<insert id= "insertconfirm" parametertype= "Java.util.List" >
Insert INTO ' TableName ' (ID) values
<foreach collection = "List" item= "item" index= "index" separator = "," >
(' ${item.id} ')
</foreach >
</insert>
2. Batch Update
<update id= "updateconfirm" parametertype= "Java.util.List" >
Update ' TableName '
<trim prefix= "Set" suffixoverrides= "," >
<trim prefix= "Bgt_stage =case" suffix= "End," >
<foreach collection= "list" item= "I" index= "index" >
<if test= "I.bgtstage!=null" >
When tasktypeid= ' ${i.tasktypeid} ' and depcode= ' ${i.depcode} ' then
' ${i.bgtstage} '
</if>
</foreach>
else Bgt_stage
</trim>
<trim prefix= "Confirmtime =case" suffix= "End," >
<foreach collection= "list" item= "I" index= "index" >
<if test= "I.confirmtime!=null" >
When tasktypeid= ' ${i.tasktypeid} ' and depcode= ' ${i.depcode} ' then
' ${i.confirmtime} '
</if>
</foreach>
else Confirmtime
</trim>
</trim>
</update>
Trim Property
Prefix: Prefixes overwrite and increase their contents
Suffix: suffixes overwrite and increase their contents
Prefixoverrides: Criteria for judging prefixes
Suffixoverrides: The condition of the suffix judgment
Mapper MYSL implementing BULK INSERT Updates