<?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.WVipgiftMapper">
	<resultMap id="BaseResultMap" type="com.fuxi.ws.data.entity.WVipgift">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Mar 02 
			17:19:39 CST 2016. -->
		<id column="VipGiftID" jdbcType="INTEGER" property="vipgiftid" />
		<result column="Vipid" jdbcType="VARCHAR" property="vipid" />
		<result column="PromotionsID" jdbcType="INTEGER" property="promotionsid" />
		<result column="GoodsID" jdbcType="VARCHAR" property="goodsid" />
		<result column="ColorID" jdbcType="VARCHAR" property="colorid" />
		<result column="SizeID" jdbcType="VARCHAR" property="sizeid" />
		<result column="LuckyType" jdbcType="TINYINT" property="luckytype" />
		<result column="TicketID" jdbcType="BIGINT" property="ticketid" />
		<result column="LuckyNum" jdbcType="DECIMAL" property="luckynum" />
		<result column="LuckyTime" jdbcType="TIMESTAMP" property="luckytime" />
		<result column="Received" jdbcType="TINYINT" property="received" />
		<result column="ReceiveDate" jdbcType="TIMESTAMP" property="receivedate" />
		<result column="SendDate" jdbcType="TIMESTAMP" property="senddate" />
	</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 Mar 02 
			17:19:39 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 Wed Mar 02 
			17:19:39 CST 2016. -->
		VipGiftID, Vipid, PromotionsID, GoodsID, ColorID, SizeID, LuckyType,
		TicketID, LuckyNum,
		LuckyTime, Received, ReceiveDate, SendDate
	</sql>
	<select id="selectByExample" parameterType="com.fuxi.ws.data.entity.WVipgiftExample"
		resultMap="BaseResultMap">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Mar 02 
			17:19:39 CST 2016. -->
		select
		<if test="distinct">
			distinct
		</if>
		'false' as QUERYID,
		<include refid="Base_Column_List" />
		from W_VipGift
		<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.Integer"
		resultMap="BaseResultMap">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Mar 02 
			17:19:39 CST 2016. -->
		select
		<include refid="Base_Column_List" />
		from W_VipGift
		where VipGiftID = #{vipgiftid,jdbcType=INTEGER}
	</select>
	<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Mar 02 
			17:19:39 CST 2016. -->
		delete from W_VipGift
		where VipGiftID = #{vipgiftid,jdbcType=INTEGER}
	</delete>
	<insert id="insert" parameterType="com.fuxi.ws.data.entity.WVipgift">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Mar 02 
			17:19:39 CST 2016. -->
		insert into W_VipGift (VipGiftID, Vipid, PromotionsID,
		GoodsID,
		ColorID, SizeID,
		LuckyType, TicketID, LuckyNum,
		LuckyTime, Received,
		ReceiveDate,
		SendDate)
		values (#{vipgiftid,jdbcType=INTEGER},
		#{vipid,jdbcType=VARCHAR},
		#{promotionsid,jdbcType=INTEGER},
		#{goodsid,jdbcType=VARCHAR}, #{colorid,jdbcType=VARCHAR},
		#{sizeid,jdbcType=VARCHAR},
		#{luckytype,jdbcType=TINYINT},
		#{ticketid,jdbcType=BIGINT},
		#{luckynum,jdbcType=DECIMAL},
		#{luckytime,jdbcType=TIMESTAMP}, #{received,jdbcType=TINYINT},
		#{receivedate,jdbcType=TIMESTAMP},
		#{senddate,jdbcType=TIMESTAMP})
	</insert>
	<insert id="insertSelective" parameterType="com.fuxi.ws.data.entity.WVipgift">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Mar 02 
			17:19:39 CST 2016. -->
		insert into W_VipGift
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="vipgiftid != null">
				VipGiftID,
			</if>
			<if test="vipid != null">
				Vipid,
			</if>
			<if test="promotionsid != null">
				PromotionsID,
			</if>
			<if test="goodsid != null">
				GoodsID,
			</if>
			<if test="colorid != null">
				ColorID,
			</if>
			<if test="sizeid != null">
				SizeID,
			</if>
			<if test="luckytype != null">
				LuckyType,
			</if>
			<if test="ticketid != null">
				TicketID,
			</if>
			<if test="luckynum != null">
				LuckyNum,
			</if>
			<if test="luckytime != null">
				LuckyTime,
			</if>
			<if test="received != null">
				Received,
			</if>
			<if test="receivedate != null">
				ReceiveDate,
			</if>
			<if test="senddate != null">
				SendDate,
			</if>
		</trim>
		<trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="vipgiftid != null">
				#{vipgiftid,jdbcType=INTEGER},
			</if>
			<if test="vipid != null">
				#{vipid,jdbcType=VARCHAR},
			</if>
			<if test="promotionsid != null">
				#{promotionsid,jdbcType=INTEGER},
			</if>
			<if test="goodsid != null">
				#{goodsid,jdbcType=VARCHAR},
			</if>
			<if test="colorid != null">
				#{colorid,jdbcType=VARCHAR},
			</if>
			<if test="sizeid != null">
				#{sizeid,jdbcType=VARCHAR},
			</if>
			<if test="luckytype != null">
				#{luckytype,jdbcType=TINYINT},
			</if>
			<if test="ticketid != null">
				#{ticketid,jdbcType=BIGINT},
			</if>
			<if test="luckynum != null">
				#{luckynum,jdbcType=DECIMAL},
			</if>
			<if test="luckytime != null">
				#{luckytime,jdbcType=TIMESTAMP},
			</if>
			<if test="received != null">
				#{received,jdbcType=TINYINT},
			</if>
			<if test="receivedate != null">
				#{receivedate,jdbcType=TIMESTAMP},
			</if>
			<if test="senddate != null">
				#{senddate,jdbcType=TIMESTAMP},
			</if>
		</trim>
	</insert>
	<select id="countByExample" parameterType="com.fuxi.ws.data.entity.WVipgiftExample"
		resultType="java.lang.Integer">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Mar 02 
			17:19:39 CST 2016. -->
		select count(*) from W_VipGift
		<if test="_parameter != null">
			<include refid="Example_Where_Clause" />
		</if>
	</select>
	<update id="updateByPrimaryKeySelective" parameterType="com.fuxi.ws.data.entity.WVipgift">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Mar 02 
			17:19:39 CST 2016. -->
		update W_VipGift
		<set>
			<if test="vipid != null">
				Vipid = #{vipid,jdbcType=VARCHAR},
			</if>
			<if test="promotionsid != null">
				PromotionsID = #{promotionsid,jdbcType=INTEGER},
			</if>
			<if test="goodsid != null">
				GoodsID = #{goodsid,jdbcType=VARCHAR},
			</if>
			<if test="colorid != null">
				ColorID = #{colorid,jdbcType=VARCHAR},
			</if>
			<if test="sizeid != null">
				SizeID = #{sizeid,jdbcType=VARCHAR},
			</if>
			<if test="luckytype != null">
				LuckyType = #{luckytype,jdbcType=TINYINT},
			</if>
			<if test="ticketid != null">
				TicketID = #{ticketid,jdbcType=BIGINT},
			</if>
			<if test="luckynum != null">
				LuckyNum = #{luckynum,jdbcType=DECIMAL},
			</if>
			<if test="luckytime != null">
				LuckyTime = #{luckytime,jdbcType=TIMESTAMP},
			</if>
			<if test="received != null">
				Received = #{received,jdbcType=TINYINT},
			</if>
			<if test="receivedate != null">
				ReceiveDate = #{receivedate,jdbcType=TIMESTAMP},
			</if>
			<if test="senddate != null">
				SendDate = #{senddate,jdbcType=TIMESTAMP},
			</if>
		</set>
		where VipGiftID = #{vipgiftid,jdbcType=INTEGER}
	</update>
	<update id="updateByPrimaryKey" parameterType="com.fuxi.ws.data.entity.WVipgift">
		<!-- WARNING - @mbggenerated This element is automatically generated by 
			MyBatis Generator, do not modify. This element was generated on Wed Mar 02 
			17:19:39 CST 2016. -->
		update W_VipGift
		set Vipid = #{vipid,jdbcType=VARCHAR},
		PromotionsID =
		#{promotionsid,jdbcType=INTEGER},
		GoodsID =
		#{goodsid,jdbcType=VARCHAR},
		ColorID = #{colorid,jdbcType=VARCHAR},
		SizeID = #{sizeid,jdbcType=VARCHAR},
		LuckyType =
		#{luckytype,jdbcType=TINYINT},
		TicketID = #{ticketid,jdbcType=BIGINT},
		LuckyNum = #{luckynum,jdbcType=DECIMAL},
		LuckyTime =
		#{luckytime,jdbcType=TIMESTAMP},
		Received =
		#{received,jdbcType=TINYINT},
		ReceiveDate =
		#{receivedate,jdbcType=TIMESTAMP},
		SendDate =
		#{senddate,jdbcType=TIMESTAMP}
		where VipGiftID =
		#{vipgiftid,jdbcType=INTEGER}
	</update>

	<select id="myGifts" resultType="java.util.LinkedHashMap">
		${ sql }
	</select>
</mapper>