<?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.WLuckyenterMapper">
  <resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.WLuckyenter">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 08 14:50:51 CST 2016.
    -->
    <id column="PromotionsID" jdbcType="INTEGER" property="promotionsid" />
    <id column="Vipid" jdbcType="VARCHAR" property="vipid" />
    <result column="DrawTimes" jdbcType="INTEGER" property="drawtimes" />
    <result column="WinningTime" jdbcType="INTEGER" property="winningtime" />
    <result column="FirstEnterTime" jdbcType="TIMESTAMP" property="firstentertime" />
    <result column="LastTime" jdbcType="TIMESTAMP" property="lasttime" />
    <result column="CurrentTime" jdbcType="INTEGER" property="currenttime" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 08 14:50:51 CST 2016.
    -->
    <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="Base_Column_List">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 08 14:50:51 CST 2016.
    -->
    PromotionsID, Vipid, DrawTimes, WinningTime, FirstEnterTime, LastTime, CurrentTime
  </sql>
  <select id="selectByExample" parameterType="com.fuxi.ws.data.entity.WLuckyenterExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 08 14:50:51 CST 2016.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    'false' as QUERYID,
    <include refid="Base_Column_List" />
    from W_LuckyEnter
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WLuckyenterKey" resultMap="BaseResultMap">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 08 14:50:51 CST 2016.
    -->
    select 
    <include refid="Base_Column_List" />
    from W_LuckyEnter
    where PromotionsID = #{promotionsid,jdbcType=INTEGER}
      and Vipid = #{vipid,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WLuckyenterKey">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 08 14:50:51 CST 2016.
    -->
    delete from W_LuckyEnter
    where PromotionsID = #{promotionsid,jdbcType=INTEGER}
      and Vipid = #{vipid,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.fuxi.ws.data.entity.WLuckyenter">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 08 14:50:51 CST 2016.
    -->
    insert into W_LuckyEnter (PromotionsID, Vipid, DrawTimes, 
      WinningTime, FirstEnterTime, LastTime, 
      CurrentTime)
    values (#{promotionsid,jdbcType=INTEGER}, #{vipid,jdbcType=VARCHAR}, #{drawtimes,jdbcType=INTEGER}, 
      #{winningtime,jdbcType=INTEGER}, #{firstentertime,jdbcType=TIMESTAMP}, #{lasttime,jdbcType=TIMESTAMP}, 
      #{currenttime,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.WLuckyenter">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 08 14:50:51 CST 2016.
    -->
    insert into W_LuckyEnter
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="promotionsid != null">
        PromotionsID,
      </if>
      <if test="vipid != null">
        Vipid,
      </if>
      <if test="drawtimes != null">
        DrawTimes,
      </if>
      <if test="winningtime != null">
        WinningTime,
      </if>
      <if test="firstentertime != null">
        FirstEnterTime,
      </if>
      <if test="lasttime != null">
        LastTime,
      </if>
      <if test="currenttime != null">
        CurrentTime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="promotionsid != null">
        #{promotionsid,jdbcType=INTEGER},
      </if>
      <if test="vipid != null">
        #{vipid,jdbcType=VARCHAR},
      </if>
      <if test="drawtimes != null">
        #{drawtimes,jdbcType=INTEGER},
      </if>
      <if test="winningtime != null">
        #{winningtime,jdbcType=INTEGER},
      </if>
      <if test="firstentertime != null">
        #{firstentertime,jdbcType=TIMESTAMP},
      </if>
      <if test="lasttime != null">
        #{lasttime,jdbcType=TIMESTAMP},
      </if>
      <if test="currenttime != null">
        #{currenttime,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.fuxi.ws.data.entity.WLuckyenterExample" resultType="java.lang.Integer">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 08 14:50:51 CST 2016.
    -->
    select count(*) from W_LuckyEnter
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.WLuckyenter">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 08 14:50:51 CST 2016.
    -->
    update W_LuckyEnter
    <set>
      <if test="drawtimes != null">
        DrawTimes = #{drawtimes,jdbcType=INTEGER},
      </if>
      <if test="winningtime != null">
        WinningTime = #{winningtime,jdbcType=INTEGER},
      </if>
      <if test="firstentertime != null">
        FirstEnterTime = #{firstentertime,jdbcType=TIMESTAMP},
      </if>
      <if test="lasttime != null">
        LastTime = #{lasttime,jdbcType=TIMESTAMP},
      </if>
      <if test="currenttime != null">
        CurrentTime = #{currenttime,jdbcType=INTEGER},
      </if>
    </set>
    where PromotionsID = #{promotionsid,jdbcType=INTEGER}
      and Vipid = #{vipid,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WLuckyenter">
    <!--
      WARNING - @mbggenerated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Tue Mar 08 14:50:51 CST 2016.
    -->
    update W_LuckyEnter
    set DrawTimes = #{drawtimes,jdbcType=INTEGER},
      WinningTime = #{winningtime,jdbcType=INTEGER},
      FirstEnterTime = #{firstentertime,jdbcType=TIMESTAMP},
      LastTime = #{lasttime,jdbcType=TIMESTAMP},
      CurrentTime = #{currenttime,jdbcType=INTEGER}
    where PromotionsID = #{promotionsid,jdbcType=INTEGER}
      and Vipid = #{vipid,jdbcType=VARCHAR}
  </update>
</mapper>