<?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.BStatTablePwxkProductionFacilitiesParamsMapper">
  <resultMap id="BaseResultMap" type="cn.cecep.talroad.domain.BStatTablePwxkProductionFacilitiesParams">
    <!--@mbg.generated-->
    <!--@Table b_stat_table_pwxk_production_facilities_params-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="facilities_id" jdbcType="VARCHAR" property="facilitiesId" />
    <result column="params_name" jdbcType="VARCHAR" property="paramsName" />
    <result column="params_unit" jdbcType="VARCHAR" property="paramsUnit" />
    <result column="design_values" jdbcType="VARCHAR" property="designValues" />
    <result column="other_params_info" jdbcType="VARCHAR" property="otherParamsInfo" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, facilities_id, params_name, params_unit, design_values, other_params_info
  </sql>
  <update id="updateBatch" parameterType="java.util.List">
    <!--@mbg.generated-->
    update b_stat_table_pwxk_production_facilities_params
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="facilities_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.facilitiesId,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="params_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.paramsName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="params_unit = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.paramsUnit,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="design_values = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.designValues,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="other_params_info = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.otherParamsInfo,jdbcType=VARCHAR}
        </foreach>
      </trim>
    </trim>
    where id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.id,jdbcType=BIGINT}
    </foreach>
  </update>
  <update id="updateBatchSelective" parameterType="java.util.List">
    <!--@mbg.generated-->
    update b_stat_table_pwxk_production_facilities_params
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="facilities_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.facilitiesId != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.facilitiesId,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="params_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.paramsName != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.paramsName,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="params_unit = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.paramsUnit != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.paramsUnit,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="design_values = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.designValues != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.designValues,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="other_params_info = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.otherParamsInfo != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.otherParamsInfo,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
    </trim>
    where id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.id,jdbcType=BIGINT}
    </foreach>
  </update>
  <insert id="batchInsert" parameterType="map">
    <!--@mbg.generated-->
    insert into b_stat_table_pwxk_production_facilities_params
    (id, facilities_id, params_name, params_unit, design_values, other_params_info)
    values
    <foreach collection="list" item="item" separator=",">
      (#{item.id,jdbcType=BIGINT}, #{item.facilitiesId,jdbcType=VARCHAR}, #{item.paramsName,jdbcType=VARCHAR}, 
        #{item.paramsUnit,jdbcType=VARCHAR}, #{item.designValues,jdbcType=VARCHAR}, #{item.otherParamsInfo,jdbcType=VARCHAR}
        )
    </foreach>
  </insert>
</mapper>