<?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.BasModelAnalyseMapper">
  <resultMap id="BaseResultMap" type="cn.cecep.talroad.domain.BasModelAnalyse">
    <!--@mbg.generated-->
    <!--@Table bas_model_analyse-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="model_name" jdbcType="VARCHAR" property="modelName" />
    <result column="param_name" jdbcType="VARCHAR" property="paramName" />
    <result column="param_abbr" jdbcType="VARCHAR" property="paramAbbr" />
    <result column="value" jdbcType="DOUBLE" property="value" />
    <result column="recommend_value" jdbcType="VARCHAR" property="recommendValue" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <result column="delete_status" jdbcType="VARCHAR" property="deleteStatus" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, model_name, param_name, param_abbr, "value", recommend_value, remarks, delete_status, 
    create_time
  </sql>
  <update id="updateBatch" parameterType="java.util.List">
    <!--@mbg.generated-->
    update bas_model_analyse
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="model_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.modelName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="param_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.paramName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="param_abbr = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.paramAbbr,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="&quot;value&quot; = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.value,jdbcType=DOUBLE}
        </foreach>
      </trim>
      <trim prefix="recommend_value = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.recommendValue,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="remarks = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.remarks,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="delete_status = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.deleteStatus,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="create_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.createTime,jdbcType=TIMESTAMP}
        </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 bas_model_analyse
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="model_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.modelName != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.modelName,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="param_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.paramName != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.paramName,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="param_abbr = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.paramAbbr != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.paramAbbr,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="&quot;value&quot; = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.value != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.value,jdbcType=DOUBLE}
          </if>
        </foreach>
      </trim>
      <trim prefix="recommend_value = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.recommendValue != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.recommendValue,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="remarks = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.remarks != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.remarks,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="delete_status = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.deleteStatus != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.deleteStatus,jdbcType=VARCHAR}
          </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=BIGINT} then #{item.createTime,jdbcType=TIMESTAMP}
          </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 bas_model_analyse
    (id, model_name, param_name, param_abbr, "value", recommend_value, remarks, delete_status, 
      create_time)
    values
    <foreach collection="list" item="item" separator=",">
      (#{item.id,jdbcType=BIGINT}, #{item.modelName,jdbcType=VARCHAR}, #{item.paramName,jdbcType=VARCHAR}, 
        #{item.paramAbbr,jdbcType=VARCHAR}, #{item.value,jdbcType=DOUBLE}, #{item.recommendValue,jdbcType=VARCHAR}, 
        #{item.remarks,jdbcType=VARCHAR}, #{item.deleteStatus,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}
        )
    </foreach>
  </insert>
</mapper>