DrawlinePrizeSettingMapper.xml 5.82 KB
<?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.yoho.queue.dal.IDrawlinePrizeSettingDAO">
	<resultMap id="BaseResultMap" type="com.yoho.queue.dal.model.DrawlinePrizeSetting">
		<id column="id" property="id" jdbcType="INTEGER" />
		<result column="activity_id" property="activityId" jdbcType="INTEGER" />
		<result column="prize" property="prize" jdbcType="VARCHAR" />
		<result column="prize_type" property="prizeType" jdbcType="TINYINT" />
		<result column="white_list" property="whiteList" jdbcType="VARCHAR" />
		<result column="real_user_num" property="realUserNum" jdbcType="INTEGER" />
		<result column="sock_user_num" property="sockUserNum" jdbcType="INTEGER" />
		<result column="status" property="status" jdbcType="TINYINT" />
		<result column="create_time" property="createTime" jdbcType="INTEGER" />
		<result column="update_time" property="updateTime" jdbcType="INTEGER" />
	</resultMap>
	<sql id="Base_Column_List">
		id, activity_id, prize, prize_type, white_list, real_user_num, sock_user_num, status,
		create_time, update_time
	</sql>
	<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
		select
		<include refid="Base_Column_List" />
		from drawline_prize_setting
		where id = #{id,jdbcType=INTEGER}
	</select>
	<select id="selectByActivityId" resultMap="BaseResultMap" parameterType="java.lang.Integer">
		select
		<include refid="Base_Column_List" />
		from drawline_prize_setting
		where activity_id = #{activityId,jdbcType=INTEGER} and status = 1
	</select>
	<select id="DrawlinePrizeSetting" resultMap="BaseResultMap" parameterType="java.lang.Integer">
		select
		<include refid="Base_Column_List" />
		from drawline_prize_setting
		where activity_id = #{activityId,jdbcType=INTEGER}
	</select>
	<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
		delete from drawline_prize_setting
		where id = #{id,jdbcType=INTEGER}
	</delete>
	<insert id="insert" parameterType="com.yoho.queue.dal.model.DrawlinePrizeSetting">
		insert into drawline_prize_setting (id, activity_id, prize,
		prize_type, white_list, real_user_num,
		sock_user_num, status, create_time,
		update_time)
		values
		(#{id,jdbcType=INTEGER}, #{activityId,jdbcType=INTEGER}, #{prize,jdbcType=VARCHAR},
		#{prizeType,jdbcType=TINYINT}, #{whiteList,jdbcType=VARCHAR}, #{realUserNum,jdbcType=INTEGER},
		#{sockUserNum,jdbcType=INTEGER}, #{status,jdbcType=TINYINT}, #{createTime,jdbcType=INTEGER},
		#{updateTime,jdbcType=INTEGER})
	</insert>
	<insert id="insertSelective" parameterType="com.yoho.queue.dal.model.DrawlinePrizeSetting">
		insert into drawline_prize_setting
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="id != null">
				id,
			</if>
			<if test="activityId != null">
				activity_id,
			</if>
			<if test="prize != null">
				prize,
			</if>
			<if test="prizeType != null">
				prize_type,
			</if>
			<if test="whiteList != null">
				white_list,
			</if>
			<if test="realUserNum != null">
				real_user_num,
			</if>
			<if test="sockUserNum != null">
				sock_user_num,
			</if>
			<if test="status != null">
				status,
			</if>
			<if test="createTime != null">
				create_time,
			</if>
			<if test="updateTime != null">
				update_time,
			</if>
		</trim>
		<trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="id != null">
				#{id,jdbcType=INTEGER},
			</if>
			<if test="activityId != null">
				#{activityId,jdbcType=INTEGER},
			</if>
			<if test="prize != null">
				#{prize,jdbcType=VARCHAR},
			</if>
			<if test="prizeType != null">
				#{prizeType,jdbcType=TINYINT},
			</if>
			<if test="whiteList != null">
				#{whiteList,jdbcType=VARCHAR},
			</if>
			<if test="realUserNum != null">
				#{realUserNum,jdbcType=INTEGER},
			</if>
			<if test="sockUserNum != null">
				#{sockUserNum,jdbcType=INTEGER},
			</if>
			<if test="status != null">
				#{status,jdbcType=TINYINT},
			</if>
			<if test="createTime != null">
				#{createTime,jdbcType=INTEGER},
			</if>
			<if test="updateTime != null">
				#{updateTime,jdbcType=INTEGER},
			</if>
		</trim>
	</insert>
	<update id="updateByPrimaryKeySelective" parameterType="com.yoho.queue.dal.model.DrawlinePrizeSetting">
		update drawline_prize_setting
		<set>
			<if test="activityId != null">
				activity_id = #{activityId,jdbcType=INTEGER},
			</if>
			<if test="prize != null">
				prize = #{prize,jdbcType=VARCHAR},
			</if>
			<if test="prizeType != null">
				prize_type = #{prizeType,jdbcType=TINYINT},
			</if>
			<if test="whiteList != null">
				white_list = #{whiteList,jdbcType=VARCHAR},
			</if>
			<if test="realUserNum != null">
				real_user_num = #{realUserNum,jdbcType=INTEGER},
			</if>
			<if test="sockUserNum != null">
				sock_user_num = #{sockUserNum,jdbcType=INTEGER},
			</if>
			<if test="status != null">
				status = #{status,jdbcType=TINYINT},
			</if>
			<if test="createTime != null">
				create_time = #{createTime,jdbcType=INTEGER},
			</if>
			<if test="updateTime != null">
				update_time = #{updateTime,jdbcType=INTEGER},
			</if>
		</set>
		where id = #{id,jdbcType=INTEGER}
	</update>
	<update id="updateByPrimaryKey" parameterType="com.yoho.queue.dal.model.DrawlinePrizeSetting">
		update drawline_prize_setting
		set activity_id = #{activityId,jdbcType=INTEGER},
		prize = #{prize,jdbcType=VARCHAR},
		prize_type =
		#{prizeType,jdbcType=TINYINT},
		white_list = #{whiteList,jdbcType=VARCHAR},
		real_user_num = #{realUserNum,jdbcType=INTEGER},
		sock_user_num = #{sockUserNum,jdbcType=INTEGER},
		status =
		#{status,jdbcType=TINYINT},
		create_time = #{createTime,jdbcType=INTEGER},
		update_time = #{updateTime,jdbcType=INTEGER}
		where id = #{id,jdbcType=INTEGER}
	</update>
	<select id="selectByActivityIds" resultMap="BaseResultMap">
		select * from drawline_prize_setting where activity_id in(${activityIds})
	</select>
</mapper>