<?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.IfaImportedFundRankMapper">
  <resultMap id="BaseResultMap" type="com.tanpu.fund.entity.generator.IfaImportedFundRank">
    <!--@mbg.generated-->
    <!--@Table ifa_imported_fund_rank-->
    <id column="fund_id" jdbcType="VARCHAR" property="fundId" />
    <result column="index" jdbcType="BIGINT" property="index" />
    <result column="range_return" jdbcType="DOUBLE" property="rangeReturn" />
    <result column="annual_return" jdbcType="DOUBLE" property="annualReturn" />
    <result column="max_drawdown" jdbcType="DOUBLE" property="maxDrawdown" />
    <result column="volatility" jdbcType="DOUBLE" property="volatility" />
    <result column="sortino_ratio" jdbcType="DOUBLE" property="sortinoRatio" />
    <result column="downside_risk" jdbcType="DOUBLE" property="downsideRisk" />
    <result column="substrategy" jdbcType="BIGINT" property="substrategy" />
    <result column="annual_return_rank" jdbcType="DOUBLE" property="annualReturnRank" />
    <result column="downside_risk_rank" jdbcType="DOUBLE" property="downsideRiskRank" />
    <result column="max_drawdown_rank" jdbcType="DOUBLE" property="maxDrawdownRank" />
    <result column="sharp_ratio_rank" jdbcType="DOUBLE" property="sharpRatioRank" />
    <result column="z_score" jdbcType="DOUBLE" property="zScore" />
    <result column="org_id" jdbcType="VARCHAR" property="orgId" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tanpu.fund.entity.generator.IfaImportedFundRank">
    <!--@mbg.generated-->
    <!--@Table ifa_imported_fund_rank-->
    <result column="sharp_ratio" jdbcType="LONGVARCHAR" property="sharpRatio" />
    <result column="manager" jdbcType="LONGVARCHAR" property="manager" />
  </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-->
    fund_id, `index`, range_return, annual_return, max_drawdown, volatility, sortino_ratio, 
    downside_risk, substrategy, annual_return_rank, downside_risk_rank, max_drawdown_rank, 
    sharp_ratio_rank, z_score, org_id
  </sql>
  <sql id="Blob_Column_List">
    <!--@mbg.generated-->
    sharp_ratio, manager
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundRankExample" resultMap="ResultMapWithBLOBs">
    <!--@mbg.generated-->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from ifa_imported_fund_rank
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundRankExample" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from ifa_imported_fund_rank
    <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="ResultMapWithBLOBs">
    <!--@mbg.generated-->
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from ifa_imported_fund_rank
    where fund_id = #{fundId,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--@mbg.generated-->
    delete from ifa_imported_fund_rank
    where fund_id = #{fundId,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundRankExample">
    <!--@mbg.generated-->
    delete from ifa_imported_fund_rank
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundRank">
    <!--@mbg.generated-->
    insert into ifa_imported_fund_rank (fund_id, `index`, range_return, 
      annual_return, max_drawdown, volatility, 
      sortino_ratio, downside_risk, substrategy, 
      annual_return_rank, downside_risk_rank, max_drawdown_rank, 
      sharp_ratio_rank, z_score, org_id, 
      sharp_ratio, manager)
    values (#{fundId,jdbcType=VARCHAR}, #{index,jdbcType=BIGINT}, #{rangeReturn,jdbcType=DOUBLE}, 
      #{annualReturn,jdbcType=DOUBLE}, #{maxDrawdown,jdbcType=DOUBLE}, #{volatility,jdbcType=DOUBLE}, 
      #{sortinoRatio,jdbcType=DOUBLE}, #{downsideRisk,jdbcType=DOUBLE}, #{substrategy,jdbcType=BIGINT}, 
      #{annualReturnRank,jdbcType=DOUBLE}, #{downsideRiskRank,jdbcType=DOUBLE}, #{maxDrawdownRank,jdbcType=DOUBLE}, 
      #{sharpRatioRank,jdbcType=DOUBLE}, #{zScore,jdbcType=DOUBLE}, #{orgId,jdbcType=VARCHAR}, 
      #{sharpRatio,jdbcType=LONGVARCHAR}, #{manager,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundRank">
    <!--@mbg.generated-->
    insert into ifa_imported_fund_rank
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="fundId != null">
        fund_id,
      </if>
      <if test="index != null">
        `index`,
      </if>
      <if test="rangeReturn != null">
        range_return,
      </if>
      <if test="annualReturn != null">
        annual_return,
      </if>
      <if test="maxDrawdown != null">
        max_drawdown,
      </if>
      <if test="volatility != null">
        volatility,
      </if>
      <if test="sortinoRatio != null">
        sortino_ratio,
      </if>
      <if test="downsideRisk != null">
        downside_risk,
      </if>
      <if test="substrategy != null">
        substrategy,
      </if>
      <if test="annualReturnRank != null">
        annual_return_rank,
      </if>
      <if test="downsideRiskRank != null">
        downside_risk_rank,
      </if>
      <if test="maxDrawdownRank != null">
        max_drawdown_rank,
      </if>
      <if test="sharpRatioRank != null">
        sharp_ratio_rank,
      </if>
      <if test="zScore != null">
        z_score,
      </if>
      <if test="orgId != null">
        org_id,
      </if>
      <if test="sharpRatio != null">
        sharp_ratio,
      </if>
      <if test="manager != null">
        manager,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="fundId != null">
        #{fundId,jdbcType=VARCHAR},
      </if>
      <if test="index != null">
        #{index,jdbcType=BIGINT},
      </if>
      <if test="rangeReturn != null">
        #{rangeReturn,jdbcType=DOUBLE},
      </if>
      <if test="annualReturn != null">
        #{annualReturn,jdbcType=DOUBLE},
      </if>
      <if test="maxDrawdown != null">
        #{maxDrawdown,jdbcType=DOUBLE},
      </if>
      <if test="volatility != null">
        #{volatility,jdbcType=DOUBLE},
      </if>
      <if test="sortinoRatio != null">
        #{sortinoRatio,jdbcType=DOUBLE},
      </if>
      <if test="downsideRisk != null">
        #{downsideRisk,jdbcType=DOUBLE},
      </if>
      <if test="substrategy != null">
        #{substrategy,jdbcType=BIGINT},
      </if>
      <if test="annualReturnRank != null">
        #{annualReturnRank,jdbcType=DOUBLE},
      </if>
      <if test="downsideRiskRank != null">
        #{downsideRiskRank,jdbcType=DOUBLE},
      </if>
      <if test="maxDrawdownRank != null">
        #{maxDrawdownRank,jdbcType=DOUBLE},
      </if>
      <if test="sharpRatioRank != null">
        #{sharpRatioRank,jdbcType=DOUBLE},
      </if>
      <if test="zScore != null">
        #{zScore,jdbcType=DOUBLE},
      </if>
      <if test="orgId != null">
        #{orgId,jdbcType=VARCHAR},
      </if>
      <if test="sharpRatio != null">
        #{sharpRatio,jdbcType=LONGVARCHAR},
      </if>
      <if test="manager != null">
        #{manager,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundRankExample" resultType="java.lang.Long">
    <!--@mbg.generated-->
    select count(*) from ifa_imported_fund_rank
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--@mbg.generated-->
    update ifa_imported_fund_rank
    <set>
      <if test="record.fundId != null">
        fund_id = #{record.fundId,jdbcType=VARCHAR},
      </if>
      <if test="record.index != null">
        `index` = #{record.index,jdbcType=BIGINT},
      </if>
      <if test="record.rangeReturn != null">
        range_return = #{record.rangeReturn,jdbcType=DOUBLE},
      </if>
      <if test="record.annualReturn != null">
        annual_return = #{record.annualReturn,jdbcType=DOUBLE},
      </if>
      <if test="record.maxDrawdown != null">
        max_drawdown = #{record.maxDrawdown,jdbcType=DOUBLE},
      </if>
      <if test="record.volatility != null">
        volatility = #{record.volatility,jdbcType=DOUBLE},
      </if>
      <if test="record.sortinoRatio != null">
        sortino_ratio = #{record.sortinoRatio,jdbcType=DOUBLE},
      </if>
      <if test="record.downsideRisk != null">
        downside_risk = #{record.downsideRisk,jdbcType=DOUBLE},
      </if>
      <if test="record.substrategy != null">
        substrategy = #{record.substrategy,jdbcType=BIGINT},
      </if>
      <if test="record.annualReturnRank != null">
        annual_return_rank = #{record.annualReturnRank,jdbcType=DOUBLE},
      </if>
      <if test="record.downsideRiskRank != null">
        downside_risk_rank = #{record.downsideRiskRank,jdbcType=DOUBLE},
      </if>
      <if test="record.maxDrawdownRank != null">
        max_drawdown_rank = #{record.maxDrawdownRank,jdbcType=DOUBLE},
      </if>
      <if test="record.sharpRatioRank != null">
        sharp_ratio_rank = #{record.sharpRatioRank,jdbcType=DOUBLE},
      </if>
      <if test="record.zScore != null">
        z_score = #{record.zScore,jdbcType=DOUBLE},
      </if>
      <if test="record.orgId != null">
        org_id = #{record.orgId,jdbcType=VARCHAR},
      </if>
      <if test="record.sharpRatio != null">
        sharp_ratio = #{record.sharpRatio,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.manager != null">
        manager = #{record.manager,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    <!--@mbg.generated-->
    update ifa_imported_fund_rank
    set fund_id = #{record.fundId,jdbcType=VARCHAR},
      `index` = #{record.index,jdbcType=BIGINT},
      range_return = #{record.rangeReturn,jdbcType=DOUBLE},
      annual_return = #{record.annualReturn,jdbcType=DOUBLE},
      max_drawdown = #{record.maxDrawdown,jdbcType=DOUBLE},
      volatility = #{record.volatility,jdbcType=DOUBLE},
      sortino_ratio = #{record.sortinoRatio,jdbcType=DOUBLE},
      downside_risk = #{record.downsideRisk,jdbcType=DOUBLE},
      substrategy = #{record.substrategy,jdbcType=BIGINT},
      annual_return_rank = #{record.annualReturnRank,jdbcType=DOUBLE},
      downside_risk_rank = #{record.downsideRiskRank,jdbcType=DOUBLE},
      max_drawdown_rank = #{record.maxDrawdownRank,jdbcType=DOUBLE},
      sharp_ratio_rank = #{record.sharpRatioRank,jdbcType=DOUBLE},
      z_score = #{record.zScore,jdbcType=DOUBLE},
      org_id = #{record.orgId,jdbcType=VARCHAR},
      sharp_ratio = #{record.sharpRatio,jdbcType=LONGVARCHAR},
      manager = #{record.manager,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--@mbg.generated-->
    update ifa_imported_fund_rank
    set fund_id = #{record.fundId,jdbcType=VARCHAR},
      `index` = #{record.index,jdbcType=BIGINT},
      range_return = #{record.rangeReturn,jdbcType=DOUBLE},
      annual_return = #{record.annualReturn,jdbcType=DOUBLE},
      max_drawdown = #{record.maxDrawdown,jdbcType=DOUBLE},
      volatility = #{record.volatility,jdbcType=DOUBLE},
      sortino_ratio = #{record.sortinoRatio,jdbcType=DOUBLE},
      downside_risk = #{record.downsideRisk,jdbcType=DOUBLE},
      substrategy = #{record.substrategy,jdbcType=BIGINT},
      annual_return_rank = #{record.annualReturnRank,jdbcType=DOUBLE},
      downside_risk_rank = #{record.downsideRiskRank,jdbcType=DOUBLE},
      max_drawdown_rank = #{record.maxDrawdownRank,jdbcType=DOUBLE},
      sharp_ratio_rank = #{record.sharpRatioRank,jdbcType=DOUBLE},
      z_score = #{record.zScore,jdbcType=DOUBLE},
      org_id = #{record.orgId,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundRank">
    <!--@mbg.generated-->
    update ifa_imported_fund_rank
    <set>
      <if test="index != null">
        `index` = #{index,jdbcType=BIGINT},
      </if>
      <if test="rangeReturn != null">
        range_return = #{rangeReturn,jdbcType=DOUBLE},
      </if>
      <if test="annualReturn != null">
        annual_return = #{annualReturn,jdbcType=DOUBLE},
      </if>
      <if test="maxDrawdown != null">
        max_drawdown = #{maxDrawdown,jdbcType=DOUBLE},
      </if>
      <if test="volatility != null">
        volatility = #{volatility,jdbcType=DOUBLE},
      </if>
      <if test="sortinoRatio != null">
        sortino_ratio = #{sortinoRatio,jdbcType=DOUBLE},
      </if>
      <if test="downsideRisk != null">
        downside_risk = #{downsideRisk,jdbcType=DOUBLE},
      </if>
      <if test="substrategy != null">
        substrategy = #{substrategy,jdbcType=BIGINT},
      </if>
      <if test="annualReturnRank != null">
        annual_return_rank = #{annualReturnRank,jdbcType=DOUBLE},
      </if>
      <if test="downsideRiskRank != null">
        downside_risk_rank = #{downsideRiskRank,jdbcType=DOUBLE},
      </if>
      <if test="maxDrawdownRank != null">
        max_drawdown_rank = #{maxDrawdownRank,jdbcType=DOUBLE},
      </if>
      <if test="sharpRatioRank != null">
        sharp_ratio_rank = #{sharpRatioRank,jdbcType=DOUBLE},
      </if>
      <if test="zScore != null">
        z_score = #{zScore,jdbcType=DOUBLE},
      </if>
      <if test="orgId != null">
        org_id = #{orgId,jdbcType=VARCHAR},
      </if>
      <if test="sharpRatio != null">
        sharp_ratio = #{sharpRatio,jdbcType=LONGVARCHAR},
      </if>
      <if test="manager != null">
        manager = #{manager,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where fund_id = #{fundId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundRank">
    <!--@mbg.generated-->
    update ifa_imported_fund_rank
    set `index` = #{index,jdbcType=BIGINT},
      range_return = #{rangeReturn,jdbcType=DOUBLE},
      annual_return = #{annualReturn,jdbcType=DOUBLE},
      max_drawdown = #{maxDrawdown,jdbcType=DOUBLE},
      volatility = #{volatility,jdbcType=DOUBLE},
      sortino_ratio = #{sortinoRatio,jdbcType=DOUBLE},
      downside_risk = #{downsideRisk,jdbcType=DOUBLE},
      substrategy = #{substrategy,jdbcType=BIGINT},
      annual_return_rank = #{annualReturnRank,jdbcType=DOUBLE},
      downside_risk_rank = #{downsideRiskRank,jdbcType=DOUBLE},
      max_drawdown_rank = #{maxDrawdownRank,jdbcType=DOUBLE},
      sharp_ratio_rank = #{sharpRatioRank,jdbcType=DOUBLE},
      z_score = #{zScore,jdbcType=DOUBLE},
      org_id = #{orgId,jdbcType=VARCHAR},
      sharp_ratio = #{sharpRatio,jdbcType=LONGVARCHAR},
      manager = #{manager,jdbcType=LONGVARCHAR}
    where fund_id = #{fundId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundRank">
    <!--@mbg.generated-->
    update ifa_imported_fund_rank
    set `index` = #{index,jdbcType=BIGINT},
      range_return = #{rangeReturn,jdbcType=DOUBLE},
      annual_return = #{annualReturn,jdbcType=DOUBLE},
      max_drawdown = #{maxDrawdown,jdbcType=DOUBLE},
      volatility = #{volatility,jdbcType=DOUBLE},
      sortino_ratio = #{sortinoRatio,jdbcType=DOUBLE},
      downside_risk = #{downsideRisk,jdbcType=DOUBLE},
      substrategy = #{substrategy,jdbcType=BIGINT},
      annual_return_rank = #{annualReturnRank,jdbcType=DOUBLE},
      downside_risk_rank = #{downsideRiskRank,jdbcType=DOUBLE},
      max_drawdown_rank = #{maxDrawdownRank,jdbcType=DOUBLE},
      sharp_ratio_rank = #{sharpRatioRank,jdbcType=DOUBLE},
      z_score = #{zScore,jdbcType=DOUBLE},
      org_id = #{orgId,jdbcType=VARCHAR}
    where fund_id = #{fundId,jdbcType=VARCHAR}
  </update>
  <update id="updateBatch" parameterType="java.util.List">
    <!--@mbg.generated-->
    update ifa_imported_fund_rank
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="`index` = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.index,jdbcType=BIGINT}
        </foreach>
      </trim>
      <trim prefix="range_return = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.rangeReturn,jdbcType=DOUBLE}
        </foreach>
      </trim>
      <trim prefix="annual_return = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.annualReturn,jdbcType=DOUBLE}
        </foreach>
      </trim>
      <trim prefix="max_drawdown = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.maxDrawdown,jdbcType=DOUBLE}
        </foreach>
      </trim>
      <trim prefix="volatility = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.volatility,jdbcType=DOUBLE}
        </foreach>
      </trim>
      <trim prefix="sortino_ratio = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.sortinoRatio,jdbcType=DOUBLE}
        </foreach>
      </trim>
      <trim prefix="downside_risk = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.downsideRisk,jdbcType=DOUBLE}
        </foreach>
      </trim>
      <trim prefix="substrategy = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.substrategy,jdbcType=BIGINT}
        </foreach>
      </trim>
      <trim prefix="annual_return_rank = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.annualReturnRank,jdbcType=DOUBLE}
        </foreach>
      </trim>
      <trim prefix="downside_risk_rank = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.downsideRiskRank,jdbcType=DOUBLE}
        </foreach>
      </trim>
      <trim prefix="max_drawdown_rank = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.maxDrawdownRank,jdbcType=DOUBLE}
        </foreach>
      </trim>
      <trim prefix="sharp_ratio_rank = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.sharpRatioRank,jdbcType=DOUBLE}
        </foreach>
      </trim>
      <trim prefix="z_score = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.zScore,jdbcType=DOUBLE}
        </foreach>
      </trim>
      <trim prefix="org_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.orgId,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="sharp_ratio = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.sharpRatio,jdbcType=LONGVARCHAR}
        </foreach>
      </trim>
      <trim prefix="manager = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.manager,jdbcType=LONGVARCHAR}
        </foreach>
      </trim>
    </trim>
    where fund_id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.fundId,jdbcType=VARCHAR}
    </foreach>
  </update>
  <update id="updateBatchSelective" parameterType="java.util.List">
    <!--@mbg.generated-->
    update ifa_imported_fund_rank
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="`index` = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.index != null">
            when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.index,jdbcType=BIGINT}
          </if>
        </foreach>
      </trim>
      <trim prefix="range_return = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.rangeReturn != null">
            when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.rangeReturn,jdbcType=DOUBLE}
          </if>
        </foreach>
      </trim>
      <trim prefix="annual_return = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.annualReturn != null">
            when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.annualReturn,jdbcType=DOUBLE}
          </if>
        </foreach>
      </trim>
      <trim prefix="max_drawdown = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.maxDrawdown != null">
            when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.maxDrawdown,jdbcType=DOUBLE}
          </if>
        </foreach>
      </trim>
      <trim prefix="volatility = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.volatility != null">
            when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.volatility,jdbcType=DOUBLE}
          </if>
        </foreach>
      </trim>
      <trim prefix="sortino_ratio = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.sortinoRatio != null">
            when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.sortinoRatio,jdbcType=DOUBLE}
          </if>
        </foreach>
      </trim>
      <trim prefix="downside_risk = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.downsideRisk != null">
            when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.downsideRisk,jdbcType=DOUBLE}
          </if>
        </foreach>
      </trim>
      <trim prefix="substrategy = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.substrategy != null">
            when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.substrategy,jdbcType=BIGINT}
          </if>
        </foreach>
      </trim>
      <trim prefix="annual_return_rank = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.annualReturnRank != null">
            when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.annualReturnRank,jdbcType=DOUBLE}
          </if>
        </foreach>
      </trim>
      <trim prefix="downside_risk_rank = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.downsideRiskRank != null">
            when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.downsideRiskRank,jdbcType=DOUBLE}
          </if>
        </foreach>
      </trim>
      <trim prefix="max_drawdown_rank = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.maxDrawdownRank != null">
            when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.maxDrawdownRank,jdbcType=DOUBLE}
          </if>
        </foreach>
      </trim>
      <trim prefix="sharp_ratio_rank = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.sharpRatioRank != null">
            when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.sharpRatioRank,jdbcType=DOUBLE}
          </if>
        </foreach>
      </trim>
      <trim prefix="z_score = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.zScore != null">
            when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.zScore,jdbcType=DOUBLE}
          </if>
        </foreach>
      </trim>
      <trim prefix="org_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.orgId != null">
            when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.orgId,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="sharp_ratio = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.sharpRatio != null">
            when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.sharpRatio,jdbcType=LONGVARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="manager = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.manager != null">
            when fund_id = #{item.fundId,jdbcType=VARCHAR} then #{item.manager,jdbcType=LONGVARCHAR}
          </if>
        </foreach>
      </trim>
    </trim>
    where fund_id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.fundId,jdbcType=VARCHAR}
    </foreach>
  </update>
  <insert id="batchInsert" parameterType="map">
    <!--@mbg.generated-->
    insert into ifa_imported_fund_rank
    (fund_id, `index`, range_return, annual_return, max_drawdown, volatility, sortino_ratio, 
      downside_risk, substrategy, annual_return_rank, downside_risk_rank, max_drawdown_rank, 
      sharp_ratio_rank, z_score, org_id, sharp_ratio, manager)
    values
    <foreach collection="list" item="item" separator=",">
      (#{item.fundId,jdbcType=VARCHAR}, #{item.index,jdbcType=BIGINT}, #{item.rangeReturn,jdbcType=DOUBLE}, 
        #{item.annualReturn,jdbcType=DOUBLE}, #{item.maxDrawdown,jdbcType=DOUBLE}, #{item.volatility,jdbcType=DOUBLE}, 
        #{item.sortinoRatio,jdbcType=DOUBLE}, #{item.downsideRisk,jdbcType=DOUBLE}, #{item.substrategy,jdbcType=BIGINT}, 
        #{item.annualReturnRank,jdbcType=DOUBLE}, #{item.downsideRiskRank,jdbcType=DOUBLE}, 
        #{item.maxDrawdownRank,jdbcType=DOUBLE}, #{item.sharpRatioRank,jdbcType=DOUBLE}, 
        #{item.zScore,jdbcType=DOUBLE}, #{item.orgId,jdbcType=VARCHAR}, #{item.sharpRatio,jdbcType=LONGVARCHAR}, 
        #{item.manager,jdbcType=LONGVARCHAR})
    </foreach>
  </insert>
  <insert id="insertOrUpdate" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundRank">
    <!--@mbg.generated-->
    insert into ifa_imported_fund_rank
    (fund_id, `index`, range_return, annual_return, max_drawdown, volatility, sortino_ratio, 
      downside_risk, substrategy, annual_return_rank, downside_risk_rank, max_drawdown_rank, 
      sharp_ratio_rank, z_score, org_id)
    values
    (#{fundId,jdbcType=VARCHAR}, #{index,jdbcType=BIGINT}, #{rangeReturn,jdbcType=DOUBLE}, 
      #{annualReturn,jdbcType=DOUBLE}, #{maxDrawdown,jdbcType=DOUBLE}, #{volatility,jdbcType=DOUBLE}, 
      #{sortinoRatio,jdbcType=DOUBLE}, #{downsideRisk,jdbcType=DOUBLE}, #{substrategy,jdbcType=BIGINT}, 
      #{annualReturnRank,jdbcType=DOUBLE}, #{downsideRiskRank,jdbcType=DOUBLE}, #{maxDrawdownRank,jdbcType=DOUBLE}, 
      #{sharpRatioRank,jdbcType=DOUBLE}, #{zScore,jdbcType=DOUBLE}, #{orgId,jdbcType=VARCHAR}
      )
    on duplicate key update 
    fund_id = #{fundId,jdbcType=VARCHAR}, 
    `index` = #{index,jdbcType=BIGINT}, 
    range_return = #{rangeReturn,jdbcType=DOUBLE}, 
    annual_return = #{annualReturn,jdbcType=DOUBLE}, 
    max_drawdown = #{maxDrawdown,jdbcType=DOUBLE}, 
    volatility = #{volatility,jdbcType=DOUBLE}, 
    sortino_ratio = #{sortinoRatio,jdbcType=DOUBLE}, 
    downside_risk = #{downsideRisk,jdbcType=DOUBLE}, 
    substrategy = #{substrategy,jdbcType=BIGINT}, 
    annual_return_rank = #{annualReturnRank,jdbcType=DOUBLE}, 
    downside_risk_rank = #{downsideRiskRank,jdbcType=DOUBLE}, 
    max_drawdown_rank = #{maxDrawdownRank,jdbcType=DOUBLE}, 
    sharp_ratio_rank = #{sharpRatioRank,jdbcType=DOUBLE}, 
    z_score = #{zScore,jdbcType=DOUBLE}, 
    org_id = #{orgId,jdbcType=VARCHAR}
  </insert>
  <insert id="insertOrUpdateWithBLOBs" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundRank">
    <!--@mbg.generated-->
    insert into ifa_imported_fund_rank
    (fund_id, `index`, range_return, annual_return, max_drawdown, volatility, sortino_ratio, 
      downside_risk, substrategy, annual_return_rank, downside_risk_rank, max_drawdown_rank, 
      sharp_ratio_rank, z_score, org_id, sharp_ratio, manager)
    values
    (#{fundId,jdbcType=VARCHAR}, #{index,jdbcType=BIGINT}, #{rangeReturn,jdbcType=DOUBLE}, 
      #{annualReturn,jdbcType=DOUBLE}, #{maxDrawdown,jdbcType=DOUBLE}, #{volatility,jdbcType=DOUBLE}, 
      #{sortinoRatio,jdbcType=DOUBLE}, #{downsideRisk,jdbcType=DOUBLE}, #{substrategy,jdbcType=BIGINT}, 
      #{annualReturnRank,jdbcType=DOUBLE}, #{downsideRiskRank,jdbcType=DOUBLE}, #{maxDrawdownRank,jdbcType=DOUBLE}, 
      #{sharpRatioRank,jdbcType=DOUBLE}, #{zScore,jdbcType=DOUBLE}, #{orgId,jdbcType=VARCHAR}, 
      #{sharpRatio,jdbcType=LONGVARCHAR}, #{manager,jdbcType=LONGVARCHAR})
    on duplicate key update 
    fund_id = #{fundId,jdbcType=VARCHAR}, 
    `index` = #{index,jdbcType=BIGINT}, 
    range_return = #{rangeReturn,jdbcType=DOUBLE}, 
    annual_return = #{annualReturn,jdbcType=DOUBLE}, 
    max_drawdown = #{maxDrawdown,jdbcType=DOUBLE}, 
    volatility = #{volatility,jdbcType=DOUBLE}, 
    sortino_ratio = #{sortinoRatio,jdbcType=DOUBLE}, 
    downside_risk = #{downsideRisk,jdbcType=DOUBLE}, 
    substrategy = #{substrategy,jdbcType=BIGINT}, 
    annual_return_rank = #{annualReturnRank,jdbcType=DOUBLE}, 
    downside_risk_rank = #{downsideRiskRank,jdbcType=DOUBLE}, 
    max_drawdown_rank = #{maxDrawdownRank,jdbcType=DOUBLE}, 
    sharp_ratio_rank = #{sharpRatioRank,jdbcType=DOUBLE}, 
    z_score = #{zScore,jdbcType=DOUBLE}, 
    org_id = #{orgId,jdbcType=VARCHAR}, 
    sharp_ratio = #{sharpRatio,jdbcType=LONGVARCHAR}, 
    manager = #{manager,jdbcType=LONGVARCHAR}
  </insert>
  <insert id="insertOrUpdateSelective" parameterType="com.tanpu.fund.entity.generator.IfaImportedFundRank">
    <!--@mbg.generated-->
    insert into ifa_imported_fund_rank
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="fundId != null">
        fund_id,
      </if>
      <if test="index != null">
        `index`,
      </if>
      <if test="rangeReturn != null">
        range_return,
      </if>
      <if test="annualReturn != null">
        annual_return,
      </if>
      <if test="maxDrawdown != null">
        max_drawdown,
      </if>
      <if test="volatility != null">
        volatility,
      </if>
      <if test="sortinoRatio != null">
        sortino_ratio,
      </if>
      <if test="downsideRisk != null">
        downside_risk,
      </if>
      <if test="substrategy != null">
        substrategy,
      </if>
      <if test="annualReturnRank != null">
        annual_return_rank,
      </if>
      <if test="downsideRiskRank != null">
        downside_risk_rank,
      </if>
      <if test="maxDrawdownRank != null">
        max_drawdown_rank,
      </if>
      <if test="sharpRatioRank != null">
        sharp_ratio_rank,
      </if>
      <if test="zScore != null">
        z_score,
      </if>
      <if test="orgId != null">
        org_id,
      </if>
      <if test="sharpRatio != null">
        sharp_ratio,
      </if>
      <if test="manager != null">
        manager,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="fundId != null">
        #{fundId,jdbcType=VARCHAR},
      </if>
      <if test="index != null">
        #{index,jdbcType=BIGINT},
      </if>
      <if test="rangeReturn != null">
        #{rangeReturn,jdbcType=DOUBLE},
      </if>
      <if test="annualReturn != null">
        #{annualReturn,jdbcType=DOUBLE},
      </if>
      <if test="maxDrawdown != null">
        #{maxDrawdown,jdbcType=DOUBLE},
      </if>
      <if test="volatility != null">
        #{volatility,jdbcType=DOUBLE},
      </if>
      <if test="sortinoRatio != null">
        #{sortinoRatio,jdbcType=DOUBLE},
      </if>
      <if test="downsideRisk != null">
        #{downsideRisk,jdbcType=DOUBLE},
      </if>
      <if test="substrategy != null">
        #{substrategy,jdbcType=BIGINT},
      </if>
      <if test="annualReturnRank != null">
        #{annualReturnRank,jdbcType=DOUBLE},
      </if>
      <if test="downsideRiskRank != null">
        #{downsideRiskRank,jdbcType=DOUBLE},
      </if>
      <if test="maxDrawdownRank != null">
        #{maxDrawdownRank,jdbcType=DOUBLE},
      </if>
      <if test="sharpRatioRank != null">
        #{sharpRatioRank,jdbcType=DOUBLE},
      </if>
      <if test="zScore != null">
        #{zScore,jdbcType=DOUBLE},
      </if>
      <if test="orgId != null">
        #{orgId,jdbcType=VARCHAR},
      </if>
      <if test="sharpRatio != null">
        #{sharpRatio,jdbcType=LONGVARCHAR},
      </if>
      <if test="manager != null">
        #{manager,jdbcType=LONGVARCHAR},
      </if>
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="fundId != null">
        fund_id = #{fundId,jdbcType=VARCHAR},
      </if>
      <if test="index != null">
        `index` = #{index,jdbcType=BIGINT},
      </if>
      <if test="rangeReturn != null">
        range_return = #{rangeReturn,jdbcType=DOUBLE},
      </if>
      <if test="annualReturn != null">
        annual_return = #{annualReturn,jdbcType=DOUBLE},
      </if>
      <if test="maxDrawdown != null">
        max_drawdown = #{maxDrawdown,jdbcType=DOUBLE},
      </if>
      <if test="volatility != null">
        volatility = #{volatility,jdbcType=DOUBLE},
      </if>
      <if test="sortinoRatio != null">
        sortino_ratio = #{sortinoRatio,jdbcType=DOUBLE},
      </if>
      <if test="downsideRisk != null">
        downside_risk = #{downsideRisk,jdbcType=DOUBLE},
      </if>
      <if test="substrategy != null">
        substrategy = #{substrategy,jdbcType=BIGINT},
      </if>
      <if test="annualReturnRank != null">
        annual_return_rank = #{annualReturnRank,jdbcType=DOUBLE},
      </if>
      <if test="downsideRiskRank != null">
        downside_risk_rank = #{downsideRiskRank,jdbcType=DOUBLE},
      </if>
      <if test="maxDrawdownRank != null">
        max_drawdown_rank = #{maxDrawdownRank,jdbcType=DOUBLE},
      </if>
      <if test="sharpRatioRank != null">
        sharp_ratio_rank = #{sharpRatioRank,jdbcType=DOUBLE},
      </if>
      <if test="zScore != null">
        z_score = #{zScore,jdbcType=DOUBLE},
      </if>
      <if test="orgId != null">
        org_id = #{orgId,jdbcType=VARCHAR},
      </if>
      <if test="sharpRatio != null">
        sharp_ratio = #{sharpRatio,jdbcType=LONGVARCHAR},
      </if>
      <if test="manager != null">
        manager = #{manager,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
</mapper>