<?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.fuxi.ws.data.dao.WBirthdayticketMapper" >
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.WBirthdayticket" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 24 20:17:58 CST 2019.
    -->
    <id column="VIPTypeID" property="viptypeid" jdbcType="VARCHAR" />
    <id column="TicketId" property="ticketid" jdbcType="INTEGER" />
    <result column="TicketIndex" property="ticketindex" jdbcType="TINYINT" />
    <result column="TicketNum" property="ticketnum" jdbcType="TINYINT" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 24 20:17:58 CST 2019.
    -->
    <where >
      <foreach collection="oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 24 20:17:58 CST 2019.
    -->
    VIPTypeID, TicketId, TicketIndex, TicketNum
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.fuxi.ws.data.entity.WBirthdayticketExample" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 24 20:17:58 CST 2019.
    -->
    select
    <if test="distinct" >
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from W_BirthDayTicket
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="com.fuxi.ws.data.entity.WBirthdayticketKey" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 24 20:17:58 CST 2019.
    -->
    select 
    <include refid="Base_Column_List" />
    from W_BirthDayTicket
    where VIPTypeID = #{viptypeid,jdbcType=VARCHAR}
      and TicketId = #{ticketid,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WBirthdayticketKey" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 24 20:17:58 CST 2019.
    -->
    delete from W_BirthDayTicket
    where VIPTypeID = #{viptypeid,jdbcType=VARCHAR}
      and TicketId = #{ticketid,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.WBirthdayticket" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 24 20:17:58 CST 2019.
    -->
    insert into W_BirthDayTicket (VIPTypeID, TicketId, TicketIndex, 
      TicketNum)
    values (#{viptypeid,jdbcType=VARCHAR}, #{ticketid,jdbcType=INTEGER}, #{ticketindex,jdbcType=TINYINT}, 
      #{ticketnum,jdbcType=TINYINT})
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.WBirthdayticket" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 24 20:17:58 CST 2019.
    -->
    insert into W_BirthDayTicket
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="viptypeid != null" >
        VIPTypeID,
      </if>
      <if test="ticketid != null" >
        TicketId,
      </if>
      <if test="ticketindex != null" >
        TicketIndex,
      </if>
      <if test="ticketnum != null" >
        TicketNum,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="viptypeid != null" >
        #{viptypeid,jdbcType=VARCHAR},
      </if>
      <if test="ticketid != null" >
        #{ticketid,jdbcType=INTEGER},
      </if>
      <if test="ticketindex != null" >
        #{ticketindex,jdbcType=TINYINT},
      </if>
      <if test="ticketnum != null" >
        #{ticketnum,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.WBirthdayticketExample" resultType="java.lang.Integer" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 24 20:17:58 CST 2019.
    -->
    select count(*) from W_BirthDayTicket
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.WBirthdayticket" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 24 20:17:58 CST 2019.
    -->
    update W_BirthDayTicket
    <set >
      <if test="ticketindex != null" >
        TicketIndex = #{ticketindex,jdbcType=TINYINT},
      </if>
      <if test="ticketnum != null" >
        TicketNum = #{ticketnum,jdbcType=TINYINT},
      </if>
    </set>
    where VIPTypeID = #{viptypeid,jdbcType=VARCHAR}
      and TicketId = #{ticketid,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WBirthdayticket" >
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Wed Jul 24 20:17:58 CST 2019.
    -->
    update W_BirthDayTicket
    set TicketIndex = #{ticketindex,jdbcType=TINYINT},
      TicketNum = #{ticketnum,jdbcType=TINYINT}
    where VIPTypeID = #{viptypeid,jdbcType=VARCHAR}
      and TicketId = #{ticketid,jdbcType=INTEGER}
  </update>
</mapper>