#xml具体实现代码
提示:向xml中传入list,在数据库配置文件中配置参数allowMultiQueries=true
代码如下(示例):
<update id="updatezzz" parameterType="java.util.List">
<foreach collection="list" item="item" separator=";" index="index">
update zzz
<set>
<if test="item.status!=null and item.status!=''">
STATUS = #{item.status},
</if>
<if test="item.comment!=null and item.comment!=''">
COMMENT = #{item.comment},
</if>
</set>
where xx = #{item.xx} and xx = #{item.xx}
</foreach>
</update>