Mybatis动态批量更新
<update id="update" parameterType="java.util.List">
<foreach collection="points" item="item" index="index" separator=";">
update data_trend_point
<set>
<if test="item.dataTrendId != null">
data_trend_id = #{item.dataTrendId,jdbcType=BIGINT},
</if>
<if test="item.edgeProductId != null">
edge_product_id = #{item.edgeProductId,jdbcType=BIGINT},
</if>
<if test="item.deviceId != null">
device_id = #{item.deviceId,jdbcType=BIGINT},
</if>
<if test="item.measuringPointId != null">
measuring_point_id = #{item.measuringPointId,jdbcType=VARCHAR},
</if>
<if test="item.createBy != null">
create_by = #{item.createBy,jdbcType=BIGINT},
</if>
<if test="item.createTime != null">
create_time = #{item.createTime,jdbcType=DATE},
</if>
<if test="item.updateBy != null">
update_by = #{item.updateBy,jdbcType=BIGINT},
</if>
<if test="item.updateTime != null">
update_time = #{item.updateTime,jdbcType=DATE},
</if>
</set>
where data_trend_point_id = #{item.dataTrendPointId,jdbcType=BIGINT}
</foreach>
</update>