<?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.effective.ERmStationHourMapper">
  <resultMap id="BaseResultMap" type="cn.cecep.talroad.domain.effective.ERmStationHour">
    <!--@mbg.generated-->
    <!--@Table e_rm_station_hour-->
    <id column="id" jdbcType="OTHER" property="id" />
    <result column="station_name" jdbcType="VARCHAR" property="stationName" />
    <result column="station_code" jdbcType="VARCHAR" property="stationCode" />
    <result column="station_type" jdbcType="VARCHAR" property="stationType" />
    <result column="station_region_name" jdbcType="VARCHAR" property="stationRegionName" />
    <result column="longitude" jdbcType="VARCHAR" property="longitude" />
    <result column="latitude" jdbcType="VARCHAR" property="latitude" />
    <result column="pm25" jdbcType="VARCHAR" property="pm25" />
    <result column="pm10" jdbcType="VARCHAR" property="pm10" />
    <result column="so2" jdbcType="VARCHAR" property="so2" />
    <result column="no2" jdbcType="VARCHAR" property="no2" />
    <result column="co" jdbcType="VARCHAR" property="co" />
    <result column="o3" jdbcType="VARCHAR" property="o3" />
    <result column="temperature" jdbcType="VARCHAR" property="temperature" />
    <result column="humidity" jdbcType="VARCHAR" property="humidity" />
    <result column="wind_direction" jdbcType="VARCHAR" property="windDirection" />
    <result column="wind_speed" jdbcType="DOUBLE" property="windSpeed" />
    <result column="barometric_pressure" jdbcType="VARCHAR" property="barometricPressure" />
    <result column="aqi" jdbcType="VARCHAR" property="aqi" />
    <result column="pollutant" jdbcType="VARCHAR" property="pollutant" />
    <result column="air_qualityclass" jdbcType="VARCHAR" property="airQualityclass" />
    <result column="data_time" jdbcType="TIMESTAMP" property="dataTime" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, station_name, station_code, station_type, station_region_name, longitude, latitude, 
    pm25, pm10, so2, no2, co, o3, temperature, humidity, wind_direction, wind_speed, 
    barometric_pressure, aqi, pollutant, air_qualityclass, data_time, create_time, update_time
  </sql>
  <update id="updateBatch" parameterType="java.util.List">
    <!--@mbg.generated-->
    update e_rm_station_hour
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="station_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.stationName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="station_code = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.stationCode,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="station_type = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.stationType,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="station_region_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.stationRegionName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="longitude = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.longitude,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="latitude = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.latitude,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="pm25 = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.pm25,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="pm10 = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.pm10,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="so2 = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.so2,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="no2 = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.no2,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="co = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.co,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="o3 = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.o3,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="temperature = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.temperature,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="humidity = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.humidity,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="wind_direction = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.windDirection,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="wind_speed = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.windSpeed,jdbcType=DOUBLE}
        </foreach>
      </trim>
      <trim prefix="barometric_pressure = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.barometricPressure,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="aqi = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.aqi,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="pollutant = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.pollutant,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="air_qualityclass = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.airQualityclass,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="data_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.dataTime,jdbcType=TIMESTAMP}
        </foreach>
      </trim>
      <trim prefix="create_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.createTime,jdbcType=TIMESTAMP}
        </foreach>
      </trim>
      <trim prefix="update_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=OTHER} then #{item.updateTime,jdbcType=TIMESTAMP}
        </foreach>
      </trim>
    </trim>
    where id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.id,jdbcType=OTHER}
    </foreach>
  </update>
  <update id="updateBatchSelective" parameterType="java.util.List">
    <!--@mbg.generated-->
    update e_rm_station_hour
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="station_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.stationName != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.stationName,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="station_code = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.stationCode != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.stationCode,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="station_type = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.stationType != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.stationType,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="station_region_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.stationRegionName != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.stationRegionName,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="longitude = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.longitude != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.longitude,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="latitude = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.latitude != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.latitude,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="pm25 = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.pm25 != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.pm25,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="pm10 = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.pm10 != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.pm10,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="so2 = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.so2 != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.so2,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="no2 = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.no2 != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.no2,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="co = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.co != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.co,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="o3 = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.o3 != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.o3,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="temperature = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.temperature != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.temperature,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="humidity = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.humidity != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.humidity,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="wind_direction = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.windDirection != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.windDirection,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="wind_speed = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.windSpeed != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.windSpeed,jdbcType=DOUBLE}
          </if>
        </foreach>
      </trim>
      <trim prefix="barometric_pressure = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.barometricPressure != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.barometricPressure,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="aqi = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.aqi != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.aqi,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="pollutant = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.pollutant != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.pollutant,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="air_qualityclass = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.airQualityclass != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.airQualityclass,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="data_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.dataTime != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.dataTime,jdbcType=TIMESTAMP}
          </if>
        </foreach>
      </trim>
      <trim prefix="create_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.createTime != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.createTime,jdbcType=TIMESTAMP}
          </if>
        </foreach>
      </trim>
      <trim prefix="update_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.updateTime != null">
            when id = #{item.id,jdbcType=OTHER} then #{item.updateTime,jdbcType=TIMESTAMP}
          </if>
        </foreach>
      </trim>
    </trim>
    where id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.id,jdbcType=OTHER}
    </foreach>
  </update>
  <insert id="batchInsert" parameterType="map">
    <!--@mbg.generated-->
    insert into e_rm_station_hour
    (id, station_name, station_code, station_type, station_region_name, longitude, latitude, 
      pm25, pm10, so2, no2, co, o3, temperature, humidity, wind_direction, wind_speed, 
      barometric_pressure, aqi, pollutant, air_qualityclass, data_time, create_time, 
      update_time)
    values
    <foreach collection="list" item="item" separator=",">
      (#{item.id,jdbcType=OTHER}, #{item.stationName,jdbcType=VARCHAR}, #{item.stationCode,jdbcType=VARCHAR}, 
        #{item.stationType,jdbcType=VARCHAR}, #{item.stationRegionName,jdbcType=VARCHAR}, 
        #{item.longitude,jdbcType=VARCHAR}, #{item.latitude,jdbcType=VARCHAR}, #{item.pm25,jdbcType=VARCHAR}, 
        #{item.pm10,jdbcType=VARCHAR}, #{item.so2,jdbcType=VARCHAR}, #{item.no2,jdbcType=VARCHAR}, 
        #{item.co,jdbcType=VARCHAR}, #{item.o3,jdbcType=VARCHAR}, #{item.temperature,jdbcType=VARCHAR}, 
        #{item.humidity,jdbcType=VARCHAR}, #{item.windDirection,jdbcType=VARCHAR}, #{item.windSpeed,jdbcType=DOUBLE}, 
        #{item.barometricPressure,jdbcType=VARCHAR}, #{item.aqi,jdbcType=VARCHAR}, #{item.pollutant,jdbcType=VARCHAR}, 
        #{item.airQualityclass,jdbcType=VARCHAR}, #{item.dataTime,jdbcType=TIMESTAMP}, 
        #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP})
    </foreach>
  </insert>
</mapper>