<?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="cn.cecep.talroad.mapper.analysis.SRaLowMonitoringWaterMapper">
  <resultMap id="BaseResultMap" type="cn.cecep.talroad.domain.analysis.SRaLowMonitoringWater">
    <!--@mbg.generated-->
    <!--@Table s_ra_low_monitoring_water-->
    <id column="data_id" jdbcType="OTHER" property="dataId" />
    <result column="factory_id" jdbcType="VARCHAR" property="factoryId" />
    <result column="factory_name" jdbcType="VARCHAR" property="factoryName" />
    <result column="industry_category_name" jdbcType="VARCHAR" property="industryCategoryName" />
    <result column="industry_category_code" jdbcType="VARCHAR" property="industryCategoryCode" />
    <result column="district_name" jdbcType="VARCHAR" property="districtName" />
    <result column="district_code" jdbcType="VARCHAR" property="districtCode" />
    <result column="monitor_time" jdbcType="TIMESTAMP" property="monitorTime" />
    <result column="moitor_name" jdbcType="VARCHAR" property="moitorName" />
    <result column="monitor_id" jdbcType="VARCHAR" property="monitorId" />
    <result column="monitoring_type" jdbcType="VARCHAR" property="monitoringType" />
    <result column="emission_standard_name" jdbcType="VARCHAR" property="emissionStandardName" />
    <result column="standard_num" jdbcType="VARCHAR" property="standardNum" />
    <result column="receiving_water_name" jdbcType="VARCHAR" property="receivingWaterName" />
    <result column="monitoring_class" jdbcType="VARCHAR" property="monitoringClass" />
    <result column="flow" jdbcType="VARCHAR" property="flow" />
    <result column="production_load" jdbcType="VARCHAR" property="productionLoad" />
    <result column="concentration" jdbcType="VARCHAR" property="concentration" />
    <result column="upper_value" jdbcType="VARCHAR" property="upperValue" />
    <result column="lower_value" jdbcType="VARCHAR" property="lowerValue" />
    <result column="unit" jdbcType="VARCHAR" property="unit" />
    <result column="exceeding_standard" jdbcType="VARCHAR" property="exceedingStandard" />
    <result column="exceeding_multiple" jdbcType="VARCHAR" property="exceedingMultiple" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    data_id, factory_id, factory_name, industry_category_name, industry_category_code, 
    district_name, district_code, monitor_time, moitor_name, monitor_id, monitoring_type, 
    emission_standard_name, standard_num, receiving_water_name, monitoring_class, flow, 
    production_load, concentration, upper_value, lower_value, unit, exceeding_standard, 
    exceeding_multiple
  </sql>
  <update id="updateBatch" parameterType="java.util.List">
    <!--@mbg.generated-->
    update s_ra_low_monitoring_water
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="factory_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.factoryId,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="factory_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.factoryName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="industry_category_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.industryCategoryName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="industry_category_code = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.industryCategoryCode,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="district_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.districtName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="district_code = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.districtCode,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="monitor_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.monitorTime,jdbcType=TIMESTAMP}
        </foreach>
      </trim>
      <trim prefix="moitor_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.moitorName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="monitor_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.monitorId,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="monitoring_type = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.monitoringType,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="emission_standard_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.emissionStandardName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="standard_num = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.standardNum,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="receiving_water_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.receivingWaterName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="monitoring_class = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.monitoringClass,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="flow = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.flow,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="production_load = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.productionLoad,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="concentration = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.concentration,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="upper_value = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.upperValue,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="lower_value = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.lowerValue,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="unit = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.unit,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="exceeding_standard = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.exceedingStandard,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="exceeding_multiple = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when data_id = #{item.dataId,jdbcType=OTHER} then #{item.exceedingMultiple,jdbcType=VARCHAR}
        </foreach>
      </trim>
    </trim>
    where data_id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.dataId,jdbcType=OTHER}
    </foreach>
  </update>
  <update id="updateBatchSelective" parameterType="java.util.List">
    <!--@mbg.generated-->
    update s_ra_low_monitoring_water
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="factory_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.factoryId != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.factoryId,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="factory_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.factoryName != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.factoryName,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="industry_category_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.industryCategoryName != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.industryCategoryName,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="industry_category_code = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.industryCategoryCode != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.industryCategoryCode,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="district_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.districtName != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.districtName,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="district_code = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.districtCode != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.districtCode,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="monitor_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.monitorTime != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.monitorTime,jdbcType=TIMESTAMP}
          </if>
        </foreach>
      </trim>
      <trim prefix="moitor_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.moitorName != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.moitorName,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="monitor_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.monitorId != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.monitorId,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="monitoring_type = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.monitoringType != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.monitoringType,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="emission_standard_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.emissionStandardName != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.emissionStandardName,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="standard_num = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.standardNum != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.standardNum,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="receiving_water_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.receivingWaterName != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.receivingWaterName,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="monitoring_class = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.monitoringClass != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.monitoringClass,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="flow = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.flow != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.flow,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="production_load = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.productionLoad != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.productionLoad,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="concentration = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.concentration != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.concentration,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="upper_value = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.upperValue != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.upperValue,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="lower_value = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.lowerValue != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.lowerValue,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="unit = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.unit != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.unit,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="exceeding_standard = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.exceedingStandard != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.exceedingStandard,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="exceeding_multiple = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.exceedingMultiple != null">
            when data_id = #{item.dataId,jdbcType=OTHER} then #{item.exceedingMultiple,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
    </trim>
    where data_id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.dataId,jdbcType=OTHER}
    </foreach>
  </update>
  <insert id="batchInsert" parameterType="map">
    <!--@mbg.generated-->
    insert into s_ra_low_monitoring_water
    (data_id, factory_id, factory_name, industry_category_name, industry_category_code, 
      district_name, district_code, monitor_time, moitor_name, monitor_id, monitoring_type, 
      emission_standard_name, standard_num, receiving_water_name, monitoring_class, flow, 
      production_load, concentration, upper_value, lower_value, unit, exceeding_standard, 
      exceeding_multiple)
    values
    <foreach collection="list" item="item" separator=",">
      (#{item.dataId,jdbcType=OTHER}, #{item.factoryId,jdbcType=VARCHAR}, #{item.factoryName,jdbcType=VARCHAR}, 
        #{item.industryCategoryName,jdbcType=VARCHAR}, #{item.industryCategoryCode,jdbcType=VARCHAR}, 
        #{item.districtName,jdbcType=VARCHAR}, #{item.districtCode,jdbcType=VARCHAR}, #{item.monitorTime,jdbcType=TIMESTAMP}, 
        #{item.moitorName,jdbcType=VARCHAR}, #{item.monitorId,jdbcType=VARCHAR}, #{item.monitoringType,jdbcType=VARCHAR}, 
        #{item.emissionStandardName,jdbcType=VARCHAR}, #{item.standardNum,jdbcType=VARCHAR},
        #{item.receivingWaterName,jdbcType=VARCHAR}, #{item.monitoringClass,jdbcType=VARCHAR}, 
        #{item.flow,jdbcType=VARCHAR}, #{item.productionLoad,jdbcType=VARCHAR}, #{item.concentration,jdbcType=VARCHAR}, 
        #{item.upperValue,jdbcType=VARCHAR}, #{item.lowerValue,jdbcType=VARCHAR}, #{item.unit,jdbcType=VARCHAR}, 
        #{item.exceedingStandard,jdbcType=VARCHAR}, #{item.exceedingMultiple,jdbcType=VARCHAR}
        )
    </foreach>
  </insert>
</mapper>