直接贴代码
<update id="updateActivityExchangeByIds" parameterType="TDeptActivityExchange">
update t_dept_activity_exchange
<trim prefix="set" suffixOverrides=",">
<trim prefix="EXCHANGE_DEADLINE =case" suffix="end,">
<foreach collection="activityExchanges" item="item" index="index">
<if test="item.exchangeDeadline!=null">
when ID=#{item.id} then #{item.exchangeDeadline}
</if>
</foreach>
</trim>
<trim prefix=" UPDATE_BY =case" suffix="end,">
<foreach collection="activityExchanges" item="item" index="index">
<if test="item.updateBy!=null">
when ID=#{item.id} then #{item.updateBy}
</if>
</foreach>
</trim>
<trim prefix="UPDATE_TIME =case" suffix="end," >
<foreach collection="activityExchanges" item="item" index="index">
<if test="item.updateTime!=null">
when ID=#{item.id} then #{item.updateTime}
</if>
</foreach>
</trim>
</trim>
where DELETE_FLG = 0 AND
<foreach collection="activityExchanges" separator="or" item="item" index="index" >
ID=#{item.id}
</foreach>
</update>