<?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.steerinfo.meterwork.meterworkmalfunctionalarm.mapper.MeterWorkMalfunctionAlarmMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.meterwork.meterworkmalfunctionalarm.model.MeterWorkMalfunctionAlarm">
    <id column="ERROR_ALARM_ID" jdbcType="VARCHAR" property="errorAlarmId" />
    <result column="SPOT_TYPE_NO" jdbcType="VARCHAR" property="spotTypeNo" />
    <result column="SPOT_TYPE_NAME" jdbcType="VARCHAR" property="spotTypeName" />
    <result column="ALARM_TYPE_NO" jdbcType="VARCHAR" property="alarmTypeNo" />
    <result column="ALARM_TYPE_NAME" jdbcType="VARCHAR" property="alarmTypeName" />
    <result column="CAR_NO" jdbcType="VARCHAR" property="carNo" />
    <result column="PREDICTION_NO" jdbcType="VARCHAR" property="predictionNo" />
    <result column="MALFUNCTION_DETAIL" jdbcType="VARCHAR" property="malfunctionDetail" />
    <result column="MALFUNCTION_TIME" jdbcType="TIMESTAMP" property="malfunctionTime" />
    <result column="CREATE_MAN_NO" jdbcType="VARCHAR" property="createManNo" />
    <result column="CREATE_MAN_NAME" jdbcType="VARCHAR" property="createManName" />
    <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
    <result column="UPDATE_MAN_NO" jdbcType="VARCHAR" property="updateManNo" />
    <result column="UPDATE_MAN_NAME" jdbcType="VARCHAR" property="updateManName" />
    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="MEMO" jdbcType="VARCHAR" property="memo" />
    <result column="PROCESS_RESULT" jdbcType="VARCHAR" property="processResult" />
  </resultMap>
  <sql id="columns">
    ERROR_ALARM_ID, SPOT_TYPE_NO, SPOT_TYPE_NAME, ALARM_TYPE_NO, ALARM_TYPE_NAME, CAR_NO, 
    PREDICTION_NO, MALFUNCTION_DETAIL, MALFUNCTION_TIME, CREATE_MAN_NO, CREATE_MAN_NAME, 
    CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, MEMO, PROCESS_RESULT
  </sql>
  <sql id="columns_alias">
    t.ERROR_ALARM_ID, t.SPOT_TYPE_NO, t.SPOT_TYPE_NAME, t.ALARM_TYPE_NO, t.ALARM_TYPE_NAME, 
    t.CAR_NO, t.PREDICTION_NO, t.MALFUNCTION_DETAIL, t.MALFUNCTION_TIME, t.CREATE_MAN_NO, 
    t.CREATE_MAN_NAME, t.CREATE_TIME, t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, t.UPDATE_TIME, 
    t.MEMO, t.PROCESS_RESULT
  </sql>
  <sql id="select">
    SELECT <include refid="columns"/> FROM METER_WORK_MALFUNCTION_ALARM
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias"/> FROM METER_WORK_MALFUNCTION_ALARM t
  </sql>
  <sql id="where">
    <where> 
      <if test="errorAlarmId != null and errorAlarmId != ''">
        and ERROR_ALARM_ID = #{errorAlarmId}
      </if>
      <if test="spotTypeNo != null and spotTypeNo != ''">
        and SPOT_TYPE_NO = #{spotTypeNo}
      </if>
      <if test="spotTypeName != null and spotTypeName != ''">
        and SPOT_TYPE_NAME = #{spotTypeName}
      </if>
      <if test="alarmTypeNo != null and alarmTypeNo != ''">
        and ALARM_TYPE_NO = #{alarmTypeNo}
      </if>
      <if test="alarmTypeName != null and alarmTypeName != ''">
        and ALARM_TYPE_NAME = #{alarmTypeName}
      </if>
      <if test="carNo != null and carNo != ''">
        and CAR_NO = #{carNo}
      </if>
      <if test="predictionNo != null and predictionNo != ''">
        and PREDICTION_NO = #{predictionNo}
      </if>
      <if test="malfunctionDetail != null and malfunctionDetail != ''">
        and MALFUNCTION_DETAIL = #{malfunctionDetail}
      </if>
      <if test="malfunctionTime != null">
        and TO_CHAR(MALFUNCTION_TIME,'yyyy-MM-dd') = #{malfunctionTime}
      </if>
      <if test="createManNo != null and createManNo != ''">
        and CREATE_MAN_NO = #{createManNo}
      </if>
      <if test="createManName != null and createManName != ''">
        and CREATE_MAN_NAME = #{createManName}
      </if>
      <if test="createTime != null">
        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
      </if>
      <if test="updateManNo != null and updateManNo != ''">
        and UPDATE_MAN_NO = #{updateManNo}
      </if>
      <if test="updateManName != null and updateManName != ''">
        and UPDATE_MAN_NAME = #{updateManName}
      </if>
      <if test="updateTime != null">
        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
      </if>
      <if test="memo != null and memo != ''">
        and MEMO = #{memo}
      </if>
      <if test="processResult != null and processResult != ''">
        and PROCESS_RESULT = #{processResult}
      </if>
    </where>
  </sql>
  <sql id="whereLike">
    <where> 
      <if test="errorAlarmId != null and errorAlarmId != ''">
        and ERROR_ALARM_ID LIKE '%${errorAlarmId}%'
      </if>
      <if test="spotTypeNo != null and spotTypeNo != ''">
        and SPOT_TYPE_NO LIKE '%${spotTypeNo}%'
      </if>
      <if test="spotTypeName != null and spotTypeName != ''">
        and SPOT_TYPE_NAME LIKE '%${spotTypeName}%'
      </if>
      <if test="alarmTypeNo != null and alarmTypeNo != ''">
        and ALARM_TYPE_NO LIKE '%${alarmTypeNo}%'
      </if>
      <if test="alarmTypeName != null and alarmTypeName != ''">
        and ALARM_TYPE_NAME LIKE '%${alarmTypeName}%'
      </if>
      <if test="carNo != null and carNo != ''">
        and CAR_NO LIKE '%${carNo}%'
      </if>
      <if test="predictionNo != null and predictionNo != ''">
        and PREDICTION_NO LIKE '%${predictionNo}%'
      </if>
      <if test="malfunctionDetail != null and malfunctionDetail != ''">
        and MALFUNCTION_DETAIL LIKE '%${malfunctionDetail}%'
      </if>
      <if test="malfunctionTime != null">
        and TO_CHAR(MALFUNCTION_TIME,'yyyy-MM-dd') = #{malfunctionTime}
      </if>
      <if test="createManNo != null and createManNo != ''">
        and CREATE_MAN_NO LIKE '%${createManNo}%'
      </if>
      <if test="createManName != null and createManName != ''">
        and CREATE_MAN_NAME LIKE '%${createManName}%'
      </if>
      <if test="createTime != null">
        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
      </if>
      <if test="updateManNo != null and updateManNo != ''">
        and UPDATE_MAN_NO LIKE '%${updateManNo}%'
      </if>
      <if test="updateManName != null and updateManName != ''">
        and UPDATE_MAN_NAME LIKE '%${updateManName}%'
      </if>
      <if test="updateTime != null">
        and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
      </if>
      <if test="memo != null and memo != ''">
        and MEMO LIKE '%${memo}%'
      </if>
      <if test="processResult != null and processResult != ''">
        and PROCESS_RESULT LIKE '%${processResult}%'
      </if>
    </where>
  </sql>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from METER_WORK_MALFUNCTION_ALARM
    where ERROR_ALARM_ID = #{errorAlarmId,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from METER_WORK_MALFUNCTION_ALARM
    where 1!=1 
      <if test="spotTypeNo != null and spotTypeNo != ''">
        or SPOT_TYPE_NO = #{spotTypeNo}
      </if>
      <if test="spotTypeName != null and spotTypeName != ''">
        or SPOT_TYPE_NAME = #{spotTypeName}
      </if>
      <if test="alarmTypeNo != null and alarmTypeNo != ''">
        or ALARM_TYPE_NO = #{alarmTypeNo}
      </if>
      <if test="alarmTypeName != null and alarmTypeName != ''">
        or ALARM_TYPE_NAME = #{alarmTypeName}
      </if>
      <if test="carNo != null and carNo != ''">
        or CAR_NO = #{carNo}
      </if>
      <if test="predictionNo != null and predictionNo != ''">
        or PREDICTION_NO = #{predictionNo}
      </if>
      <if test="malfunctionDetail != null and malfunctionDetail != ''">
        or MALFUNCTION_DETAIL = #{malfunctionDetail}
      </if>
      <if test="malfunctionTime != null">
        or TO_CHAR(MALFUNCTION_TIME,'yyyy-MM-dd') = '#{malfunctionTime}'
      </if>
      <if test="createManNo != null and createManNo != ''">
        or CREATE_MAN_NO = #{createManNo}
      </if>
      <if test="createManName != null and createManName != ''">
        or CREATE_MAN_NAME = #{createManName}
      </if>
      <if test="createTime != null">
        or TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = '#{createTime}'
      </if>
      <if test="updateManNo != null and updateManNo != ''">
        or UPDATE_MAN_NO = #{updateManNo}
      </if>
      <if test="updateManName != null and updateManName != ''">
        or UPDATE_MAN_NAME = #{updateManName}
      </if>
      <if test="updateTime != null">
        or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
      </if>
      <if test="memo != null and memo != ''">
        or MEMO = #{memo}
      </if>
      <if test="processResult != null and processResult != ''">
        or PROCESS_RESULT = #{processResult}
      </if>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.meterwork.meterworkmalfunctionalarm.model.MeterWorkMalfunctionAlarm">
    insert into METER_WORK_MALFUNCTION_ALARM (ERROR_ALARM_ID, SPOT_TYPE_NO, SPOT_TYPE_NAME, 
      ALARM_TYPE_NO, ALARM_TYPE_NAME, CAR_NO, 
      PREDICTION_NO, MALFUNCTION_DETAIL, MALFUNCTION_TIME, 
      CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
      UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, 
      MEMO, PROCESS_RESULT)
    values (#{errorAlarmId,jdbcType=VARCHAR}, #{spotTypeNo,jdbcType=VARCHAR}, #{spotTypeName,jdbcType=VARCHAR}, 
      #{alarmTypeNo,jdbcType=VARCHAR}, #{alarmTypeName,jdbcType=VARCHAR}, #{carNo,jdbcType=VARCHAR}, 
      #{predictionNo,jdbcType=VARCHAR}, #{malfunctionDetail,jdbcType=VARCHAR}, #{malfunctionTime,jdbcType=TIMESTAMP}, 
      #{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{updateManNo,jdbcType=VARCHAR}, #{updateManName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
      #{memo,jdbcType=VARCHAR}, #{processResult,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.meterwork.meterworkmalfunctionalarm.model.MeterWorkMalfunctionAlarm">
    insert into METER_WORK_MALFUNCTION_ALARM
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="errorAlarmId != null">
        ERROR_ALARM_ID,
      </if>
      <if test="spotTypeNo != null">
        SPOT_TYPE_NO,
      </if>
      <if test="spotTypeName != null">
        SPOT_TYPE_NAME,
      </if>
      <if test="alarmTypeNo != null">
        ALARM_TYPE_NO,
      </if>
      <if test="alarmTypeName != null">
        ALARM_TYPE_NAME,
      </if>
      <if test="carNo != null">
        CAR_NO,
      </if>
      <if test="predictionNo != null">
        PREDICTION_NO,
      </if>
      <if test="malfunctionDetail != null">
        MALFUNCTION_DETAIL,
      </if>
      <if test="malfunctionTime != null">
        MALFUNCTION_TIME,
      </if>
      <if test="createManNo != null">
        CREATE_MAN_NO,
      </if>
      <if test="createManName != null">
        CREATE_MAN_NAME,
      </if>
      <if test="createTime != null">
        CREATE_TIME,
      </if>
      <if test="updateManNo != null">
        UPDATE_MAN_NO,
      </if>
      <if test="updateManName != null">
        UPDATE_MAN_NAME,
      </if>
      <if test="updateTime != null">
        UPDATE_TIME,
      </if>
      <if test="memo != null">
        MEMO,
      </if>
      <if test="processResult != null">
        PROCESS_RESULT,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="errorAlarmId != null">
        #{errorAlarmId,jdbcType=VARCHAR},
      </if>
      <if test="spotTypeNo != null">
        #{spotTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="spotTypeName != null">
        #{spotTypeName,jdbcType=VARCHAR},
      </if>
      <if test="alarmTypeNo != null">
        #{alarmTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="alarmTypeName != null">
        #{alarmTypeName,jdbcType=VARCHAR},
      </if>
      <if test="carNo != null">
        #{carNo,jdbcType=VARCHAR},
      </if>
      <if test="predictionNo != null">
        #{predictionNo,jdbcType=VARCHAR},
      </if>
      <if test="malfunctionDetail != null">
        #{malfunctionDetail,jdbcType=VARCHAR},
      </if>
      <if test="malfunctionTime != null">
        #{malfunctionTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createManNo != null">
        #{createManNo,jdbcType=VARCHAR},
      </if>
      <if test="createManName != null">
        #{createManName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateManNo != null">
        #{updateManNo,jdbcType=VARCHAR},
      </if>
      <if test="updateManName != null">
        #{updateManName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="memo != null">
        #{memo,jdbcType=VARCHAR},
      </if>
      <if test="processResult != null">
        #{processResult,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.meterwork.meterworkmalfunctionalarm.model.MeterWorkMalfunctionAlarm">
    update METER_WORK_MALFUNCTION_ALARM
    set SPOT_TYPE_NO = #{spotTypeNo,jdbcType=VARCHAR},
      SPOT_TYPE_NAME = #{spotTypeName,jdbcType=VARCHAR},
      ALARM_TYPE_NO = #{alarmTypeNo,jdbcType=VARCHAR},
      ALARM_TYPE_NAME = #{alarmTypeName,jdbcType=VARCHAR},
      CAR_NO = #{carNo,jdbcType=VARCHAR},
      PREDICTION_NO = #{predictionNo,jdbcType=VARCHAR},
      MALFUNCTION_DETAIL = #{malfunctionDetail,jdbcType=VARCHAR},
      MALFUNCTION_TIME = #{malfunctionTime,jdbcType=TIMESTAMP},
      CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
      CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
      UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      MEMO = #{memo,jdbcType=VARCHAR},
      PROCESS_RESULT = #{processResult,jdbcType=VARCHAR}
    where ERROR_ALARM_ID = #{errorAlarmId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.meterwork.meterworkmalfunctionalarm.model.MeterWorkMalfunctionAlarm">
    update METER_WORK_MALFUNCTION_ALARM
    <set>
      <if test="spotTypeNo != null">
        SPOT_TYPE_NO = #{spotTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="spotTypeName != null">
        SPOT_TYPE_NAME = #{spotTypeName,jdbcType=VARCHAR},
      </if>
      <if test="alarmTypeNo != null">
        ALARM_TYPE_NO = #{alarmTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="alarmTypeName != null">
        ALARM_TYPE_NAME = #{alarmTypeName,jdbcType=VARCHAR},
      </if>
      <if test="carNo != null">
        CAR_NO = #{carNo,jdbcType=VARCHAR},
      </if>
      <if test="predictionNo != null">
        PREDICTION_NO = #{predictionNo,jdbcType=VARCHAR},
      </if>
      <if test="malfunctionDetail != null">
        MALFUNCTION_DETAIL = #{malfunctionDetail,jdbcType=VARCHAR},
      </if>
      <if test="malfunctionTime != null">
        MALFUNCTION_TIME = #{malfunctionTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createManNo != null">
        CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
      </if>
      <if test="createManName != null">
        CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateManNo != null">
        UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
      </if>
      <if test="updateManName != null">
        UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="memo != null">
        MEMO = #{memo,jdbcType=VARCHAR},
      </if>
      <if test="processResult != null">
        PROCESS_RESULT = #{processResult,jdbcType=VARCHAR},
      </if>
    </set>
    where ERROR_ALARM_ID = #{errorAlarmId,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <include refid="select"/>
    where ERROR_ALARM_ID = #{errorAlarmId,jdbcType=VARCHAR}
  </select>
  <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
    <include refid="where"/>
  </select>
  <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
    <include refid="select"/>
    <include refid="whereLike"/>
  </select>
  <insert id="batchInsert" parameterType="java.util.List">
    insert into METER_WORK_MALFUNCTION_ALARM 
      (ERROR_ALARM_ID, 
      SPOT_TYPE_NO, SPOT_TYPE_NAME, ALARM_TYPE_NO, 
      ALARM_TYPE_NAME, CAR_NO, PREDICTION_NO, 
      MALFUNCTION_DETAIL, MALFUNCTION_TIME, 
      CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
      UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, 
      MEMO, PROCESS_RESULT)
    ( <foreach collection="list" item="item" separator="union all"> 
   select  
      #{item.errorAlarmId,jdbcType=VARCHAR}, 
      #{item.spotTypeNo,jdbcType=VARCHAR}, #{item.spotTypeName,jdbcType=VARCHAR}, #{item.alarmTypeNo,jdbcType=VARCHAR}, 
      #{item.alarmTypeName,jdbcType=VARCHAR}, #{item.carNo,jdbcType=VARCHAR}, #{item.predictionNo,jdbcType=VARCHAR}, 
      #{item.malfunctionDetail,jdbcType=VARCHAR}, #{item.malfunctionTime,jdbcType=TIMESTAMP}, 
      #{item.createManNo,jdbcType=VARCHAR}, #{item.createManName,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, 
      #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, 
      #{item.memo,jdbcType=VARCHAR}, #{item.processResult,jdbcType=VARCHAR} from dual  
   </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
     update METER_WORK_MALFUNCTION_ALARM
     set
       ERROR_ALARM_ID=
       <foreach collection="list" item="item" index="index" separator=" " open="case ERROR_ALARM_ID" close="end">
          when #{item.errorAlarmId,jdbcType=VARCHAR} then #{item.errorAlarmId,jdbcType=VARCHAR}
       </foreach>
       ,SPOT_TYPE_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case ERROR_ALARM_ID" close="end">
          when #{item.errorAlarmId,jdbcType=VARCHAR} then #{item.spotTypeNo,jdbcType=VARCHAR}
       </foreach>
       ,SPOT_TYPE_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ERROR_ALARM_ID" close="end">
          when #{item.errorAlarmId,jdbcType=VARCHAR} then #{item.spotTypeName,jdbcType=VARCHAR}
       </foreach>
       ,ALARM_TYPE_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case ERROR_ALARM_ID" close="end">
          when #{item.errorAlarmId,jdbcType=VARCHAR} then #{item.alarmTypeNo,jdbcType=VARCHAR}
       </foreach>
       ,ALARM_TYPE_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ERROR_ALARM_ID" close="end">
          when #{item.errorAlarmId,jdbcType=VARCHAR} then #{item.alarmTypeName,jdbcType=VARCHAR}
       </foreach>
       ,CAR_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case ERROR_ALARM_ID" close="end">
          when #{item.errorAlarmId,jdbcType=VARCHAR} then #{item.carNo,jdbcType=VARCHAR}
       </foreach>
       ,PREDICTION_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case ERROR_ALARM_ID" close="end">
          when #{item.errorAlarmId,jdbcType=VARCHAR} then #{item.predictionNo,jdbcType=VARCHAR}
       </foreach>
       ,MALFUNCTION_DETAIL=
       <foreach collection="list" item="item" index="index" separator=" " open="case ERROR_ALARM_ID" close="end">
          when #{item.errorAlarmId,jdbcType=VARCHAR} then #{item.malfunctionDetail,jdbcType=VARCHAR}
       </foreach>
       ,MALFUNCTION_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ERROR_ALARM_ID" close="end">
          when #{item.errorAlarmId,jdbcType=VARCHAR} then #{item.malfunctionTime,jdbcType=TIMESTAMP}
       </foreach>
       ,CREATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case ERROR_ALARM_ID" close="end">
          when #{item.errorAlarmId,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ERROR_ALARM_ID" close="end">
          when #{item.errorAlarmId,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ERROR_ALARM_ID" close="end">
          when #{item.errorAlarmId,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
       </foreach>
       ,UPDATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case ERROR_ALARM_ID" close="end">
          when #{item.errorAlarmId,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ERROR_ALARM_ID" close="end">
          when #{item.errorAlarmId,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case ERROR_ALARM_ID" close="end">
          when #{item.errorAlarmId,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
       </foreach>
       ,MEMO=
       <foreach collection="list" item="item" index="index" separator=" " open="case ERROR_ALARM_ID" close="end">
          when #{item.errorAlarmId,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
       </foreach>
       ,PROCESS_RESULT=
       <foreach collection="list" item="item" index="index" separator=" " open="case ERROR_ALARM_ID" close="end">
          when #{item.errorAlarmId,jdbcType=VARCHAR} then #{item.processResult,jdbcType=VARCHAR}
       </foreach>
     where ERROR_ALARM_ID in 
     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
    #{item.errorAlarmId,jdbcType=VARCHAR}
     </foreach> 
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from METER_WORK_MALFUNCTION_ALARM
    where ERROR_ALARM_ID in 
    <foreach collection="list" item="id" open="(" close=")" separator=",">
      #{id}
    </foreach>
  </delete>
  <!-- 友情提示！！！-->
  <!-- 请将自己写的代码放在此标签之下，方便以后粘贴复制。-->
  
</mapper>