<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.energy.manage.service.mappers.units.UnitGearboxBearingsMapper">


    <!-- 批量更新语句 -->
    <update id="batchUpdate" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
            UPDATE unit_gearbox_bearings
            <set>
                <if test="item.gearboxCode != null">gearbox_code = #{item.gearboxCode},</if><if test="item.gearboxCode == null">gearbox_code = null,</if>
                <if test="item.parallelWheelGrade != null">parallel_wheel_grade = #{item.parallelWheelGrade},</if><if test="item.parallelWheelGrade == null">parallel_wheel_grade = null,</if>
                <if test="item.gearboxBearingNumber != null">gearbox_bearing_number = #{item.gearboxBearingNumber},</if><if test="item.gearboxBearingNumber == null">gearbox_bearing_number = null,</if>
                <if test="item.gearboxBearingLevel != null">gearbox_bearing_level = #{item.gearboxBearingLevel},</if><if test="item.gearboxBearingLevel == null">gearbox_bearing_level = null,</if>
                <if test="item.bearingBrand != null">bearing_brand = #{item.bearingBrand},</if><if test="item.bearingBrand == null">bearing_brand = null,</if>
                <if test="item.bearingModel != null">bearing_model = #{item.bearingModel},</if><if test="item.bearingModel == null">bearing_model = null,</if>
                <if test="item.gearRingTeethCount != null">gear_ring_teeth_count = #{item.gearRingTeethCount},</if><if test="item.gearRingTeethCount == null">gear_ring_teeth_count = null,</if>
                <if test="item.bearingRsBrand != null">bearing_rs_brand = #{item.bearingRsBrand},</if><if test="item.bearingRsBrand == null">bearing_rs_brand = null,</if>
                <if test="item.bearingRsModel != null">bearing_rs_model = #{item.bearingRsModel},</if><if test="item.bearingRsModel == null">bearing_rs_model = null,</if>
                <if test="item.bearingGsBrand != null">bearing_gs_brand = #{item.bearingGsBrand},</if><if test="item.bearingGsBrand == null">bearing_gs_brand = null,</if>
                <if test="item.bearingGsModel != null">bearing_gs_model = #{item.bearingGsModel},</if><if test="item.bearingGsModel == null">bearing_gs_model = null,</if>
                <if test="item.updateBy != null">update_by = #{item.updateBy},</if><if test="item.updateBy == null">update_by = null,</if>
                <if test="item.updateTime != null">update_time = #{item.updateTime}</if><if test="item.updateTime == null">update_time = null}</if>
            </set>
            WHERE id = #{item.id}
        </foreach>
    </update>


</mapper>
