<?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.tanpu.fund.mapper.generator.CompanyTnaPersonnelMapper">
  <resultMap id="BaseResultMap" type="com.tanpu.fund.entity.generator.CompanyTnaPersonnel">
    <!--@mbg.generated-->
    <!--@Table company_tna_personnel-->
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="company_id" jdbcType="VARCHAR" property="companyId" />
    <result column="stat_date" jdbcType="DATE" property="statDate" />
    <result column="trust_fund_asset_size" jdbcType="DECIMAL" property="trustFundAssetSize" />
    <result column="special_account_asset_size" jdbcType="DECIMAL" property="specialAccountAssetSize" />
    <result column="ltdco_fund_asset_size" jdbcType="DECIMAL" property="ltdcoFundAssetSize" />
    <result column="offshore_fund_asset_size" jdbcType="DECIMAL" property="offshoreFundAssetSize" />
    <result column="fund_num" jdbcType="INTEGER" property="fundNum" />
    <result column="staff_num" jdbcType="INTEGER" property="staffNum" />
    <result column="analyst_num" jdbcType="INTEGER" property="analystNum" />
    <result column="total_asset_size" jdbcType="DECIMAL" property="totalAssetSize" />
    <result column="create_by" jdbcType="VARCHAR" property="createBy" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="delete_tag" jdbcType="INTEGER" property="deleteTag" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--@mbg.generated-->
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <!--@mbg.generated-->
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, company_id, stat_date, trust_fund_asset_size, special_account_asset_size, ltdco_fund_asset_size, 
    offshore_fund_asset_size, fund_num, staff_num, analyst_num, total_asset_size, create_by, 
    create_time, update_by, update_time, delete_tag
  </sql>
  <select id="selectByExample" parameterType="com.tanpu.fund.entity.generator.CompanyTnaPersonnelExample" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from company_tna_personnel
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select 
    <include refid="Base_Column_List" />
    from company_tna_personnel
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--@mbg.generated-->
    delete from company_tna_personnel
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.tanpu.fund.entity.generator.CompanyTnaPersonnelExample">
    <!--@mbg.generated-->
    delete from company_tna_personnel
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.tanpu.fund.entity.generator.CompanyTnaPersonnel">
    <!--@mbg.generated-->
    insert into company_tna_personnel (id, company_id, stat_date, 
      trust_fund_asset_size, special_account_asset_size, 
      ltdco_fund_asset_size, offshore_fund_asset_size, 
      fund_num, staff_num, analyst_num, 
      total_asset_size, create_by, create_time, 
      update_by, update_time, delete_tag
      )
    values (#{id,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{statDate,jdbcType=DATE}, 
      #{trustFundAssetSize,jdbcType=DECIMAL}, #{specialAccountAssetSize,jdbcType=DECIMAL}, 
      #{ltdcoFundAssetSize,jdbcType=DECIMAL}, #{offshoreFundAssetSize,jdbcType=DECIMAL}, 
      #{fundNum,jdbcType=INTEGER}, #{staffNum,jdbcType=INTEGER}, #{analystNum,jdbcType=INTEGER}, 
      #{totalAssetSize,jdbcType=DECIMAL}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{deleteTag,jdbcType=INTEGER}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.tanpu.fund.entity.generator.CompanyTnaPersonnel">
    <!--@mbg.generated-->
    insert into company_tna_personnel
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="companyId != null">
        company_id,
      </if>
      <if test="statDate != null">
        stat_date,
      </if>
      <if test="trustFundAssetSize != null">
        trust_fund_asset_size,
      </if>
      <if test="specialAccountAssetSize != null">
        special_account_asset_size,
      </if>
      <if test="ltdcoFundAssetSize != null">
        ltdco_fund_asset_size,
      </if>
      <if test="offshoreFundAssetSize != null">
        offshore_fund_asset_size,
      </if>
      <if test="fundNum != null">
        fund_num,
      </if>
      <if test="staffNum != null">
        staff_num,
      </if>
      <if test="analystNum != null">
        analyst_num,
      </if>
      <if test="totalAssetSize != null">
        total_asset_size,
      </if>
      <if test="createBy != null">
        create_by,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateBy != null">
        update_by,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="deleteTag != null">
        delete_tag,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="companyId != null">
        #{companyId,jdbcType=VARCHAR},
      </if>
      <if test="statDate != null">
        #{statDate,jdbcType=DATE},
      </if>
      <if test="trustFundAssetSize != null">
        #{trustFundAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="specialAccountAssetSize != null">
        #{specialAccountAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="ltdcoFundAssetSize != null">
        #{ltdcoFundAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="offshoreFundAssetSize != null">
        #{offshoreFundAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="fundNum != null">
        #{fundNum,jdbcType=INTEGER},
      </if>
      <if test="staffNum != null">
        #{staffNum,jdbcType=INTEGER},
      </if>
      <if test="analystNum != null">
        #{analystNum,jdbcType=INTEGER},
      </if>
      <if test="totalAssetSize != null">
        #{totalAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="createBy != null">
        #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null">
        #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteTag != null">
        #{deleteTag,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.tanpu.fund.entity.generator.CompanyTnaPersonnelExample" resultType="java.lang.Long">
    <!--@mbg.generated-->
    select count(*) from company_tna_personnel
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--@mbg.generated-->
    update company_tna_personnel
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.companyId != null">
        company_id = #{record.companyId,jdbcType=VARCHAR},
      </if>
      <if test="record.statDate != null">
        stat_date = #{record.statDate,jdbcType=DATE},
      </if>
      <if test="record.trustFundAssetSize != null">
        trust_fund_asset_size = #{record.trustFundAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="record.specialAccountAssetSize != null">
        special_account_asset_size = #{record.specialAccountAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="record.ltdcoFundAssetSize != null">
        ltdco_fund_asset_size = #{record.ltdcoFundAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="record.offshoreFundAssetSize != null">
        offshore_fund_asset_size = #{record.offshoreFundAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="record.fundNum != null">
        fund_num = #{record.fundNum,jdbcType=INTEGER},
      </if>
      <if test="record.staffNum != null">
        staff_num = #{record.staffNum,jdbcType=INTEGER},
      </if>
      <if test="record.analystNum != null">
        analyst_num = #{record.analystNum,jdbcType=INTEGER},
      </if>
      <if test="record.totalAssetSize != null">
        total_asset_size = #{record.totalAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="record.createBy != null">
        create_by = #{record.createBy,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateBy != null">
        update_by = #{record.updateBy,jdbcType=VARCHAR},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.deleteTag != null">
        delete_tag = #{record.deleteTag,jdbcType=INTEGER},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--@mbg.generated-->
    update company_tna_personnel
    set id = #{record.id,jdbcType=VARCHAR},
      company_id = #{record.companyId,jdbcType=VARCHAR},
      stat_date = #{record.statDate,jdbcType=DATE},
      trust_fund_asset_size = #{record.trustFundAssetSize,jdbcType=DECIMAL},
      special_account_asset_size = #{record.specialAccountAssetSize,jdbcType=DECIMAL},
      ltdco_fund_asset_size = #{record.ltdcoFundAssetSize,jdbcType=DECIMAL},
      offshore_fund_asset_size = #{record.offshoreFundAssetSize,jdbcType=DECIMAL},
      fund_num = #{record.fundNum,jdbcType=INTEGER},
      staff_num = #{record.staffNum,jdbcType=INTEGER},
      analyst_num = #{record.analystNum,jdbcType=INTEGER},
      total_asset_size = #{record.totalAssetSize,jdbcType=DECIMAL},
      create_by = #{record.createBy,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_by = #{record.updateBy,jdbcType=VARCHAR},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      delete_tag = #{record.deleteTag,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.tanpu.fund.entity.generator.CompanyTnaPersonnel">
    <!--@mbg.generated-->
    update company_tna_personnel
    <set>
      <if test="companyId != null">
        company_id = #{companyId,jdbcType=VARCHAR},
      </if>
      <if test="statDate != null">
        stat_date = #{statDate,jdbcType=DATE},
      </if>
      <if test="trustFundAssetSize != null">
        trust_fund_asset_size = #{trustFundAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="specialAccountAssetSize != null">
        special_account_asset_size = #{specialAccountAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="ltdcoFundAssetSize != null">
        ltdco_fund_asset_size = #{ltdcoFundAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="offshoreFundAssetSize != null">
        offshore_fund_asset_size = #{offshoreFundAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="fundNum != null">
        fund_num = #{fundNum,jdbcType=INTEGER},
      </if>
      <if test="staffNum != null">
        staff_num = #{staffNum,jdbcType=INTEGER},
      </if>
      <if test="analystNum != null">
        analyst_num = #{analystNum,jdbcType=INTEGER},
      </if>
      <if test="totalAssetSize != null">
        total_asset_size = #{totalAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="createBy != null">
        create_by = #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null">
        update_by = #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteTag != null">
        delete_tag = #{deleteTag,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.tanpu.fund.entity.generator.CompanyTnaPersonnel">
    <!--@mbg.generated-->
    update company_tna_personnel
    set company_id = #{companyId,jdbcType=VARCHAR},
      stat_date = #{statDate,jdbcType=DATE},
      trust_fund_asset_size = #{trustFundAssetSize,jdbcType=DECIMAL},
      special_account_asset_size = #{specialAccountAssetSize,jdbcType=DECIMAL},
      ltdco_fund_asset_size = #{ltdcoFundAssetSize,jdbcType=DECIMAL},
      offshore_fund_asset_size = #{offshoreFundAssetSize,jdbcType=DECIMAL},
      fund_num = #{fundNum,jdbcType=INTEGER},
      staff_num = #{staffNum,jdbcType=INTEGER},
      analyst_num = #{analystNum,jdbcType=INTEGER},
      total_asset_size = #{totalAssetSize,jdbcType=DECIMAL},
      create_by = #{createBy,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_by = #{updateBy,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      delete_tag = #{deleteTag,jdbcType=INTEGER}
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateBatch" parameterType="java.util.List">
    <!--@mbg.generated-->
    update company_tna_personnel
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="company_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.companyId,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="stat_date = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.statDate,jdbcType=DATE}
        </foreach>
      </trim>
      <trim prefix="trust_fund_asset_size = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.trustFundAssetSize,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="special_account_asset_size = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.specialAccountAssetSize,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="ltdco_fund_asset_size = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.ltdcoFundAssetSize,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="offshore_fund_asset_size = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.offshoreFundAssetSize,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="fund_num = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.fundNum,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="staff_num = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.staffNum,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="analyst_num = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.analystNum,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="total_asset_size = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.totalAssetSize,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="create_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.createBy,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="create_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
        </foreach>
      </trim>
      <trim prefix="update_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.updateBy,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="update_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
        </foreach>
      </trim>
      <trim prefix="delete_tag = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=VARCHAR} then #{item.deleteTag,jdbcType=INTEGER}
        </foreach>
      </trim>
    </trim>
    where id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.id,jdbcType=VARCHAR}
    </foreach>
  </update>
  <update id="updateBatchSelective" parameterType="java.util.List">
    <!--@mbg.generated-->
    update company_tna_personnel
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="company_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.companyId != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.companyId,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="stat_date = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.statDate != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.statDate,jdbcType=DATE}
          </if>
        </foreach>
      </trim>
      <trim prefix="trust_fund_asset_size = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.trustFundAssetSize != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.trustFundAssetSize,jdbcType=DECIMAL}
          </if>
        </foreach>
      </trim>
      <trim prefix="special_account_asset_size = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.specialAccountAssetSize != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.specialAccountAssetSize,jdbcType=DECIMAL}
          </if>
        </foreach>
      </trim>
      <trim prefix="ltdco_fund_asset_size = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.ltdcoFundAssetSize != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.ltdcoFundAssetSize,jdbcType=DECIMAL}
          </if>
        </foreach>
      </trim>
      <trim prefix="offshore_fund_asset_size = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.offshoreFundAssetSize != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.offshoreFundAssetSize,jdbcType=DECIMAL}
          </if>
        </foreach>
      </trim>
      <trim prefix="fund_num = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.fundNum != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.fundNum,jdbcType=INTEGER}
          </if>
        </foreach>
      </trim>
      <trim prefix="staff_num = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.staffNum != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.staffNum,jdbcType=INTEGER}
          </if>
        </foreach>
      </trim>
      <trim prefix="analyst_num = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.analystNum != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.analystNum,jdbcType=INTEGER}
          </if>
        </foreach>
      </trim>
      <trim prefix="total_asset_size = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.totalAssetSize != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.totalAssetSize,jdbcType=DECIMAL}
          </if>
        </foreach>
      </trim>
      <trim prefix="create_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.createBy != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.createBy,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=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
          </if>
        </foreach>
      </trim>
      <trim prefix="update_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.updateBy != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.updateBy,jdbcType=VARCHAR}
          </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=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
          </if>
        </foreach>
      </trim>
      <trim prefix="delete_tag = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.deleteTag != null">
            when id = #{item.id,jdbcType=VARCHAR} then #{item.deleteTag,jdbcType=INTEGER}
          </if>
        </foreach>
      </trim>
    </trim>
    where id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.id,jdbcType=VARCHAR}
    </foreach>
  </update>
  <insert id="batchInsert" parameterType="map">
    <!--@mbg.generated-->
    insert into company_tna_personnel
    (id, company_id, stat_date, trust_fund_asset_size, special_account_asset_size, ltdco_fund_asset_size, 
      offshore_fund_asset_size, fund_num, staff_num, analyst_num, total_asset_size, create_by, 
      create_time, update_by, update_time, delete_tag)
    values
    <foreach collection="list" item="item" separator=",">
      (#{item.id,jdbcType=VARCHAR}, #{item.companyId,jdbcType=VARCHAR}, #{item.statDate,jdbcType=DATE}, 
        #{item.trustFundAssetSize,jdbcType=DECIMAL}, #{item.specialAccountAssetSize,jdbcType=DECIMAL}, 
        #{item.ltdcoFundAssetSize,jdbcType=DECIMAL}, #{item.offshoreFundAssetSize,jdbcType=DECIMAL}, 
        #{item.fundNum,jdbcType=INTEGER}, #{item.staffNum,jdbcType=INTEGER}, #{item.analystNum,jdbcType=INTEGER}, 
        #{item.totalAssetSize,jdbcType=DECIMAL}, #{item.createBy,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, 
        #{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.deleteTag,jdbcType=INTEGER}
        )
    </foreach>
  </insert>
  <insert id="insertOrUpdate" parameterType="com.tanpu.fund.entity.generator.CompanyTnaPersonnel">
    <!--@mbg.generated-->
    insert into company_tna_personnel
    (id, company_id, stat_date, trust_fund_asset_size, special_account_asset_size, ltdco_fund_asset_size, 
      offshore_fund_asset_size, fund_num, staff_num, analyst_num, total_asset_size, create_by, 
      create_time, update_by, update_time, delete_tag)
    values
    (#{id,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{statDate,jdbcType=DATE}, 
      #{trustFundAssetSize,jdbcType=DECIMAL}, #{specialAccountAssetSize,jdbcType=DECIMAL}, 
      #{ltdcoFundAssetSize,jdbcType=DECIMAL}, #{offshoreFundAssetSize,jdbcType=DECIMAL}, 
      #{fundNum,jdbcType=INTEGER}, #{staffNum,jdbcType=INTEGER}, #{analystNum,jdbcType=INTEGER}, 
      #{totalAssetSize,jdbcType=DECIMAL}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{deleteTag,jdbcType=INTEGER}
      )
    on duplicate key update 
    id = #{id,jdbcType=VARCHAR}, 
    company_id = #{companyId,jdbcType=VARCHAR}, 
    stat_date = #{statDate,jdbcType=DATE}, 
    trust_fund_asset_size = #{trustFundAssetSize,jdbcType=DECIMAL}, 
    special_account_asset_size = #{specialAccountAssetSize,jdbcType=DECIMAL}, 
    ltdco_fund_asset_size = #{ltdcoFundAssetSize,jdbcType=DECIMAL}, 
    offshore_fund_asset_size = #{offshoreFundAssetSize,jdbcType=DECIMAL}, 
    fund_num = #{fundNum,jdbcType=INTEGER}, 
    staff_num = #{staffNum,jdbcType=INTEGER}, 
    analyst_num = #{analystNum,jdbcType=INTEGER}, 
    total_asset_size = #{totalAssetSize,jdbcType=DECIMAL}, 
    create_by = #{createBy,jdbcType=VARCHAR}, 
    create_time = #{createTime,jdbcType=TIMESTAMP}, 
    update_by = #{updateBy,jdbcType=VARCHAR}, 
    update_time = #{updateTime,jdbcType=TIMESTAMP}, 
    delete_tag = #{deleteTag,jdbcType=INTEGER}
  </insert>
  <insert id="insertOrUpdateSelective" parameterType="com.tanpu.fund.entity.generator.CompanyTnaPersonnel">
    <!--@mbg.generated-->
    insert into company_tna_personnel
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="companyId != null">
        company_id,
      </if>
      <if test="statDate != null">
        stat_date,
      </if>
      <if test="trustFundAssetSize != null">
        trust_fund_asset_size,
      </if>
      <if test="specialAccountAssetSize != null">
        special_account_asset_size,
      </if>
      <if test="ltdcoFundAssetSize != null">
        ltdco_fund_asset_size,
      </if>
      <if test="offshoreFundAssetSize != null">
        offshore_fund_asset_size,
      </if>
      <if test="fundNum != null">
        fund_num,
      </if>
      <if test="staffNum != null">
        staff_num,
      </if>
      <if test="analystNum != null">
        analyst_num,
      </if>
      <if test="totalAssetSize != null">
        total_asset_size,
      </if>
      <if test="createBy != null">
        create_by,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateBy != null">
        update_by,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="deleteTag != null">
        delete_tag,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="companyId != null">
        #{companyId,jdbcType=VARCHAR},
      </if>
      <if test="statDate != null">
        #{statDate,jdbcType=DATE},
      </if>
      <if test="trustFundAssetSize != null">
        #{trustFundAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="specialAccountAssetSize != null">
        #{specialAccountAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="ltdcoFundAssetSize != null">
        #{ltdcoFundAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="offshoreFundAssetSize != null">
        #{offshoreFundAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="fundNum != null">
        #{fundNum,jdbcType=INTEGER},
      </if>
      <if test="staffNum != null">
        #{staffNum,jdbcType=INTEGER},
      </if>
      <if test="analystNum != null">
        #{analystNum,jdbcType=INTEGER},
      </if>
      <if test="totalAssetSize != null">
        #{totalAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="createBy != null">
        #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null">
        #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteTag != null">
        #{deleteTag,jdbcType=INTEGER},
      </if>
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="id != null">
        id = #{id,jdbcType=VARCHAR},
      </if>
      <if test="companyId != null">
        company_id = #{companyId,jdbcType=VARCHAR},
      </if>
      <if test="statDate != null">
        stat_date = #{statDate,jdbcType=DATE},
      </if>
      <if test="trustFundAssetSize != null">
        trust_fund_asset_size = #{trustFundAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="specialAccountAssetSize != null">
        special_account_asset_size = #{specialAccountAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="ltdcoFundAssetSize != null">
        ltdco_fund_asset_size = #{ltdcoFundAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="offshoreFundAssetSize != null">
        offshore_fund_asset_size = #{offshoreFundAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="fundNum != null">
        fund_num = #{fundNum,jdbcType=INTEGER},
      </if>
      <if test="staffNum != null">
        staff_num = #{staffNum,jdbcType=INTEGER},
      </if>
      <if test="analystNum != null">
        analyst_num = #{analystNum,jdbcType=INTEGER},
      </if>
      <if test="totalAssetSize != null">
        total_asset_size = #{totalAssetSize,jdbcType=DECIMAL},
      </if>
      <if test="createBy != null">
        create_by = #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null">
        update_by = #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="deleteTag != null">
        delete_tag = #{deleteTag,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
</mapper>