1. <update id="updateBatch" parameterType="java.util.List" >
    2. <foreach collection="list" item="item" index="index" open="" close="" separator=";">
    3. update standard_relation
    4. <set >
    5. <if test="item.standardFromUuid != null" >
    6. standard_from_uuid = #{item.standardFromUuid,jdbcType=VARCHAR},
    7. </if>
    8. <if test="item.standardToUuid != null" >
    9. standard_to_uuid = #{item.standardToUuid,jdbcType=VARCHAR},
    10. </if>
    11. <if test="item.gmtModified != null" >
    12. gmt_modified = #{item.gmtModified,jdbcType=TIMESTAMP},
    13. </if>
    14. </set>
    15. where id = #{item.id,jdbcType=BIGINT}
    16. </foreach>
    17. </update>

    参考: https://blog.csdn.net/q957967519/article/details/88669552