UnitGearBoxBearingsMapper.xml 2.7 KB

123456789101112131415161718192021222324252627282930
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.energy.manage.service.mappers.units.UnitGearboxBearingsMapper">
  4. <!-- 批量更新语句 -->
  5. <update id="batchUpdate" parameterType="java.util.List">
  6. <foreach collection="list" item="item" index="index" separator=";">
  7. UPDATE unit_gearbox_bearings
  8. <set>
  9. <if test="item.gearboxCode != null">gearbox_code = #{item.gearboxCode},</if><if test="item.gearboxCode == null">gearbox_code = null,</if>
  10. <if test="item.parallelWheelGrade != null">parallel_wheel_grade = #{item.parallelWheelGrade},</if><if test="item.parallelWheelGrade == null">parallel_wheel_grade = null,</if>
  11. <if test="item.gearboxBearingNumber != null">gearbox_bearing_number = #{item.gearboxBearingNumber},</if><if test="item.gearboxBearingNumber == null">gearbox_bearing_number = null,</if>
  12. <if test="item.gearboxBearingLevel != null">gearbox_bearing_level = #{item.gearboxBearingLevel},</if><if test="item.gearboxBearingLevel == null">gearbox_bearing_level = null,</if>
  13. <if test="item.bearingBrand != null">bearing_brand = #{item.bearingBrand},</if><if test="item.bearingBrand == null">bearing_brand = null,</if>
  14. <if test="item.bearingModel != null">bearing_model = #{item.bearingModel},</if><if test="item.bearingModel == null">bearing_model = null,</if>
  15. <if test="item.gearRingTeethCount != null">gear_ring_teeth_count = #{item.gearRingTeethCount},</if><if test="item.gearRingTeethCount == null">gear_ring_teeth_count = null,</if>
  16. <if test="item.bearingRsBrand != null">bearing_rs_brand = #{item.bearingRsBrand},</if><if test="item.bearingRsBrand == null">bearing_rs_brand = null,</if>
  17. <if test="item.bearingRsModel != null">bearing_rs_model = #{item.bearingRsModel},</if><if test="item.bearingRsModel == null">bearing_rs_model = null,</if>
  18. <if test="item.bearingGsBrand != null">bearing_gs_brand = #{item.bearingGsBrand},</if><if test="item.bearingGsBrand == null">bearing_gs_brand = null,</if>
  19. <if test="item.bearingGsModel != null">bearing_gs_model = #{item.bearingGsModel},</if><if test="item.bearingGsModel == null">bearing_gs_model = null,</if>
  20. <if test="item.updateBy != null">update_by = #{item.updateBy},</if><if test="item.updateBy == null">update_by = null,</if>
  21. <if test="item.updateTime != null">update_time = #{item.updateTime}</if><if test="item.updateTime == null">update_time = null}</if>
  22. </set>
  23. WHERE id = #{item.id}
  24. </foreach>
  25. </update>
  26. </mapper>