<?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.meterworkcompareconfig.mapper.MeterWorkCompareConfigMapper">
  <resultMap id="BaseResultMap" type="com.steerinfo.meterwork.meterworkcompareconfig.model.MeterWorkCompareConfig">
    <id column="COMPARE_ID" jdbcType="VARCHAR" property="compareId" />
    <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="PLANNING_TIME" jdbcType="VARCHAR" property="planningTime" />
    <result column="PROPORTIONAL_VALUE" jdbcType="VARCHAR" property="proportionalValue" />
    <result column="FIXED_VALUE" jdbcType="DECIMAL" property="fixedValue" />
    <result column="VALUE_FLAG" jdbcType="VARCHAR" property="valueFlag" />
    <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="WEIGHT_TYPE_NO" jdbcType="VARCHAR" property="weightTypeNo" />
    <result column="WEIGHT_TYPE_NAME" jdbcType="VARCHAR" property="weightTypeName" />
    <result column="COMPARE_TYPE_NO" jdbcType="VARCHAR" property="compareTypeNo" />
    <result column="COMPARE_TYPE_NAME" jdbcType="VARCHAR" property="compareTypeName" />
  </resultMap>
  <sql id="columns">
    COMPARE_ID, BASE_SPOT_NO, BASE_SPOT_NAME, MATTER_NO, MATTER_NAME, PLANNING_TIME, 
    PROPORTIONAL_VALUE, FIXED_VALUE, VALUE_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
    UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, MEMO, WEIGHT_TYPE_NO, WEIGHT_TYPE_NAME, 
    COMPARE_TYPE_NO, COMPARE_TYPE_NAME
  </sql>
  <sql id="columns_alias">
    t.COMPARE_ID, t.BASE_SPOT_NO, t.BASE_SPOT_NAME, t.MATTER_NO, t.MATTER_NAME, t.PLANNING_TIME, 
    t.PROPORTIONAL_VALUE, t.FIXED_VALUE, t.VALUE_FLAG, 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.WEIGHT_TYPE_NO, 
    t.WEIGHT_TYPE_NAME, t.COMPARE_TYPE_NO, t.COMPARE_TYPE_NAME
  </sql>
  <sql id="select">
    SELECT <include refid="columns"/> FROM METER_WORK_COMPARE_CONFIG
  </sql>
  <sql id="select_alias">
    SELECT <include refid="columns_alias"/> FROM METER_WORK_COMPARE_CONFIG t
  </sql>
  <sql id="where">
    <where> 
      <if test="compareId != null and compareId != ''">
        and COMPARE_ID = #{compareId}
      </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="planningTime != null and planningTime != ''">
        and PLANNING_TIME = #{planningTime}
      </if>
      <if test="proportionalValue != null and proportionalValue != ''">
        and PROPORTIONAL_VALUE = #{proportionalValue}
      </if>
      <if test="fixedValue != null">
        and FIXED_VALUE = #{fixedValue}
      </if>
      <if test="valueFlag != null and valueFlag != ''">
        and VALUE_FLAG = #{valueFlag}
      </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="weightTypeNo != null and weightTypeNo != ''">
        and WEIGHT_TYPE_NO = #{weightTypeNo}
      </if>
      <if test="weightTypeName != null and weightTypeName != ''">
        and WEIGHT_TYPE_NAME = #{weightTypeName}
      </if>
      <if test="compareTypeNo != null and compareTypeNo != ''">
        and COMPARE_TYPE_NO = #{compareTypeNo}
      </if>
      <if test="compareTypeName != null and compareTypeName != ''">
        and COMPARE_TYPE_NAME = #{compareTypeName}
      </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="compareId != null and compareId != ''">
        and COMPARE_ID LIKE '%${compareId}%'
      </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="planningTime != null and planningTime != ''">
        and PLANNING_TIME LIKE '%${planningTime}%'
      </if>
      <if test="proportionalValue != null and proportionalValue != ''">
        and PROPORTIONAL_VALUE LIKE '%${proportionalValue}%'
      </if>
      <if test="fixedValue != null">
        and FIXED_VALUE = #{fixedValue}
      </if>
      <if test="valueFlag != null and valueFlag != ''">
        and VALUE_FLAG LIKE '%${valueFlag}%'
      </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="weightTypeNo != null and weightTypeNo != ''">
        and WEIGHT_TYPE_NO LIKE '%${weightTypeNo}%'
      </if>
      <if test="weightTypeName != null and weightTypeName != ''">
        and WEIGHT_TYPE_NAME LIKE '%${weightTypeName}%'
      </if>
      <if test="compareTypeNo != null and compareTypeNo != ''">
        and COMPARE_TYPE_NO LIKE '%${compareTypeNo}%'
      </if>
      <if test="compareTypeName != null and compareTypeName != ''">
        and COMPARE_TYPE_NAME LIKE '%${compareTypeName}%'
      </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_CONFIG
    where COMPARE_ID = #{compareId,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
    delete from METER_WORK_COMPARE_CONFIG
    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="planningTime != null and planningTime != ''">
        or PLANNING_TIME = #{planningTime}
      </if>
      <if test="proportionalValue != null and proportionalValue != ''">
        or PROPORTIONAL_VALUE = #{proportionalValue}
      </if>
      <if test="fixedValue != null">
        or FIXED_VALUE = #{fixedValue}
      </if>
      <if test="valueFlag != null and valueFlag != ''">
        or VALUE_FLAG = #{valueFlag}
      </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="weightTypeNo != null and weightTypeNo != ''">
        or WEIGHT_TYPE_NO = #{weightTypeNo}
      </if>
      <if test="weightTypeName != null and weightTypeName != ''">
        or WEIGHT_TYPE_NAME = #{weightTypeName}
      </if>
      <if test="compareTypeNo != null and compareTypeNo != ''">
        or COMPARE_TYPE_NO = #{compareTypeNo}
      </if>
      <if test="compareTypeName != null and compareTypeName != ''">
        or COMPARE_TYPE_NAME = #{compareTypeName}
      </if>
  </delete>
  <insert id="insert" parameterType="com.steerinfo.meterwork.meterworkcompareconfig.model.MeterWorkCompareConfig">
    insert into METER_WORK_COMPARE_CONFIG (COMPARE_ID, BASE_SPOT_NO, BASE_SPOT_NAME, 
      MATTER_NO, MATTER_NAME, PLANNING_TIME, 
      PROPORTIONAL_VALUE, FIXED_VALUE, VALUE_FLAG, 
      CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME, 
      UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, 
      MEMO, WEIGHT_TYPE_NO, WEIGHT_TYPE_NAME, 
      COMPARE_TYPE_NO, COMPARE_TYPE_NAME)
    values (#{compareId,jdbcType=VARCHAR}, #{baseSpotNo,jdbcType=VARCHAR}, #{baseSpotName,jdbcType=VARCHAR}, 
      #{matterNo,jdbcType=VARCHAR}, #{matterName,jdbcType=VARCHAR}, #{planningTime,jdbcType=VARCHAR}, 
      #{proportionalValue,jdbcType=VARCHAR}, #{fixedValue,jdbcType=DECIMAL}, #{valueFlag,jdbcType=VARCHAR}, 
      #{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{updateManNo,jdbcType=VARCHAR}, #{updateManName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
      #{memo,jdbcType=VARCHAR}, #{weightTypeNo,jdbcType=VARCHAR}, #{weightTypeName,jdbcType=VARCHAR}, 
      #{compareTypeNo,jdbcType=VARCHAR}, #{compareTypeName,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.steerinfo.meterwork.meterworkcompareconfig.model.MeterWorkCompareConfig">
    insert into METER_WORK_COMPARE_CONFIG
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="compareId != null">
        COMPARE_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="planningTime != null">
        PLANNING_TIME,
      </if>
      <if test="proportionalValue != null">
        PROPORTIONAL_VALUE,
      </if>
      <if test="fixedValue != null">
        FIXED_VALUE,
      </if>
      <if test="valueFlag != null">
        VALUE_FLAG,
      </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="weightTypeNo != null">
        WEIGHT_TYPE_NO,
      </if>
      <if test="weightTypeName != null">
        WEIGHT_TYPE_NAME,
      </if>
      <if test="compareTypeNo != null">
        COMPARE_TYPE_NO,
      </if>
      <if test="compareTypeName != null">
        COMPARE_TYPE_NAME,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="compareId != null">
        #{compareId,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="planningTime != null">
        #{planningTime,jdbcType=VARCHAR},
      </if>
      <if test="proportionalValue != null">
        #{proportionalValue,jdbcType=VARCHAR},
      </if>
      <if test="fixedValue != null">
        #{fixedValue,jdbcType=DECIMAL},
      </if>
      <if test="valueFlag != null">
        #{valueFlag,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>
      <if test="weightTypeNo != null">
        #{weightTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="weightTypeName != null">
        #{weightTypeName,jdbcType=VARCHAR},
      </if>
      <if test="compareTypeNo != null">
        #{compareTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="compareTypeName != null">
        #{compareTypeName,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKey" parameterType="com.steerinfo.meterwork.meterworkcompareconfig.model.MeterWorkCompareConfig">
    update METER_WORK_COMPARE_CONFIG
    set BASE_SPOT_NO = #{baseSpotNo,jdbcType=VARCHAR},
      BASE_SPOT_NAME = #{baseSpotName,jdbcType=VARCHAR},
      MATTER_NO = #{matterNo,jdbcType=VARCHAR},
      MATTER_NAME = #{matterName,jdbcType=VARCHAR},
      PLANNING_TIME = #{planningTime,jdbcType=VARCHAR},
      PROPORTIONAL_VALUE = #{proportionalValue,jdbcType=VARCHAR},
      FIXED_VALUE = #{fixedValue,jdbcType=DECIMAL},
      VALUE_FLAG = #{valueFlag,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},
      WEIGHT_TYPE_NO = #{weightTypeNo,jdbcType=VARCHAR},
      WEIGHT_TYPE_NAME = #{weightTypeName,jdbcType=VARCHAR},
      COMPARE_TYPE_NO = #{compareTypeNo,jdbcType=VARCHAR},
      COMPARE_TYPE_NAME = #{compareTypeName,jdbcType=VARCHAR}
    where COMPARE_ID = #{compareId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.meterwork.meterworkcompareconfig.model.MeterWorkCompareConfig">
    update METER_WORK_COMPARE_CONFIG
    <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="planningTime != null">
        PLANNING_TIME = #{planningTime,jdbcType=VARCHAR},
      </if>
      <if test="proportionalValue != null">
        PROPORTIONAL_VALUE = #{proportionalValue,jdbcType=VARCHAR},
      </if>
      <if test="fixedValue != null">
        FIXED_VALUE = #{fixedValue,jdbcType=DECIMAL},
      </if>
      <if test="valueFlag != null">
        VALUE_FLAG = #{valueFlag,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>
      <if test="weightTypeNo != null">
        WEIGHT_TYPE_NO = #{weightTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="weightTypeName != null">
        WEIGHT_TYPE_NAME = #{weightTypeName,jdbcType=VARCHAR},
      </if>
      <if test="compareTypeNo != null">
        COMPARE_TYPE_NO = #{compareTypeNo,jdbcType=VARCHAR},
      </if>
      <if test="compareTypeName != null">
        COMPARE_TYPE_NAME = #{compareTypeName,jdbcType=VARCHAR},
      </if>
    </set>
    where COMPARE_ID = #{compareId,jdbcType=VARCHAR}
  </update>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <include refid="select"/>
    where COMPARE_ID = #{compareId,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_CONFIG 
      (COMPARE_ID, 
      BASE_SPOT_NO, BASE_SPOT_NAME, MATTER_NO, 
      MATTER_NAME, PLANNING_TIME, PROPORTIONAL_VALUE, 
      FIXED_VALUE, VALUE_FLAG, CREATE_MAN_NO, 
      CREATE_MAN_NAME, CREATE_TIME, 
      UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, 
      MEMO, WEIGHT_TYPE_NO, WEIGHT_TYPE_NAME, 
      COMPARE_TYPE_NO, COMPARE_TYPE_NAME
      )
    ( <foreach collection="list" item="item" separator="union all"> 
   select  
      #{item.compareId,jdbcType=VARCHAR}, 
      #{item.baseSpotNo,jdbcType=VARCHAR}, #{item.baseSpotName,jdbcType=VARCHAR}, #{item.matterNo,jdbcType=VARCHAR}, 
      #{item.matterName,jdbcType=VARCHAR}, #{item.planningTime,jdbcType=VARCHAR}, #{item.proportionalValue,jdbcType=VARCHAR}, 
      #{item.fixedValue,jdbcType=DECIMAL}, #{item.valueFlag,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}, #{item.weightTypeNo,jdbcType=VARCHAR}, #{item.weightTypeName,jdbcType=VARCHAR}, 
      #{item.compareTypeNo,jdbcType=VARCHAR}, #{item.compareTypeName,jdbcType=VARCHAR}
       from dual  
   </foreach> )
  </insert>
  <update id="batchUpdate" parameterType="java.util.List">
     update METER_WORK_COMPARE_CONFIG
     set
       COMPARE_ID=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.compareId,jdbcType=VARCHAR}
       </foreach>
       ,BASE_SPOT_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.baseSpotNo,jdbcType=VARCHAR}
       </foreach>
       ,BASE_SPOT_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.baseSpotName,jdbcType=VARCHAR}
       </foreach>
       ,MATTER_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.matterNo,jdbcType=VARCHAR}
       </foreach>
       ,MATTER_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.matterName,jdbcType=VARCHAR}
       </foreach>
       ,PLANNING_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.planningTime,jdbcType=VARCHAR}
       </foreach>
       ,PROPORTIONAL_VALUE=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.proportionalValue,jdbcType=VARCHAR}
       </foreach>
       ,FIXED_VALUE=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.fixedValue,jdbcType=DECIMAL}
       </foreach>
       ,VALUE_FLAG=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.valueFlag,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
       </foreach>
       ,CREATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
       </foreach>
       ,UPDATE_MAN_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_MAN_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
       </foreach>
       ,UPDATE_TIME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
       </foreach>
       ,MEMO=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
       </foreach>
       ,WEIGHT_TYPE_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.weightTypeNo,jdbcType=VARCHAR}
       </foreach>
       ,WEIGHT_TYPE_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.weightTypeName,jdbcType=VARCHAR}
       </foreach>
       ,COMPARE_TYPE_NO=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.compareTypeNo,jdbcType=VARCHAR}
       </foreach>
       ,COMPARE_TYPE_NAME=
       <foreach collection="list" item="item" index="index" separator=" " open="case COMPARE_ID" close="end">
          when #{item.compareId,jdbcType=VARCHAR} then #{item.compareTypeName,jdbcType=VARCHAR}
       </foreach>
     where COMPARE_ID in 
     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
    #{item.compareId,jdbcType=VARCHAR}
     </foreach> 
  </update>
  <delete id="batchDelete" parameterType="java.util.List">
    delete from METER_WORK_COMPARE_CONFIG
    where COMPARE_ID in 
    <foreach collection="list" item="id" open="(" close=")" separator=",">
      #{id}
    </foreach>
  </delete>
  <!-- 友情提示！！！-->
  <!-- 请将自己写的代码放在此标签之下，方便以后粘贴复制。-->
  
</mapper>