<?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.StockTradeCalMapper">
  <resultMap id="BaseResultMap" type="com.tanpu.fund.entity.generator.StockTradeCal">
    <!--@mbg.generated-->
    <!--@Table stock_trade_cal-->
    <result column="is_open" jdbcType="BIGINT" property="isOpen" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tanpu.fund.entity.generator.StockTradeCal">
    <!--@mbg.generated-->
    <!--@Table stock_trade_cal-->
    <result column="exchange" jdbcType="LONGVARCHAR" property="exchange" />
    <result column="cal_date" jdbcType="LONGVARCHAR" property="calDate" />
  </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-->
    is_open
  </sql>
  <sql id="Blob_Column_List">
    <!--@mbg.generated-->
    exchange, cal_date
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.tanpu.fund.entity.generator.StockTradeCalExample" resultMap="ResultMapWithBLOBs">
    <!--@mbg.generated-->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from stock_trade_cal
    <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.StockTradeCalExample" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from stock_trade_cal
    <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.StockTradeCalExample">
    <!--@mbg.generated-->
    delete from stock_trade_cal
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.tanpu.fund.entity.generator.StockTradeCal">
    <!--@mbg.generated-->
    insert into stock_trade_cal (is_open, exchange, cal_date
      )
    values (#{isOpen,jdbcType=BIGINT}, #{exchange,jdbcType=LONGVARCHAR}, #{calDate,jdbcType=LONGVARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.tanpu.fund.entity.generator.StockTradeCal">
    <!--@mbg.generated-->
    insert into stock_trade_cal
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="isOpen != null">
        is_open,
      </if>
      <if test="exchange != null">
        exchange,
      </if>
      <if test="calDate != null">
        cal_date,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="isOpen != null">
        #{isOpen,jdbcType=BIGINT},
      </if>
      <if test="exchange != null">
        #{exchange,jdbcType=LONGVARCHAR},
      </if>
      <if test="calDate != null">
        #{calDate,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.tanpu.fund.entity.generator.StockTradeCalExample" resultType="java.lang.Long">
    <!--@mbg.generated-->
    select count(*) from stock_trade_cal
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--@mbg.generated-->
    update stock_trade_cal
    <set>
      <if test="record.isOpen != null">
        is_open = #{record.isOpen,jdbcType=BIGINT},
      </if>
      <if test="record.exchange != null">
        exchange = #{record.exchange,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.calDate != null">
        cal_date = #{record.calDate,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 stock_trade_cal
    set is_open = #{record.isOpen,jdbcType=BIGINT},
      exchange = #{record.exchange,jdbcType=LONGVARCHAR},
      cal_date = #{record.calDate,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--@mbg.generated-->
    update stock_trade_cal
    set is_open = #{record.isOpen,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <insert id="batchInsert" parameterType="map">
    <!--@mbg.generated-->
    insert into stock_trade_cal
    (is_open, exchange, cal_date)
    values
    <foreach collection="list" item="item" separator=",">
      (#{item.isOpen,jdbcType=BIGINT}, #{item.exchange,jdbcType=LONGVARCHAR}, #{item.calDate,jdbcType=LONGVARCHAR}
        )
    </foreach>
  </insert>
  <insert id="insertOrUpdate" parameterType="com.tanpu.fund.entity.generator.StockTradeCal">
    <!--@mbg.generated-->
    insert into stock_trade_cal
    (is_open)
    values
    (#{isOpen,jdbcType=BIGINT})
    on duplicate key update 
    is_open = #{isOpen,jdbcType=BIGINT}
  </insert>
  <insert id="insertOrUpdateWithBLOBs" parameterType="com.tanpu.fund.entity.generator.StockTradeCal">
    <!--@mbg.generated-->
    insert into stock_trade_cal
    (is_open, exchange, cal_date)
    values
    (#{isOpen,jdbcType=BIGINT}, #{exchange,jdbcType=LONGVARCHAR}, #{calDate,jdbcType=LONGVARCHAR}
      )
    on duplicate key update 
    is_open = #{isOpen,jdbcType=BIGINT}, 
    exchange = #{exchange,jdbcType=LONGVARCHAR}, 
    cal_date = #{calDate,jdbcType=LONGVARCHAR}
  </insert>
  <insert id="insertOrUpdateSelective" parameterType="com.tanpu.fund.entity.generator.StockTradeCal">
    <!--@mbg.generated-->
    insert into stock_trade_cal
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="isOpen != null">
        is_open,
      </if>
      <if test="exchange != null">
        exchange,
      </if>
      <if test="calDate != null">
        cal_date,
      </if>
    </trim>
    values
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="isOpen != null">
        #{isOpen,jdbcType=BIGINT},
      </if>
      <if test="exchange != null">
        #{exchange,jdbcType=LONGVARCHAR},
      </if>
      <if test="calDate != null">
        #{calDate,jdbcType=LONGVARCHAR},
      </if>
    </trim>
    on duplicate key update 
    <trim suffixOverrides=",">
      <if test="isOpen != null">
        is_open = #{isOpen,jdbcType=BIGINT},
      </if>
      <if test="exchange != null">
        exchange = #{exchange,jdbcType=LONGVARCHAR},
      </if>
      <if test="calDate != null">
        cal_date = #{calDate,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
</mapper>