情况1
<update id="" parameterType=""> update tb_thread set isDelete=0 where threadId in ( <foreach collection="list" item="item" index="index" open="" close="" separator=","> #{item.threadId} </foreach> ) </update>
情况2
数据源后加:&allowMultiQueries=true
<update id="updateJdzClassifyDataGroupId" parameterType="com.macro.mall.project.classify.domain.JdzClassifyData"> <foreach collection="list" item="item" index="index"> update jdz_classify_data set group_id=#{item.groupId} where id=#{item.id}; </foreach> </update>