1:多条件
<update id="updateBatch" parameterType="java.util.List">
update corp_tag
<trim prefix="set" suffixOverrides=",">
<trim prefix="TRANS_AMOUNT =case" suffix="end,">
<foreach collection="list" item="item" index="index">
when CORP_ID= #{item.corpId} and TAG_ID = #{item.tagId} then #{item.transAmount}
</foreach>
</trim>
</trim>
<where>
<foreach collection="list" item="item" open="( " separator=") or (" close=" )">
CORP_ID= #{item.corpId} and TAG_ID = #{item.tagId}
</foreach>
</where>
</update>
2:单条件
<update id="updateBatch" parameterType="java.util.List">
update corp_tag
<trim prefix="set" suffixOverrides=",">
<trim prefix="APPLY_PAY_STATUS =case" suffix="end,">
<foreach collection="applyPayBeanList" item="applyPayBean">
<if test="applyPayBean.applyPayStatus != null and applyPayBean.applyPayStatus != ''">
when APPLY_PAY_NO = #{applyPayBean.applyPayNo}
then #{applyPayBean.applyPayStatus}
</if>
</foreach>
</trim>
<trim prefix="FINANCE_PAY_NO =case" suffix="end,">
<foreach collection="applyPayBeanList" item="applyPayBean">
<if test="applyPayBean.financePayNo != null and applyPayBean.financePayNo != ''">
when APPLY_PAY_NO = #{applyPayBean.applyPayNo}
then #{applyPayBean.financePayNo}
</if>
</foreach>
</trim>
</trim>
<where>
APPLY_PAY_NO in
<foreach collection="applyPayBeanList" item="applyPayBean" index="index" open="(" separator="," close=")">
#{applyPayBean.applyPayNo}
</foreach>
</where>
</update>