<?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.IndexDailyMapper">
  <resultMap id="BaseResultMap" type="com.tanpu.fund.entity.generator.IndexDaily">
    <!--@mbg.generated-->
    <!--@Table index_daily-->
    <result column="close" jdbcType="DOUBLE" property="close" />
    <result column="open" jdbcType="DOUBLE" property="open" />
    <result column="high" jdbcType="DOUBLE" property="high" />
    <result column="low" jdbcType="DOUBLE" property="low" />
    <result column="pre_close" jdbcType="DOUBLE" property="preClose" />
    <result column="change" jdbcType="DOUBLE" property="change" />
    <result column="pct_chg" jdbcType="DOUBLE" property="pctChg" />
    <result column="vol" jdbcType="DOUBLE" property="vol" />
    <result column="amount" jdbcType="DOUBLE" property="amount" />
    <result column="org_id" jdbcType="VARCHAR" property="orgId" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tanpu.fund.entity.generator.IndexDaily">
    <!--@mbg.generated-->
    <!--@Table index_daily-->
    <result column="ts_code" jdbcType="LONGVARCHAR" property="tsCode" />
    <result column="trade_date" jdbcType="LONGVARCHAR" property="tradeDate" />
  </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-->
    `close`, `open`, high, low, pre_close, `change`, pct_chg, vol, amount, org_id
  </sql>
  <sql id="Blob_Column_List">
    <!--@mbg.generated-->
    ts_code, trade_date
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.tanpu.fund.entity.generator.IndexDailyExample" resultMap="ResultMapWithBLOBs">
    <!--@mbg.generated-->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from index_daily
    <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.IndexDailyExample" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from index_daily
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <delete id="deleteByExample" parameterType="com.tanpu.fund.entity.generator.IndexDailyExample">
    <!--@mbg.generated-->
    delete from index_daily
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.tanpu.fund.entity.generator.IndexDaily">
    <!--@mbg.generated-->
    insert into index_daily (`close`, `open`, high, 
      low, pre_close, `change`, 
      pct_chg, vol, amount, org_id, 
      ts_code, trade_date)
    values (#{close,jdbcType=DOUBLE}, #{open,jdbcType=DOUBLE}, #{high,jdbcType=DOUBLE}, 
      #{low,jdbcType=DOUBLE}, #{preClose,jdbcType=DOUBLE}, #{change,jdbcType=DOUBLE}, 
      #{pctChg,jdbcType=DOUBLE}, #{vol,jdbcType=DOUBLE}, #{amount,jdbcType=DOUBLE}, #{orgId,jdbcType=VARCHAR}, 
      #{tsCode,jdbcType=LONGVARCHAR}, #{tradeDate,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.tanpu.fund.entity.generator.IndexDaily">
    <!--@mbg.generated-->
    insert into index_daily
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="close != null">
        `close`,
      </if>
      <if test="open != null">
        `open`,
      </if>
      <if test="high != null">
        high,
      </if>
      <if test="low != null">
        low,
      </if>
      <if test="preClose != null">
        pre_close,
      </if>
      <if test="change != null">
        `change`,
      </if>
      <if test="pctChg != null">
        pct_chg,
      </if>
      <if test="vol != null">
        vol,
      </if>
      <if test="amount != null">
        amount,
      </if>
      <if test="orgId != null">
        org_id,
      </if>
      <if test="tsCode != null">
        ts_code,
      </if>
      <if test="tradeDate != null">
        trade_date,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="close != null">
        #{close,jdbcType=DOUBLE},
      </if>
      <if test="open != null">
        #{open,jdbcType=DOUBLE},
      </if>
      <if test="high != null">
        #{high,jdbcType=DOUBLE},
      </if>
      <if test="low != null">
        #{low,jdbcType=DOUBLE},
      </if>
      <if test="preClose != null">
        #{preClose,jdbcType=DOUBLE},
      </if>
      <if test="change != null">
        #{change,jdbcType=DOUBLE},
      </if>
      <if test="pctChg != null">
        #{pctChg,jdbcType=DOUBLE},
      </if>
      <if test="vol != null">
        #{vol,jdbcType=DOUBLE},
      </if>
      <if test="amount != null">
        #{amount,jdbcType=DOUBLE},
      </if>
      <if test="orgId != null">
        #{orgId,jdbcType=VARCHAR},
      </if>
      <if test="tsCode != null">
        #{tsCode,jdbcType=LONGVARCHAR},
      </if>
      <if test="tradeDate != null">
        #{tradeDate,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.tanpu.fund.entity.generator.IndexDailyExample" resultType="java.lang.Long">
    <!--@mbg.generated-->
    select count(*) from index_daily
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--@mbg.generated-->
    update index_daily
    <set>
      <if test="record.close != null">
        `close` = #{record.close,jdbcType=DOUBLE},
      </if>
      <if test="record.open != null">
        `open` = #{record.open,jdbcType=DOUBLE},
      </if>
      <if test="record.high != null">
        high = #{record.high,jdbcType=DOUBLE},
      </if>
      <if test="record.low != null">
        low = #{record.low,jdbcType=DOUBLE},
      </if>
      <if test="record.preClose != null">
        pre_close = #{record.preClose,jdbcType=DOUBLE},
      </if>
      <if test="record.change != null">
        `change` = #{record.change,jdbcType=DOUBLE},
      </if>
      <if test="record.pctChg != null">
        pct_chg = #{record.pctChg,jdbcType=DOUBLE},
      </if>
      <if test="record.vol != null">
        vol = #{record.vol,jdbcType=DOUBLE},
      </if>
      <if test="record.amount != null">
        amount = #{record.amount,jdbcType=DOUBLE},
      </if>
      <if test="record.orgId != null">
        org_id = #{record.orgId,jdbcType=VARCHAR},
      </if>
      <if test="record.tsCode != null">
        ts_code = #{record.tsCode,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.tradeDate != null">
        trade_date = #{record.tradeDate,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 index_daily
    set `close` = #{record.close,jdbcType=DOUBLE},
      `open` = #{record.open,jdbcType=DOUBLE},
      high = #{record.high,jdbcType=DOUBLE},
      low = #{record.low,jdbcType=DOUBLE},
      pre_close = #{record.preClose,jdbcType=DOUBLE},
      `change` = #{record.change,jdbcType=DOUBLE},
      pct_chg = #{record.pctChg,jdbcType=DOUBLE},
      vol = #{record.vol,jdbcType=DOUBLE},
      amount = #{record.amount,jdbcType=DOUBLE},
      org_id = #{record.orgId,jdbcType=VARCHAR},
      ts_code = #{record.tsCode,jdbcType=LONGVARCHAR},
      trade_date = #{record.tradeDate,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--@mbg.generated-->
    update index_daily
    set `close` = #{record.close,jdbcType=DOUBLE},
      `open` = #{record.open,jdbcType=DOUBLE},
      high = #{record.high,jdbcType=DOUBLE},
      low = #{record.low,jdbcType=DOUBLE},
      pre_close = #{record.preClose,jdbcType=DOUBLE},
      `change` = #{record.change,jdbcType=DOUBLE},
      pct_chg = #{record.pctChg,jdbcType=DOUBLE},
      vol = #{record.vol,jdbcType=DOUBLE},
      amount = #{record.amount,jdbcType=DOUBLE},
      org_id = #{record.orgId,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <insert id="batchInsert" parameterType="map">
    <!--@mbg.generated-->
    insert into index_daily
    (`close`, `open`, high, low, pre_close, `change`, pct_chg, vol, amount, org_id, ts_code, 
      trade_date)
    values
    <foreach collection="list" item="item" separator=",">
      (#{item.close,jdbcType=DOUBLE}, #{item.open,jdbcType=DOUBLE}, #{item.high,jdbcType=DOUBLE}, 
        #{item.low,jdbcType=DOUBLE}, #{item.preClose,jdbcType=DOUBLE}, #{item.change,jdbcType=DOUBLE}, 
        #{item.pctChg,jdbcType=DOUBLE}, #{item.vol,jdbcType=DOUBLE}, #{item.amount,jdbcType=DOUBLE}, 
        #{item.orgId,jdbcType=VARCHAR}, #{item.tsCode,jdbcType=LONGVARCHAR}, #{item.tradeDate,jdbcType=LONGVARCHAR}
        )
    </foreach>
  </insert>
  <insert id="insertOrUpdate" parameterType="com.tanpu.fund.entity.generator.IndexDaily">
    <!--@mbg.generated-->
    insert into index_daily
    (`close`, `open`, high, low, pre_close, `change`, pct_chg, vol, amount, org_id)
    values
    (#{close,jdbcType=DOUBLE}, #{open,jdbcType=DOUBLE}, #{high,jdbcType=DOUBLE}, #{low,jdbcType=DOUBLE}, 
      #{preClose,jdbcType=DOUBLE}, #{change,jdbcType=DOUBLE}, #{pctChg,jdbcType=DOUBLE}, 
      #{vol,jdbcType=DOUBLE}, #{amount,jdbcType=DOUBLE}, #{orgId,jdbcType=VARCHAR})
    on duplicate key update 
    `close` = #{close,jdbcType=DOUBLE}, 
    `open` = #{open,jdbcType=DOUBLE}, 
    high = #{high,jdbcType=DOUBLE}, 
    low = #{low,jdbcType=DOUBLE}, 
    pre_close = #{preClose,jdbcType=DOUBLE}, 
    `change` = #{change,jdbcType=DOUBLE}, 
    pct_chg = #{pctChg,jdbcType=DOUBLE}, 
    vol = #{vol,jdbcType=DOUBLE}, 
    amount = #{amount,jdbcType=DOUBLE}, 
    org_id = #{orgId,jdbcType=VARCHAR}
  </insert>
  <insert id="insertOrUpdateWithBLOBs" parameterType="com.tanpu.fund.entity.generator.IndexDaily">
    <!--@mbg.generated-->
    insert into index_daily
    (`close`, `open`, high, low, pre_close, `change`, pct_chg, vol, amount, org_id, ts_code, 
      trade_date)
    values
    (#{close,jdbcType=DOUBLE}, #{open,jdbcType=DOUBLE}, #{high,jdbcType=DOUBLE}, #{low,jdbcType=DOUBLE}, 
      #{preClose,jdbcType=DOUBLE}, #{change,jdbcType=DOUBLE}, #{pctChg,jdbcType=DOUBLE}, 
      #{vol,jdbcType=DOUBLE}, #{amount,jdbcType=DOUBLE}, #{orgId,jdbcType=VARCHAR}, #{tsCode,jdbcType=LONGVARCHAR}, 
      #{tradeDate,jdbcType=LONGVARCHAR})
    on duplicate key update 
    `close` = #{close,jdbcType=DOUBLE}, 
    `open` = #{open,jdbcType=DOUBLE}, 
    high = #{high,jdbcType=DOUBLE}, 
    low = #{low,jdbcType=DOUBLE}, 
    pre_close = #{preClose,jdbcType=DOUBLE}, 
    `change` = #{change,jdbcType=DOUBLE}, 
    pct_chg = #{pctChg,jdbcType=DOUBLE}, 
    vol = #{vol,jdbcType=DOUBLE}, 
    amount = #{amount,jdbcType=DOUBLE}, 
    org_id = #{orgId,jdbcType=VARCHAR}, 
    ts_code = #{tsCode,jdbcType=LONGVARCHAR}, 
    trade_date = #{tradeDate,jdbcType=LONGVARCHAR}
  </insert>
  <insert id="insertOrUpdateSelective" parameterType="com.tanpu.fund.entity.generator.IndexDaily">
    <!--@mbg.generated-->
    insert into index_daily
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="close != null">
        `close`,
      </if>
      <if test="open != null">
        `open`,
      </if>
      <if test="high != null">
        high,
      </if>
      <if test="low != null">
        low,
      </if>
      <if test="preClose != null">
        pre_close,
      </if>
      <if test="change != null">
        `change`,
      </if>
      <if test="pctChg != null">
        pct_chg,
      </if>
      <if test="vol != null">
        vol,
      </if>
      <if test="amount != null">
        amount,
      </if>
      <if test="orgId != null">
        org_id,
      </if>
      <if test="tsCode != null">
        ts_code,
      </if>
      <if test="tradeDate != null">
        trade_date,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="close != null">
        #{close,jdbcType=DOUBLE},
      </if>
      <if test="open != null">
        #{open,jdbcType=DOUBLE},
      </if>
      <if test="high != null">
        #{high,jdbcType=DOUBLE},
      </if>
      <if test="low != null">
        #{low,jdbcType=DOUBLE},
      </if>
      <if test="preClose != null">
        #{preClose,jdbcType=DOUBLE},
      </if>
      <if test="change != null">
        #{change,jdbcType=DOUBLE},
      </if>
      <if test="pctChg != null">
        #{pctChg,jdbcType=DOUBLE},
      </if>
      <if test="vol != null">
        #{vol,jdbcType=DOUBLE},
      </if>
      <if test="amount != null">
        #{amount,jdbcType=DOUBLE},
      </if>
      <if test="orgId != null">
        #{orgId,jdbcType=VARCHAR},
      </if>
      <if test="tsCode != null">
        #{tsCode,jdbcType=LONGVARCHAR},
      </if>
      <if test="tradeDate != null">
        #{tradeDate,jdbcType=LONGVARCHAR},
      </if>
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="close != null">
        `close` = #{close,jdbcType=DOUBLE},
      </if>
      <if test="open != null">
        `open` = #{open,jdbcType=DOUBLE},
      </if>
      <if test="high != null">
        high = #{high,jdbcType=DOUBLE},
      </if>
      <if test="low != null">
        low = #{low,jdbcType=DOUBLE},
      </if>
      <if test="preClose != null">
        pre_close = #{preClose,jdbcType=DOUBLE},
      </if>
      <if test="change != null">
        `change` = #{change,jdbcType=DOUBLE},
      </if>
      <if test="pctChg != null">
        pct_chg = #{pctChg,jdbcType=DOUBLE},
      </if>
      <if test="vol != null">
        vol = #{vol,jdbcType=DOUBLE},
      </if>
      <if test="amount != null">
        amount = #{amount,jdbcType=DOUBLE},
      </if>
      <if test="orgId != null">
        org_id = #{orgId,jdbcType=VARCHAR},
      </if>
      <if test="tsCode != null">
        ts_code = #{tsCode,jdbcType=LONGVARCHAR},
      </if>
      <if test="tradeDate != null">
        trade_date = #{tradeDate,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
</mapper>