|
@@ -0,0 +1,112 @@
|
|
|
+<?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.fs.live.mapper.LiveLotteryConfMapper">
|
|
|
+
|
|
|
+ <resultMap type="LiveLotteryConf" id="LiveLotteryConfResult">
|
|
|
+ <result property="lotteryId" column="lottery_id" />
|
|
|
+ <result property="liveId" column="live_id" />
|
|
|
+ <result property="productId" column="product_id" />
|
|
|
+ <result property="prizeLevel" column="prize_level" />
|
|
|
+ <result property="perLotteryNum" column="per_lottery_num" />
|
|
|
+ <result property="totalLots" column="total_lots" />
|
|
|
+ <result property="totalSend" column="total_send" />
|
|
|
+ <result property="require" column="require" />
|
|
|
+ <result property="requireConf" column="require_conf" />
|
|
|
+ <result property="duration" column="duration" />
|
|
|
+ <result property="desc" column="desc" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="udpateTime" column="udpate_time" />
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectLiveLotteryConfVo">
|
|
|
+ select lottery_id, live_id, product_id, prize_level, per_lottery_num, total_lots, total_send, require, require_conf, duration, desc, create_time, udpate_time, create_by, update_by from live_lottery_conf
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectLiveLotteryConfList" parameterType="LiveLotteryConf" resultMap="LiveLotteryConfResult">
|
|
|
+ <include refid="selectLiveLotteryConfVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="liveId != null "> and live_id = #{liveId}</if>
|
|
|
+ <if test="productId != null "> and product_id = #{productId}</if>
|
|
|
+ <if test="prizeLevel != null "> and prize_level = #{prizeLevel}</if>
|
|
|
+ <if test="require != null "> and require = #{require}</if>
|
|
|
+ <if test="createTime != null "> and create_time = #{createTime}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectLiveLotteryConfByLotteryId" parameterType="Long" resultMap="LiveLotteryConfResult">
|
|
|
+ <include refid="selectLiveLotteryConfVo"/>
|
|
|
+ where lottery_id = #{lotteryId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertLiveLotteryConf" parameterType="LiveLotteryConf" useGeneratedKeys="true" keyProperty="lotteryId">
|
|
|
+ insert into live_lottery_conf
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="liveId != null">live_id,</if>
|
|
|
+ <if test="productId != null">product_id,</if>
|
|
|
+ <if test="prizeLevel != null">prize_level,</if>
|
|
|
+ <if test="perLotteryNum != null">per_lottery_num,</if>
|
|
|
+ <if test="totalLots != null">total_lots,</if>
|
|
|
+ <if test="totalSend != null">total_send,</if>
|
|
|
+ <if test="require != null">require,</if>
|
|
|
+ <if test="requireConf != null">require_conf,</if>
|
|
|
+ <if test="duration != null">duration,</if>
|
|
|
+ <if test="desc != null and desc != ''">desc,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="udpateTime != null">udpate_time,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="liveId != null">#{liveId},</if>
|
|
|
+ <if test="productId != null">#{productId},</if>
|
|
|
+ <if test="prizeLevel != null">#{prizeLevel},</if>
|
|
|
+ <if test="perLotteryNum != null">#{perLotteryNum},</if>
|
|
|
+ <if test="totalLots != null">#{totalLots},</if>
|
|
|
+ <if test="totalSend != null">#{totalSend},</if>
|
|
|
+ <if test="require != null">#{require},</if>
|
|
|
+ <if test="requireConf != null">#{requireConf},</if>
|
|
|
+ <if test="duration != null">#{duration},</if>
|
|
|
+ <if test="desc != null and desc != ''">#{desc},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="udpateTime != null">#{udpateTime},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateLiveLotteryConf" parameterType="LiveLotteryConf">
|
|
|
+ update live_lottery_conf
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="liveId != null">live_id = #{liveId},</if>
|
|
|
+ <if test="productId != null">product_id = #{productId},</if>
|
|
|
+ <if test="prizeLevel != null">prize_level = #{prizeLevel},</if>
|
|
|
+ <if test="perLotteryNum != null">per_lottery_num = #{perLotteryNum},</if>
|
|
|
+ <if test="totalLots != null">total_lots = #{totalLots},</if>
|
|
|
+ <if test="totalSend != null">total_send = #{totalSend},</if>
|
|
|
+ <if test="require != null">require = #{require},</if>
|
|
|
+ <if test="requireConf != null">require_conf = #{requireConf},</if>
|
|
|
+ <if test="duration != null">duration = #{duration},</if>
|
|
|
+ <if test="desc != null and desc != ''">desc = #{desc},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="udpateTime != null">udpate_time = #{udpateTime},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ </trim>
|
|
|
+ where lottery_id = #{lotteryId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteLiveLotteryConfByLotteryId" parameterType="Long">
|
|
|
+ delete from live_lottery_conf where lottery_id = #{lotteryId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteLiveLotteryConfByLotteryIds" parameterType="String">
|
|
|
+ delete from live_lottery_conf where lottery_id in
|
|
|
+ <foreach item="lotteryId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{lotteryId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|