<?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.TxTop10StockMapper">
  <resultMap id="BaseResultMap" type="com.tanpu.fund.entity.generator.TxTop10Stock">
    <!--@mbg.generated-->
    <!--@Table tx_top10_stock-->
    <id column="s_row_version" jdbcType="BIGINT" property="sRowVersion" />
    <result column="fund_id" jdbcType="INTEGER" property="fundId" />
    <result column="fund_code" jdbcType="INTEGER" property="fundCode" />
    <result column="fund_short_name" jdbcType="VARCHAR" property="fundShortName" />
    <result column="report_id" jdbcType="INTEGER" property="reportId" />
    <result column="ann_date" jdbcType="DATE" property="annDate" />
    <result column="start_date" jdbcType="DATE" property="startDate" />
    <result column="end_date" jdbcType="DATE" property="endDate" />
    <result column="data_source" jdbcType="VARCHAR" property="dataSource" />
    <result column="is_new" jdbcType="INTEGER" property="isNew" />
    <result column="type_id" jdbcType="INTEGER" property="typeId" />
    <result column="type_name" jdbcType="VARCHAR" property="typeName" />
    <result column="no" jdbcType="INTEGER" property="no" />
    <result column="stock_code" jdbcType="INTEGER" property="stockCode" />
    <result column="hold_share" jdbcType="DECIMAL" property="holdShare" />
    <result column="hold_value" jdbcType="DECIMAL" property="holdValue" />
    <result column="value_rank" jdbcType="INTEGER" property="valueRank" />
    <result column="net_ratio" jdbcType="DECIMAL" property="netRatio" />
    <result column="share_ratio" jdbcType="DECIMAL" property="shareRatio" />
    <result column="value_ratio" jdbcType="DECIMAL" property="valueRatio" />
    <result column="unname" jdbcType="INTEGER" property="unname" />
    <result column="stock_name" jdbcType="VARCHAR" property="stockName" />
    <result column="s_seg" jdbcType="BIGINT" property="sSeg" />
    <result column="s_update_time" jdbcType="TIMESTAMP" property="sUpdateTime" />
    <result column="s_data_state" jdbcType="INTEGER" property="sDataState" />
  </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-->
    s_row_version, fund_id, fund_code, fund_short_name, report_id, ann_date, start_date, 
    end_date, data_source, is_new, type_id, type_name, `no`, stock_code, hold_share, 
    hold_value, value_rank, net_ratio, share_ratio, value_ratio, unname, stock_name, 
    s_seg, s_update_time, s_data_state
  </sql>
  <select id="selectByExample" parameterType="com.tanpu.fund.entity.generator.TxTop10StockExample" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from tx_top10_stock
    <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.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select 
    <include refid="Base_Column_List" />
    from tx_top10_stock
    where s_row_version = #{sRowVersion,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from tx_top10_stock
    where s_row_version = #{sRowVersion,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.tanpu.fund.entity.generator.TxTop10StockExample">
    <!--@mbg.generated-->
    delete from tx_top10_stock
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.tanpu.fund.entity.generator.TxTop10Stock">
    <!--@mbg.generated-->
    insert into tx_top10_stock (s_row_version, fund_id, fund_code, 
      fund_short_name, report_id, ann_date, 
      start_date, end_date, data_source, 
      is_new, type_id, type_name, 
      `no`, stock_code, hold_share, 
      hold_value, value_rank, net_ratio, 
      share_ratio, value_ratio, unname, 
      stock_name, s_seg, s_update_time, 
      s_data_state)
    values (#{sRowVersion,jdbcType=BIGINT}, #{fundId,jdbcType=INTEGER}, #{fundCode,jdbcType=INTEGER}, 
      #{fundShortName,jdbcType=VARCHAR}, #{reportId,jdbcType=INTEGER}, #{annDate,jdbcType=DATE}, 
      #{startDate,jdbcType=DATE}, #{endDate,jdbcType=DATE}, #{dataSource,jdbcType=VARCHAR}, 
      #{isNew,jdbcType=INTEGER}, #{typeId,jdbcType=INTEGER}, #{typeName,jdbcType=VARCHAR}, 
      #{no,jdbcType=INTEGER}, #{stockCode,jdbcType=INTEGER}, #{holdShare,jdbcType=DECIMAL}, 
      #{holdValue,jdbcType=DECIMAL}, #{valueRank,jdbcType=INTEGER}, #{netRatio,jdbcType=DECIMAL}, 
      #{shareRatio,jdbcType=DECIMAL}, #{valueRatio,jdbcType=DECIMAL}, #{unname,jdbcType=INTEGER}, 
      #{stockName,jdbcType=VARCHAR}, #{sSeg,jdbcType=BIGINT}, #{sUpdateTime,jdbcType=TIMESTAMP}, 
      #{sDataState,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.tanpu.fund.entity.generator.TxTop10Stock">
    <!--@mbg.generated-->
    insert into tx_top10_stock
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="sRowVersion != null">
        s_row_version,
      </if>
      <if test="fundId != null">
        fund_id,
      </if>
      <if test="fundCode != null">
        fund_code,
      </if>
      <if test="fundShortName != null">
        fund_short_name,
      </if>
      <if test="reportId != null">
        report_id,
      </if>
      <if test="annDate != null">
        ann_date,
      </if>
      <if test="startDate != null">
        start_date,
      </if>
      <if test="endDate != null">
        end_date,
      </if>
      <if test="dataSource != null">
        data_source,
      </if>
      <if test="isNew != null">
        is_new,
      </if>
      <if test="typeId != null">
        type_id,
      </if>
      <if test="typeName != null">
        type_name,
      </if>
      <if test="no != null">
        `no`,
      </if>
      <if test="stockCode != null">
        stock_code,
      </if>
      <if test="holdShare != null">
        hold_share,
      </if>
      <if test="holdValue != null">
        hold_value,
      </if>
      <if test="valueRank != null">
        value_rank,
      </if>
      <if test="netRatio != null">
        net_ratio,
      </if>
      <if test="shareRatio != null">
        share_ratio,
      </if>
      <if test="valueRatio != null">
        value_ratio,
      </if>
      <if test="unname != null">
        unname,
      </if>
      <if test="stockName != null">
        stock_name,
      </if>
      <if test="sSeg != null">
        s_seg,
      </if>
      <if test="sUpdateTime != null">
        s_update_time,
      </if>
      <if test="sDataState != null">
        s_data_state,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="sRowVersion != null">
        #{sRowVersion,jdbcType=BIGINT},
      </if>
      <if test="fundId != null">
        #{fundId,jdbcType=INTEGER},
      </if>
      <if test="fundCode != null">
        #{fundCode,jdbcType=INTEGER},
      </if>
      <if test="fundShortName != null">
        #{fundShortName,jdbcType=VARCHAR},
      </if>
      <if test="reportId != null">
        #{reportId,jdbcType=INTEGER},
      </if>
      <if test="annDate != null">
        #{annDate,jdbcType=DATE},
      </if>
      <if test="startDate != null">
        #{startDate,jdbcType=DATE},
      </if>
      <if test="endDate != null">
        #{endDate,jdbcType=DATE},
      </if>
      <if test="dataSource != null">
        #{dataSource,jdbcType=VARCHAR},
      </if>
      <if test="isNew != null">
        #{isNew,jdbcType=INTEGER},
      </if>
      <if test="typeId != null">
        #{typeId,jdbcType=INTEGER},
      </if>
      <if test="typeName != null">
        #{typeName,jdbcType=VARCHAR},
      </if>
      <if test="no != null">
        #{no,jdbcType=INTEGER},
      </if>
      <if test="stockCode != null">
        #{stockCode,jdbcType=INTEGER},
      </if>
      <if test="holdShare != null">
        #{holdShare,jdbcType=DECIMAL},
      </if>
      <if test="holdValue != null">
        #{holdValue,jdbcType=DECIMAL},
      </if>
      <if test="valueRank != null">
        #{valueRank,jdbcType=INTEGER},
      </if>
      <if test="netRatio != null">
        #{netRatio,jdbcType=DECIMAL},
      </if>
      <if test="shareRatio != null">
        #{shareRatio,jdbcType=DECIMAL},
      </if>
      <if test="valueRatio != null">
        #{valueRatio,jdbcType=DECIMAL},
      </if>
      <if test="unname != null">
        #{unname,jdbcType=INTEGER},
      </if>
      <if test="stockName != null">
        #{stockName,jdbcType=VARCHAR},
      </if>
      <if test="sSeg != null">
        #{sSeg,jdbcType=BIGINT},
      </if>
      <if test="sUpdateTime != null">
        #{sUpdateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="sDataState != null">
        #{sDataState,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.tanpu.fund.entity.generator.TxTop10StockExample" resultType="java.lang.Long">
    <!--@mbg.generated-->
    select count(*) from tx_top10_stock
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--@mbg.generated-->
    update tx_top10_stock
    <set>
      <if test="record.sRowVersion != null">
        s_row_version = #{record.sRowVersion,jdbcType=BIGINT},
      </if>
      <if test="record.fundId != null">
        fund_id = #{record.fundId,jdbcType=INTEGER},
      </if>
      <if test="record.fundCode != null">
        fund_code = #{record.fundCode,jdbcType=INTEGER},
      </if>
      <if test="record.fundShortName != null">
        fund_short_name = #{record.fundShortName,jdbcType=VARCHAR},
      </if>
      <if test="record.reportId != null">
        report_id = #{record.reportId,jdbcType=INTEGER},
      </if>
      <if test="record.annDate != null">
        ann_date = #{record.annDate,jdbcType=DATE},
      </if>
      <if test="record.startDate != null">
        start_date = #{record.startDate,jdbcType=DATE},
      </if>
      <if test="record.endDate != null">
        end_date = #{record.endDate,jdbcType=DATE},
      </if>
      <if test="record.dataSource != null">
        data_source = #{record.dataSource,jdbcType=VARCHAR},
      </if>
      <if test="record.isNew != null">
        is_new = #{record.isNew,jdbcType=INTEGER},
      </if>
      <if test="record.typeId != null">
        type_id = #{record.typeId,jdbcType=INTEGER},
      </if>
      <if test="record.typeName != null">
        type_name = #{record.typeName,jdbcType=VARCHAR},
      </if>
      <if test="record.no != null">
        `no` = #{record.no,jdbcType=INTEGER},
      </if>
      <if test="record.stockCode != null">
        stock_code = #{record.stockCode,jdbcType=INTEGER},
      </if>
      <if test="record.holdShare != null">
        hold_share = #{record.holdShare,jdbcType=DECIMAL},
      </if>
      <if test="record.holdValue != null">
        hold_value = #{record.holdValue,jdbcType=DECIMAL},
      </if>
      <if test="record.valueRank != null">
        value_rank = #{record.valueRank,jdbcType=INTEGER},
      </if>
      <if test="record.netRatio != null">
        net_ratio = #{record.netRatio,jdbcType=DECIMAL},
      </if>
      <if test="record.shareRatio != null">
        share_ratio = #{record.shareRatio,jdbcType=DECIMAL},
      </if>
      <if test="record.valueRatio != null">
        value_ratio = #{record.valueRatio,jdbcType=DECIMAL},
      </if>
      <if test="record.unname != null">
        unname = #{record.unname,jdbcType=INTEGER},
      </if>
      <if test="record.stockName != null">
        stock_name = #{record.stockName,jdbcType=VARCHAR},
      </if>
      <if test="record.sSeg != null">
        s_seg = #{record.sSeg,jdbcType=BIGINT},
      </if>
      <if test="record.sUpdateTime != null">
        s_update_time = #{record.sUpdateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.sDataState != null">
        s_data_state = #{record.sDataState,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 tx_top10_stock
    set s_row_version = #{record.sRowVersion,jdbcType=BIGINT},
      fund_id = #{record.fundId,jdbcType=INTEGER},
      fund_code = #{record.fundCode,jdbcType=INTEGER},
      fund_short_name = #{record.fundShortName,jdbcType=VARCHAR},
      report_id = #{record.reportId,jdbcType=INTEGER},
      ann_date = #{record.annDate,jdbcType=DATE},
      start_date = #{record.startDate,jdbcType=DATE},
      end_date = #{record.endDate,jdbcType=DATE},
      data_source = #{record.dataSource,jdbcType=VARCHAR},
      is_new = #{record.isNew,jdbcType=INTEGER},
      type_id = #{record.typeId,jdbcType=INTEGER},
      type_name = #{record.typeName,jdbcType=VARCHAR},
      `no` = #{record.no,jdbcType=INTEGER},
      stock_code = #{record.stockCode,jdbcType=INTEGER},
      hold_share = #{record.holdShare,jdbcType=DECIMAL},
      hold_value = #{record.holdValue,jdbcType=DECIMAL},
      value_rank = #{record.valueRank,jdbcType=INTEGER},
      net_ratio = #{record.netRatio,jdbcType=DECIMAL},
      share_ratio = #{record.shareRatio,jdbcType=DECIMAL},
      value_ratio = #{record.valueRatio,jdbcType=DECIMAL},
      unname = #{record.unname,jdbcType=INTEGER},
      stock_name = #{record.stockName,jdbcType=VARCHAR},
      s_seg = #{record.sSeg,jdbcType=BIGINT},
      s_update_time = #{record.sUpdateTime,jdbcType=TIMESTAMP},
      s_data_state = #{record.sDataState,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.tanpu.fund.entity.generator.TxTop10Stock">
    <!--@mbg.generated-->
    update tx_top10_stock
    <set>
      <if test="fundId != null">
        fund_id = #{fundId,jdbcType=INTEGER},
      </if>
      <if test="fundCode != null">
        fund_code = #{fundCode,jdbcType=INTEGER},
      </if>
      <if test="fundShortName != null">
        fund_short_name = #{fundShortName,jdbcType=VARCHAR},
      </if>
      <if test="reportId != null">
        report_id = #{reportId,jdbcType=INTEGER},
      </if>
      <if test="annDate != null">
        ann_date = #{annDate,jdbcType=DATE},
      </if>
      <if test="startDate != null">
        start_date = #{startDate,jdbcType=DATE},
      </if>
      <if test="endDate != null">
        end_date = #{endDate,jdbcType=DATE},
      </if>
      <if test="dataSource != null">
        data_source = #{dataSource,jdbcType=VARCHAR},
      </if>
      <if test="isNew != null">
        is_new = #{isNew,jdbcType=INTEGER},
      </if>
      <if test="typeId != null">
        type_id = #{typeId,jdbcType=INTEGER},
      </if>
      <if test="typeName != null">
        type_name = #{typeName,jdbcType=VARCHAR},
      </if>
      <if test="no != null">
        `no` = #{no,jdbcType=INTEGER},
      </if>
      <if test="stockCode != null">
        stock_code = #{stockCode,jdbcType=INTEGER},
      </if>
      <if test="holdShare != null">
        hold_share = #{holdShare,jdbcType=DECIMAL},
      </if>
      <if test="holdValue != null">
        hold_value = #{holdValue,jdbcType=DECIMAL},
      </if>
      <if test="valueRank != null">
        value_rank = #{valueRank,jdbcType=INTEGER},
      </if>
      <if test="netRatio != null">
        net_ratio = #{netRatio,jdbcType=DECIMAL},
      </if>
      <if test="shareRatio != null">
        share_ratio = #{shareRatio,jdbcType=DECIMAL},
      </if>
      <if test="valueRatio != null">
        value_ratio = #{valueRatio,jdbcType=DECIMAL},
      </if>
      <if test="unname != null">
        unname = #{unname,jdbcType=INTEGER},
      </if>
      <if test="stockName != null">
        stock_name = #{stockName,jdbcType=VARCHAR},
      </if>
      <if test="sSeg != null">
        s_seg = #{sSeg,jdbcType=BIGINT},
      </if>
      <if test="sUpdateTime != null">
        s_update_time = #{sUpdateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="sDataState != null">
        s_data_state = #{sDataState,jdbcType=INTEGER},
      </if>
    </set>
    where s_row_version = #{sRowVersion,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.tanpu.fund.entity.generator.TxTop10Stock">
    <!--@mbg.generated-->
    update tx_top10_stock
    set fund_id = #{fundId,jdbcType=INTEGER},
      fund_code = #{fundCode,jdbcType=INTEGER},
      fund_short_name = #{fundShortName,jdbcType=VARCHAR},
      report_id = #{reportId,jdbcType=INTEGER},
      ann_date = #{annDate,jdbcType=DATE},
      start_date = #{startDate,jdbcType=DATE},
      end_date = #{endDate,jdbcType=DATE},
      data_source = #{dataSource,jdbcType=VARCHAR},
      is_new = #{isNew,jdbcType=INTEGER},
      type_id = #{typeId,jdbcType=INTEGER},
      type_name = #{typeName,jdbcType=VARCHAR},
      `no` = #{no,jdbcType=INTEGER},
      stock_code = #{stockCode,jdbcType=INTEGER},
      hold_share = #{holdShare,jdbcType=DECIMAL},
      hold_value = #{holdValue,jdbcType=DECIMAL},
      value_rank = #{valueRank,jdbcType=INTEGER},
      net_ratio = #{netRatio,jdbcType=DECIMAL},
      share_ratio = #{shareRatio,jdbcType=DECIMAL},
      value_ratio = #{valueRatio,jdbcType=DECIMAL},
      unname = #{unname,jdbcType=INTEGER},
      stock_name = #{stockName,jdbcType=VARCHAR},
      s_seg = #{sSeg,jdbcType=BIGINT},
      s_update_time = #{sUpdateTime,jdbcType=TIMESTAMP},
      s_data_state = #{sDataState,jdbcType=INTEGER}
    where s_row_version = #{sRowVersion,jdbcType=BIGINT}
  </update>
  <update id="updateBatch" parameterType="java.util.List">
    <!--@mbg.generated-->
    update tx_top10_stock
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="fund_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.fundId,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="fund_code = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.fundCode,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="fund_short_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.fundShortName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="report_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.reportId,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="ann_date = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.annDate,jdbcType=DATE}
        </foreach>
      </trim>
      <trim prefix="start_date = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.startDate,jdbcType=DATE}
        </foreach>
      </trim>
      <trim prefix="end_date = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.endDate,jdbcType=DATE}
        </foreach>
      </trim>
      <trim prefix="data_source = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.dataSource,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="is_new = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.isNew,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="type_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.typeId,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="type_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.typeName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="`no` = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.no,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="stock_code = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.stockCode,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="hold_share = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.holdShare,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="hold_value = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.holdValue,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="value_rank = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.valueRank,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="net_ratio = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.netRatio,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="share_ratio = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.shareRatio,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="value_ratio = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.valueRatio,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="unname = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.unname,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="stock_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.stockName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="s_seg = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.sSeg,jdbcType=BIGINT}
        </foreach>
      </trim>
      <trim prefix="s_update_time = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.sUpdateTime,jdbcType=TIMESTAMP}
        </foreach>
      </trim>
      <trim prefix="s_data_state = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when s_row_version = #{item.sRowVersion,jdbcType=BIGINT} then #{item.sDataState,jdbcType=INTEGER}
        </foreach>
      </trim>
    </trim>
    where s_row_version in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.sRowVersion,jdbcType=BIGINT}
    </foreach>
  </update>
  <insert id="batchInsert" parameterType="map">
    <!--@mbg.generated-->
    insert into tx_top10_stock
    (s_row_version, fund_id, fund_code, fund_short_name, report_id, ann_date, start_date, 
      end_date, data_source, is_new, type_id, type_name, `no`, stock_code, hold_share, 
      hold_value, value_rank, net_ratio, share_ratio, value_ratio, unname, stock_name, 
      s_seg, s_update_time, s_data_state)
    values
    <foreach collection="list" item="item" separator=",">
      (#{item.sRowVersion,jdbcType=BIGINT}, #{item.fundId,jdbcType=INTEGER}, #{item.fundCode,jdbcType=INTEGER}, 
        #{item.fundShortName,jdbcType=VARCHAR}, #{item.reportId,jdbcType=INTEGER}, #{item.annDate,jdbcType=DATE}, 
        #{item.startDate,jdbcType=DATE}, #{item.endDate,jdbcType=DATE}, #{item.dataSource,jdbcType=VARCHAR}, 
        #{item.isNew,jdbcType=INTEGER}, #{item.typeId,jdbcType=INTEGER}, #{item.typeName,jdbcType=VARCHAR}, 
        #{item.no,jdbcType=INTEGER}, #{item.stockCode,jdbcType=INTEGER}, #{item.holdShare,jdbcType=DECIMAL}, 
        #{item.holdValue,jdbcType=DECIMAL}, #{item.valueRank,jdbcType=INTEGER}, #{item.netRatio,jdbcType=DECIMAL}, 
        #{item.shareRatio,jdbcType=DECIMAL}, #{item.valueRatio,jdbcType=DECIMAL}, #{item.unname,jdbcType=INTEGER}, 
        #{item.stockName,jdbcType=VARCHAR}, #{item.sSeg,jdbcType=BIGINT}, #{item.sUpdateTime,jdbcType=TIMESTAMP}, 
        #{item.sDataState,jdbcType=INTEGER})
    </foreach>
  </insert>
  <insert id="insertOrUpdate" parameterType="com.tanpu.fund.entity.generator.TxTop10Stock">
    <!--@mbg.generated-->
    insert into tx_top10_stock
    (s_row_version, fund_id, fund_code, fund_short_name, report_id, ann_date, start_date, 
      end_date, data_source, is_new, type_id, type_name, `no`, stock_code, hold_share, 
      hold_value, value_rank, net_ratio, share_ratio, value_ratio, unname, stock_name, 
      s_seg, s_update_time, s_data_state)
    values
    (#{sRowVersion,jdbcType=BIGINT}, #{fundId,jdbcType=INTEGER}, #{fundCode,jdbcType=INTEGER}, 
      #{fundShortName,jdbcType=VARCHAR}, #{reportId,jdbcType=INTEGER}, #{annDate,jdbcType=DATE}, 
      #{startDate,jdbcType=DATE}, #{endDate,jdbcType=DATE}, #{dataSource,jdbcType=VARCHAR}, 
      #{isNew,jdbcType=INTEGER}, #{typeId,jdbcType=INTEGER}, #{typeName,jdbcType=VARCHAR}, 
      #{no,jdbcType=INTEGER}, #{stockCode,jdbcType=INTEGER}, #{holdShare,jdbcType=DECIMAL}, 
      #{holdValue,jdbcType=DECIMAL}, #{valueRank,jdbcType=INTEGER}, #{netRatio,jdbcType=DECIMAL}, 
      #{shareRatio,jdbcType=DECIMAL}, #{valueRatio,jdbcType=DECIMAL}, #{unname,jdbcType=INTEGER}, 
      #{stockName,jdbcType=VARCHAR}, #{sSeg,jdbcType=BIGINT}, #{sUpdateTime,jdbcType=TIMESTAMP}, 
      #{sDataState,jdbcType=INTEGER})
    on duplicate key update 
    s_row_version = #{sRowVersion,jdbcType=BIGINT}, 
    fund_id = #{fundId,jdbcType=INTEGER}, 
    fund_code = #{fundCode,jdbcType=INTEGER}, 
    fund_short_name = #{fundShortName,jdbcType=VARCHAR}, 
    report_id = #{reportId,jdbcType=INTEGER}, 
    ann_date = #{annDate,jdbcType=DATE}, 
    start_date = #{startDate,jdbcType=DATE}, 
    end_date = #{endDate,jdbcType=DATE}, 
    data_source = #{dataSource,jdbcType=VARCHAR}, 
    is_new = #{isNew,jdbcType=INTEGER}, 
    type_id = #{typeId,jdbcType=INTEGER}, 
    type_name = #{typeName,jdbcType=VARCHAR}, 
    `no` = #{no,jdbcType=INTEGER}, 
    stock_code = #{stockCode,jdbcType=INTEGER}, 
    hold_share = #{holdShare,jdbcType=DECIMAL}, 
    hold_value = #{holdValue,jdbcType=DECIMAL}, 
    value_rank = #{valueRank,jdbcType=INTEGER}, 
    net_ratio = #{netRatio,jdbcType=DECIMAL}, 
    share_ratio = #{shareRatio,jdbcType=DECIMAL}, 
    value_ratio = #{valueRatio,jdbcType=DECIMAL}, 
    unname = #{unname,jdbcType=INTEGER}, 
    stock_name = #{stockName,jdbcType=VARCHAR}, 
    s_seg = #{sSeg,jdbcType=BIGINT}, 
    s_update_time = #{sUpdateTime,jdbcType=TIMESTAMP}, 
    s_data_state = #{sDataState,jdbcType=INTEGER}
  </insert>
  <insert id="insertOrUpdateSelective" parameterType="com.tanpu.fund.entity.generator.TxTop10Stock">
    <!--@mbg.generated-->
    insert into tx_top10_stock
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="sRowVersion != null">
        s_row_version,
      </if>
      <if test="fundId != null">
        fund_id,
      </if>
      <if test="fundCode != null">
        fund_code,
      </if>
      <if test="fundShortName != null">
        fund_short_name,
      </if>
      <if test="reportId != null">
        report_id,
      </if>
      <if test="annDate != null">
        ann_date,
      </if>
      <if test="startDate != null">
        start_date,
      </if>
      <if test="endDate != null">
        end_date,
      </if>
      <if test="dataSource != null">
        data_source,
      </if>
      <if test="isNew != null">
        is_new,
      </if>
      <if test="typeId != null">
        type_id,
      </if>
      <if test="typeName != null">
        type_name,
      </if>
      <if test="no != null">
        `no`,
      </if>
      <if test="stockCode != null">
        stock_code,
      </if>
      <if test="holdShare != null">
        hold_share,
      </if>
      <if test="holdValue != null">
        hold_value,
      </if>
      <if test="valueRank != null">
        value_rank,
      </if>
      <if test="netRatio != null">
        net_ratio,
      </if>
      <if test="shareRatio != null">
        share_ratio,
      </if>
      <if test="valueRatio != null">
        value_ratio,
      </if>
      <if test="unname != null">
        unname,
      </if>
      <if test="stockName != null">
        stock_name,
      </if>
      <if test="sSeg != null">
        s_seg,
      </if>
      <if test="sUpdateTime != null">
        s_update_time,
      </if>
      <if test="sDataState != null">
        s_data_state,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="sRowVersion != null">
        #{sRowVersion,jdbcType=BIGINT},
      </if>
      <if test="fundId != null">
        #{fundId,jdbcType=INTEGER},
      </if>
      <if test="fundCode != null">
        #{fundCode,jdbcType=INTEGER},
      </if>
      <if test="fundShortName != null">
        #{fundShortName,jdbcType=VARCHAR},
      </if>
      <if test="reportId != null">
        #{reportId,jdbcType=INTEGER},
      </if>
      <if test="annDate != null">
        #{annDate,jdbcType=DATE},
      </if>
      <if test="startDate != null">
        #{startDate,jdbcType=DATE},
      </if>
      <if test="endDate != null">
        #{endDate,jdbcType=DATE},
      </if>
      <if test="dataSource != null">
        #{dataSource,jdbcType=VARCHAR},
      </if>
      <if test="isNew != null">
        #{isNew,jdbcType=INTEGER},
      </if>
      <if test="typeId != null">
        #{typeId,jdbcType=INTEGER},
      </if>
      <if test="typeName != null">
        #{typeName,jdbcType=VARCHAR},
      </if>
      <if test="no != null">
        #{no,jdbcType=INTEGER},
      </if>
      <if test="stockCode != null">
        #{stockCode,jdbcType=INTEGER},
      </if>
      <if test="holdShare != null">
        #{holdShare,jdbcType=DECIMAL},
      </if>
      <if test="holdValue != null">
        #{holdValue,jdbcType=DECIMAL},
      </if>
      <if test="valueRank != null">
        #{valueRank,jdbcType=INTEGER},
      </if>
      <if test="netRatio != null">
        #{netRatio,jdbcType=DECIMAL},
      </if>
      <if test="shareRatio != null">
        #{shareRatio,jdbcType=DECIMAL},
      </if>
      <if test="valueRatio != null">
        #{valueRatio,jdbcType=DECIMAL},
      </if>
      <if test="unname != null">
        #{unname,jdbcType=INTEGER},
      </if>
      <if test="stockName != null">
        #{stockName,jdbcType=VARCHAR},
      </if>
      <if test="sSeg != null">
        #{sSeg,jdbcType=BIGINT},
      </if>
      <if test="sUpdateTime != null">
        #{sUpdateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="sDataState != null">
        #{sDataState,jdbcType=INTEGER},
      </if>
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="sRowVersion != null">
        s_row_version = #{sRowVersion,jdbcType=BIGINT},
      </if>
      <if test="fundId != null">
        fund_id = #{fundId,jdbcType=INTEGER},
      </if>
      <if test="fundCode != null">
        fund_code = #{fundCode,jdbcType=INTEGER},
      </if>
      <if test="fundShortName != null">
        fund_short_name = #{fundShortName,jdbcType=VARCHAR},
      </if>
      <if test="reportId != null">
        report_id = #{reportId,jdbcType=INTEGER},
      </if>
      <if test="annDate != null">
        ann_date = #{annDate,jdbcType=DATE},
      </if>
      <if test="startDate != null">
        start_date = #{startDate,jdbcType=DATE},
      </if>
      <if test="endDate != null">
        end_date = #{endDate,jdbcType=DATE},
      </if>
      <if test="dataSource != null">
        data_source = #{dataSource,jdbcType=VARCHAR},
      </if>
      <if test="isNew != null">
        is_new = #{isNew,jdbcType=INTEGER},
      </if>
      <if test="typeId != null">
        type_id = #{typeId,jdbcType=INTEGER},
      </if>
      <if test="typeName != null">
        type_name = #{typeName,jdbcType=VARCHAR},
      </if>
      <if test="no != null">
        `no` = #{no,jdbcType=INTEGER},
      </if>
      <if test="stockCode != null">
        stock_code = #{stockCode,jdbcType=INTEGER},
      </if>
      <if test="holdShare != null">
        hold_share = #{holdShare,jdbcType=DECIMAL},
      </if>
      <if test="holdValue != null">
        hold_value = #{holdValue,jdbcType=DECIMAL},
      </if>
      <if test="valueRank != null">
        value_rank = #{valueRank,jdbcType=INTEGER},
      </if>
      <if test="netRatio != null">
        net_ratio = #{netRatio,jdbcType=DECIMAL},
      </if>
      <if test="shareRatio != null">
        share_ratio = #{shareRatio,jdbcType=DECIMAL},
      </if>
      <if test="valueRatio != null">
        value_ratio = #{valueRatio,jdbcType=DECIMAL},
      </if>
      <if test="unname != null">
        unname = #{unname,jdbcType=INTEGER},
      </if>
      <if test="stockName != null">
        stock_name = #{stockName,jdbcType=VARCHAR},
      </if>
      <if test="sSeg != null">
        s_seg = #{sSeg,jdbcType=BIGINT},
      </if>
      <if test="sUpdateTime != null">
        s_update_time = #{sUpdateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="sDataState != null">
        s_data_state = #{sDataState,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
</mapper>