<?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.meterworkcompareresult.mapper.MeterWorkCompareResultMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.meterwork.meterworkcompareresult.model.MeterWorkCompareResult">
    <id column="COMPARE_RESULT_ID" jdbcType="VARCHAR" property="compareResultId" />
    <result column="BASE_SPOT_NO" jdbcType="VARCHAR" property="baseSpotNo" />
    <result column="BASE_SPOT_NAME" jdbcType="VARCHAR" property="baseSpotName" />
    <result column="MATTER_NO" jdbcType="VARCHAR" property="matterNo" />
    <result column="MATTER_NAME" jdbcType="VARCHAR" property="matterName" />
    <result column="METER_TYPE_NO" jdbcType="VARCHAR" property="meterTypeNo" />
    <result column="METER_TYPE_NAME" jdbcType="VARCHAR" property="meterTypeName" />
    <result column="CAR_NO" jdbcType="VARCHAR" property="carNo" />
    <result column="METER_WEIGHT" jdbcType="DECIMAL" property="meterWeight" />
    <result column="WEIGHT_DIFF_ALLOW" jdbcType="DECIMAL" property="weightDiffAllow" />
    <result column="COMPARE_WEIGHT" jdbcType="DECIMAL" property="compareWeight" />
    <result column="WEIGHT_DIFF_ACT" jdbcType="DECIMAL" property="weightDiffAct" />
    <result column="COMPARE_SPOT_NAME" jdbcType="VARCHAR" property="compareSpotName" />
    <result column="COMPARE_TIME" jdbcType="TIMESTAMP" property="compareTime" />
    <result column="COMPARE_RESULT" jdbcType="VARCHAR" property="compareResult" />
    <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" />
  </resultMap>
  <sql id="columns">
    COMPARE_RESULT_ID, BASE_SPOT_NO, BASE_SPOT_NAME, MATTER_NO, MATTER_NAME, METER_TYPE_NO, 
    METER_TYPE_NAME, CAR_NO, METER_WEIGHT, WEIGHT_DIFF_ALLOW, COMPARE_WEIGHT, WEIGHT_DIFF_ACT, 
    COMPARE_SPOT_NAME, COMPARE_TIME, COMPARE_RESULT, CREATE_MAN_NO, CREATE_MAN_NAME, 
    CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, MEMO
  </sql>
  <sql id="columns_alias">
    t.COMPARE_RESULT_ID, t.BASE_SPOT_NO, t.BASE_SPOT_NAME, t.MATTER_NO, t.MATTER_NAME, 
    t.METER_TYPE_NO, t.METER_TYPE_NAME, t.CAR_NO, t.METER_WEIGHT, t.WEIGHT_DIFF_ALLOW, 
    t.COMPARE_WEIGHT, t.WEIGHT_DIFF_ACT, t.COMPARE_SPOT_NAME, t.COMPARE_TIME, t.COMPARE_RESULT, 
    t.CREATE_MAN_NO, t.CREATE_MAN_NAME, t.CREATE_TIME, t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, 
    t.UPDATE_TIME, t.MEMO
  </sql>
  <sql id="select">
    SELECT <include refid="columns"/> FROM METER_WORK_COMPARE_RESULT
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias"/> FROM METER_WORK_COMPARE_RESULT t
  </sql>
  <sql id="where">
    <where> 
      <if test="compareResultId != null and compareResultId != ''">
        and COMPARE_RESULT_ID = #{compareResultId}
      </if>
      <if test="baseSpotNo != null and baseSpotNo != ''">
        and BASE_SPOT_NO = #{baseSpotNo}
      </if>
      <if test="baseSpotName != null and baseSpotName != ''">
        and BASE_SPOT_NAME = #{baseSpotName}
      </if>
      <if test="matterNo != null and matterNo != ''">
        and MATTER_NO = #{matterNo}
      </if>
      <if test="matterName != null and matterName != ''">
        and MATTER_NAME = #{matterName}
      </if>
      <if test="meterTypeNo != null and meterTypeNo != ''">
        and METER_TYPE_NO = #{meterTypeNo}
      </if>
      <if test="meterTypeName != null and meterTypeName != ''">
        and METER_TYPE_NAME = #{meterTypeName}
      </if>
      <if test="carNo != null and carNo != ''">
        and CAR_NO = #{carNo}
      </if>
      <if test="meterWeight != null">
        and METER_WEIGHT = #{meterWeight}
      </if>
      <if test="weightDiffAllow != null">
        and WEIGHT_DIFF_ALLOW = #{weightDiffAllow}
      </if>
      <if test="compareWeight != null">
        and COMPARE_WEIGHT = #{compareWeight}
      </if>
      <if test="weightDiffAct != null">
        and WEIGHT_DIFF_ACT = #{weightDiffAct}
      </if>
      <if test="compareSpotName != null and compareSpotName != ''">
        and COMPARE_SPOT_NAME = #{compareSpotName}
      </if>
      <if test="compareTime != null">
        and TO_CHAR(COMPARE_TIME,'yyyy-MM-dd') = #{compareTime}
      </if>
      <if test="compareResult != null and compareResult != ''">
        and COMPARE_RESULT = #{compareResult}
      </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="createTime1 != null and createTime2 != null and createTime1 != '' and createTime2 != ''">
        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd HH24:mi:ss') >= #{createTime1} and TO_CHAR(CREATE_TIME,'yyyy-MM-dd
        HH24:mi:ss') &lt;= #{createTime2}
      </if>
    </where>
  </sql>
  <sql id="whereLike">
    <where> 
      <if test="compareResultId != null and compareResultId != ''">
        and COMPARE_RESULT_ID LIKE '%${compareResultId}%'
      </if>
      <if test="baseSpotNo != null and baseSpotNo != ''">
        and BASE_SPOT_NO LIKE '%${baseSpotNo}%'
      </if>
      <if test="baseSpotName != null and baseSpotName != ''">
        and BASE_SPOT_NAME LIKE '%${baseSpotName}%'
      </if>
      <if test="matterNo != null and matterNo != ''">
        and MATTER_NO LIKE '%${matterNo}%'
      </if>
      <if test="matterName != null and matterName != ''">
        and MATTER_NAME LIKE '%${matterName}%'
      </if>
      <if test="meterTypeNo != null and meterTypeNo != ''">
        and METER_TYPE_NO LIKE '%${meterTypeNo}%'
      </if>
      <if test="meterTypeName != null and meterTypeName != ''">
        and METER_TYPE_NAME LIKE '%${meterTypeName}%'
      </if>
      <if test="carNo != null and carNo != ''">
        and CAR_NO LIKE '%${carNo}%'
      </if>
      <if test="meterWeight != null">
        and METER_WEIGHT = #{meterWeight}
      </if>
      <if test="weightDiffAllow != null">
        and WEIGHT_DIFF_ALLOW = #{weightDiffAllow}
      </if>
      <if test="compareWeight != null">
        and COMPARE_WEIGHT = #{compareWeight}
      </if>
      <if test="weightDiffAct != null">
        and WEIGHT_DIFF_ACT = #{weightDiffAct}
      </if>
      <if test="compareSpotName != null and compareSpotName != ''">
        and COMPARE_SPOT_NAME LIKE '%${compareSpotName}%'
      </if>
      <if test="compareTime != null">
        and TO_CHAR(COMPARE_TIME,'yyyy-MM-dd') = #{compareTime}
      </if>
      <if test="compareResult != null and compareResult != ''">
        and COMPARE_RESULT LIKE '%${compareResult}%'
      </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="createTime1 != null and createTime2 != null and createTime1 != '' and createTime2 != ''">
        and TO_CHAR(CREATE_TIME,'yyyy-MM-dd HH24:mi:ss') >= #{createTime1} and TO_CHAR(CREATE_TIME,'yyyy-MM-dd
        HH24:mi:ss') &lt;= #{createTime2}
      </if>
    </where>
  </sql>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from METER_WORK_COMPARE_RESULT
    where COMPARE_RESULT_ID = #{compareResultId,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from METER_WORK_COMPARE_RESULT
    where 1!=1 
      <if test="baseSpotNo != null and baseSpotNo != ''">
        or BASE_SPOT_NO = #{baseSpotNo}
      </if>
      <if test="baseSpotName != null and baseSpotName != ''">
        or BASE_SPOT_NAME = #{baseSpotName}
      </if>
      <if test="matterNo != null and matterNo != ''">
        or MATTER_NO = #{matterNo}
      </if>
      <if test="matterName != null and matterName != ''">
        or MATTER_NAME = #{matterName}
      </if>
      <if test="meterTypeNo != null and meterTypeNo != ''">
        or METER_TYPE_NO = #{meterTypeNo}
      </if>
      <if test="meterTypeName != null and meterTypeName != ''">
        or METER_TYPE_NAME = #{meterTypeName}
      </if>
      <if test="carNo != null and carNo != ''">
        or CAR_NO = #{carNo}
      </if>
      <if test="meterWeight != null">
        or METER_WEIGHT = #{meterWeight}
      </if>
      <if test="weightDiffAllow != null">
        or WEIGHT_DIFF_ALLOW = #{weightDiffAllow}
      </if>
      <if test="compareWeight != null">
        or COMPARE_WEIGHT = #{compareWeight}
      </if>
      <if test="weightDiffAct != null">
        or WEIGHT_DIFF_ACT = #{weightDiffAct}
      </if>
      <if test="compareSpotName != null and compareSpotName != ''">
        or COMPARE_SPOT_NAME = #{compareSpotName}
      </if>
      <if test="compareTime != null">
        or TO_CHAR(COMPARE_TIME,'yyyy-MM-dd') = '#{compareTime}'
      </if>
      <if test="compareResult != null and compareResult != ''">
        or COMPARE_RESULT = #{compareResult}
      </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>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.meterwork.meterworkcompareresult.model.MeterWorkCompareResult">
    insert into METER_WORK_COMPARE_RESULT (COMPARE_RESULT_ID, BASE_SPOT_NO, BASE_SPOT_NAME, 
      MATTER_NO, MATTER_NAME, METER_TYPE_NO, 
      METER_TYPE_NAME, CAR_NO, METER_WEIGHT, 
      WEIGHT_DIFF_ALLOW, COMPARE_WEIGHT, WEIGHT_DIFF_ACT, 
      COMPARE_SPOT_NAME, COMPARE_TIME, COMPARE_RESULT, 
      CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
      UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, 
      MEMO)
    values (#{compareResultId,jdbcType=VARCHAR}, #{baseSpotNo,jdbcType=VARCHAR}, #{baseSpotName,jdbcType=VARCHAR}, 
      #{matterNo,jdbcType=VARCHAR}, #{matterName,jdbcType=VARCHAR}, #{meterTypeNo,jdbcType=VARCHAR}, 
      #{meterTypeName,jdbcType=VARCHAR}, #{carNo,jdbcType=VARCHAR}, #{meterWeight,jdbcType=DECIMAL}, 
      #{weightDiffAllow,jdbcType=DECIMAL}, #{compareWeight,jdbcType=DECIMAL}, #{weightDiffAct,jdbcType=DECIMAL}, 
      #{compareSpotName,jdbcType=VARCHAR}, #{compareTime,jdbcType=TIMESTAMP}, #{compareResult,jdbcType=VARCHAR}, 
      #{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{updateManNo,jdbcType=VARCHAR}, #{updateManName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
      #{memo,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.meterwork.meterworkcompareresult.model.MeterWorkCompareResult">
    insert into METER_WORK_COMPARE_RESULT
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="compareResultId != null">
        COMPARE_RESULT_ID,
      </if>
      <if test="baseSpotNo != null">
        BASE_SPOT_NO,
      </if>
      <if test="baseSpotName != null">
        BASE_SPOT_NAME,
      </if>
      <if test="matterNo != null">
        MATTER_NO,
      </if>
      <if test="matterName != null">
        MATTER_NAME,
      </if>
      <if test="meterTypeNo != null">
        METER_TYPE_NO,
      </if>
      <if test="meterTypeName != null">
        METER_TYPE_NAME,
      </if>
      <if test="carNo != null">
        CAR_NO,
      </if>
      <if test="meterWeight != null">
        METER_WEIGHT,
      </if>
      <if test="weightDiffAllow != null">
        WEIGHT_DIFF_ALLOW,
      </if>
      <if test="compareWeight != null">
        COMPARE_WEIGHT,
      </if>
      <if test="weightDiffAct != null">
        WEIGHT_DIFF_ACT,
      </if>
      <if test="compareSpotName != null">
        COMPARE_SPOT_NAME,
      </if>
      <if test="compareTime != null">
        COMPARE_TIME,
      </if>
      <if test="compareResult != null">
        COMPARE_RESULT,
      </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>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="compareResultId != null">
        #{compareResultId,jdbcType=VARCHAR},
      </if>
      <if test="baseSpotNo != null">
        #{baseSpotNo,jdbcType=VARCHAR},
      </if>
      <if test="baseSpotName != null">
        #{baseSpotName,jdbcType=VARCHAR},
      </if>
      <if test="matterNo != null">
        #{matterNo,jdbcType=VARCHAR},
      </if>
      <if test="matterName != null">
        #{matterName,jdbcType=VARCHAR},
      </if>
      <if test="meterTypeNo != null">
        #{meterTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="meterTypeName != null">
        #{meterTypeName,jdbcType=VARCHAR},
      </if>
      <if test="carNo != null">
        #{carNo,jdbcType=VARCHAR},
      </if>
      <if test="meterWeight != null">
        #{meterWeight,jdbcType=DECIMAL},
      </if>
      <if test="weightDiffAllow != null">
        #{weightDiffAllow,jdbcType=DECIMAL},
      </if>
      <if test="compareWeight != null">
        #{compareWeight,jdbcType=DECIMAL},
      </if>
      <if test="weightDiffAct != null">
        #{weightDiffAct,jdbcType=DECIMAL},
      </if>
      <if test="compareSpotName != null">
        #{compareSpotName,jdbcType=VARCHAR},
      </if>
      <if test="compareTime != null">
        #{compareTime,jdbcType=TIMESTAMP},
      </if>
      <if test="compareResult != null">
        #{compareResult,jdbcType=VARCHAR},
      </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>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.meterwork.meterworkcompareresult.model.MeterWorkCompareResult">
    update METER_WORK_COMPARE_RESULT
    set BASE_SPOT_NO = #{baseSpotNo,jdbcType=VARCHAR},
      BASE_SPOT_NAME = #{baseSpotName,jdbcType=VARCHAR},
      MATTER_NO = #{matterNo,jdbcType=VARCHAR},
      MATTER_NAME = #{matterName,jdbcType=VARCHAR},
      METER_TYPE_NO = #{meterTypeNo,jdbcType=VARCHAR},
      METER_TYPE_NAME = #{meterTypeName,jdbcType=VARCHAR},
      CAR_NO = #{carNo,jdbcType=VARCHAR},
      METER_WEIGHT = #{meterWeight,jdbcType=DECIMAL},
      WEIGHT_DIFF_ALLOW = #{weightDiffAllow,jdbcType=DECIMAL},
      COMPARE_WEIGHT = #{compareWeight,jdbcType=DECIMAL},
      WEIGHT_DIFF_ACT = #{weightDiffAct,jdbcType=DECIMAL},
      COMPARE_SPOT_NAME = #{compareSpotName,jdbcType=VARCHAR},
      COMPARE_TIME = #{compareTime,jdbcType=TIMESTAMP},
      COMPARE_RESULT = #{compareResult,jdbcType=VARCHAR},
      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}
    where COMPARE_RESULT_ID = #{compareResultId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.meterwork.meterworkcompareresult.model.MeterWorkCompareResult">
    update METER_WORK_COMPARE_RESULT
    <set>
      <if test="baseSpotNo != null">
        BASE_SPOT_NO = #{baseSpotNo,jdbcType=VARCHAR},
      </if>
      <if test="baseSpotName != null">
        BASE_SPOT_NAME = #{baseSpotName,jdbcType=VARCHAR},
      </if>
      <if test="matterNo != null">
        MATTER_NO = #{matterNo,jdbcType=VARCHAR},
      </if>
      <if test="matterName != null">
        MATTER_NAME = #{matterName,jdbcType=VARCHAR},
      </if>
      <if test="meterTypeNo != null">
        METER_TYPE_NO = #{meterTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="meterTypeName != null">
        METER_TYPE_NAME = #{meterTypeName,jdbcType=VARCHAR},
      </if>
      <if test="carNo != null">
        CAR_NO = #{carNo,jdbcType=VARCHAR},
      </if>
      <if test="meterWeight != null">
        METER_WEIGHT = #{meterWeight,jdbcType=DECIMAL},
      </if>
      <if test="weightDiffAllow != null">
        WEIGHT_DIFF_ALLOW = #{weightDiffAllow,jdbcType=DECIMAL},
      </if>
      <if test="compareWeight != null">
        COMPARE_WEIGHT = #{compareWeight,jdbcType=DECIMAL},
      </if>
      <if test="weightDiffAct != null">
        WEIGHT_DIFF_ACT = #{weightDiffAct,jdbcType=DECIMAL},
      </if>
      <if test="compareSpotName != null">
        COMPARE_SPOT_NAME = #{compareSpotName,jdbcType=VARCHAR},
      </if>
      <if test="compareTime != null">
        COMPARE_TIME = #{compareTime,jdbcType=TIMESTAMP},
      </if>
      <if test="compareResult != null">
        COMPARE_RESULT = #{compareResult,jdbcType=VARCHAR},
      </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>
    </set>
    where COMPARE_RESULT_ID = #{compareResultId,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <include refid="select"/>
    where COMPARE_RESULT_ID = #{compareResultId,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_COMPARE_RESULT 
      (COMPARE_RESULT_ID, 
      BASE_SPOT_NO, BASE_SPOT_NAME, MATTER_NO, 
      MATTER_NAME, METER_TYPE_NO, METER_TYPE_NAME, 
      CAR_NO, METER_WEIGHT, WEIGHT_DIFF_ALLOW, 
      COMPARE_WEIGHT, WEIGHT_DIFF_ACT, 
      COMPARE_SPOT_NAME, COMPARE_TIME, 
      COMPARE_RESULT, CREATE_MAN_NO, CREATE_MAN_NAME, 
      CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, 
      UPDATE_TIME, MEMO)
    ( <foreach collection="list" item="item" separator="union all"> 
   select  
      #{item.compareResultId,jdbcType=VARCHAR}, 
      #{item.baseSpotNo,jdbcType=VARCHAR}, #{item.baseSpotName,jdbcType=VARCHAR}, #{item.matterNo,jdbcType=VARCHAR}, 
      #{item.matterName,jdbcType=VARCHAR}, #{item.meterTypeNo,jdbcType=VARCHAR}, #{item.meterTypeName,jdbcType=VARCHAR}, 
      #{item.carNo,jdbcType=VARCHAR}, #{item.meterWeight,jdbcType=DECIMAL}, #{item.weightDiffAllow,jdbcType=DECIMAL}, 
      #{item.compareWeight,jdbcType=DECIMAL}, #{item.weightDiffAct,jdbcType=DECIMAL}, 
      #{item.compareSpotName,jdbcType=VARCHAR}, #{item.compareTime,jdbcType=TIMESTAMP}, 
      #{item.compareResult,jdbcType=VARCHAR}, #{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} from dual  
   </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
     update METER_WORK_COMPARE_RESULT
     set
       COMPARE_RESULT_ID=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.compareResultId,jdbcType=VARCHAR}
       </foreach>
       ,BASE_SPOT_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.baseSpotNo,jdbcType=VARCHAR}
       </foreach>
       ,BASE_SPOT_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.baseSpotName,jdbcType=VARCHAR}
       </foreach>
       ,MATTER_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.matterNo,jdbcType=VARCHAR}
       </foreach>
       ,MATTER_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.matterName,jdbcType=VARCHAR}
       </foreach>
       ,METER_TYPE_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.meterTypeNo,jdbcType=VARCHAR}
       </foreach>
       ,METER_TYPE_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.meterTypeName,jdbcType=VARCHAR}
       </foreach>
       ,CAR_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.carNo,jdbcType=VARCHAR}
       </foreach>
       ,METER_WEIGHT=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.meterWeight,jdbcType=DECIMAL}
       </foreach>
       ,WEIGHT_DIFF_ALLOW=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.weightDiffAllow,jdbcType=DECIMAL}
       </foreach>
       ,COMPARE_WEIGHT=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.compareWeight,jdbcType=DECIMAL}
       </foreach>
       ,WEIGHT_DIFF_ACT=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.weightDiffAct,jdbcType=DECIMAL}
       </foreach>
       ,COMPARE_SPOT_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.compareSpotName,jdbcType=VARCHAR}
       </foreach>
       ,COMPARE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.compareTime,jdbcType=TIMESTAMP}
       </foreach>
       ,COMPARE_RESULT=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.compareResult,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
       </foreach>
       ,UPDATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
       </foreach>
       ,MEMO=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_RESULT_ID" close="end">
          when #{item.compareResultId,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
       </foreach>
     where COMPARE_RESULT_ID in 
     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
    #{item.compareResultId,jdbcType=VARCHAR}
     </foreach> 
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from METER_WORK_COMPARE_RESULT
    where COMPARE_RESULT_ID in 
    <foreach collection="list" item="id" open="(" close=")" separator=",">
      #{id}
    </foreach>
  </delete>
  <!-- 友情提示！！！-->
  <!-- 请将自己写的代码放在此标签之下，方便以后粘贴复制。-->
  
</mapper>