123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387 |
- <?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.juxiao.xchat.module.xbd.mapper.mall.GiftMapper">
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.mall.Gift">
- <id column="gift_id" jdbcType="INTEGER" property="giftId" />
- <result column="gift_name" jdbcType="VARCHAR" property="giftName" />
- <result column="gold_price" jdbcType="BIGINT" property="goldPrice" />
- <result column="seq_no" jdbcType="INTEGER" property="seqNo" />
- <result column="noble_id" jdbcType="INTEGER" property="nobleId" />
- <result column="noble_name" jdbcType="VARCHAR" property="nobleName" />
- <result column="is_noble_gift" jdbcType="BIT" property="isNobleGift" />
- <result column="gift_type" jdbcType="TINYINT" property="giftType" />
- <result column="gift_status" jdbcType="TINYINT" property="giftStatus" />
- <result column="pic_url" jdbcType="VARCHAR" property="picUrl" />
- <result column="has_gif_pic" jdbcType="BIT" property="hasGifPic" />
- <result column="gif_url" jdbcType="VARCHAR" property="gifUrl" />
- <result column="has_vgg_pic" jdbcType="BIT" property="hasVggPic" />
- <result column="vgg_url" jdbcType="VARCHAR" property="vggUrl" />
- <result column="is_latest" jdbcType="BIT" property="isLatest" />
- <result column="is_time_limit" jdbcType="BIT" property="isTimeLimit" />
- <result column="has_effect" jdbcType="BIT" property="hasEffect" />
- <result column="start_valid_time" jdbcType="TIMESTAMP" property="startValidTime" />
- <result column="end_valid_time" jdbcType="TIMESTAMP" property="endValidTime" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="is_express_gift" jdbcType="BIT" property="isExpressGift" />
- <result column="is_can_give" jdbcType="BIT" property="isCanGive" />
- </resultMap>
- <resultMap id="BaseGiftVOResultMap" type="com.juxiao.xchat.module.xbd.vo.GiftVO">
- <id column="gift_id" jdbcType="INTEGER" property="giftId" />
- <result column="gift_name" jdbcType="VARCHAR" property="giftName" />
- <result column="gold_price" jdbcType="BIGINT" property="goldPrice" />
- <result column="seq_no" jdbcType="INTEGER" property="seqNo" />
- <result column="noble_id" jdbcType="INTEGER" property="nobleId" />
- <result column="noble_name" jdbcType="VARCHAR" property="nobleName" />
- <result column="is_noble_gift" jdbcType="BIT" property="isNobleGift" />
- <result column="gift_type" jdbcType="TINYINT" property="giftType" />
- <result column="gift_status" jdbcType="TINYINT" property="giftStatus" />
- <result column="pic_url" jdbcType="VARCHAR" property="picUrl" />
- <result column="has_gif_pic" jdbcType="BIT" property="hasGifPic" />
- <result column="gif_url" jdbcType="VARCHAR" property="gifUrl" />
- <result column="has_vgg_pic" jdbcType="BIT" property="hasVggPic" />
- <result column="vgg_url" jdbcType="VARCHAR" property="vggUrl" />
- <result column="is_latest" jdbcType="BIT" property="isLatest" />
- <result column="is_time_limit" jdbcType="BIT" property="isTimeLimit" />
- <result column="has_effect" jdbcType="BIT" property="hasEffect" />
- <result column="start_valid_time" jdbcType="TIMESTAMP" property="startValidTime" />
- <result column="end_valid_time" jdbcType="TIMESTAMP" property="endValidTime" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="is_express_gift" jdbcType="BIT" property="isExpressGift" />
- <result column="is_can_give" jdbcType="BIT" property="isCanGive" />
- </resultMap>
- <sql id="Base_Column_List">
- gift_id, gift_name, gold_price, seq_no, noble_id, noble_name, is_noble_gift, gift_type,
- gift_status, pic_url, has_gif_pic, gif_url, has_vgg_pic, vgg_url, is_latest, is_time_limit,
- has_effect, start_valid_time, end_valid_time, create_time, is_express_gift, is_can_give
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from gift
- where gift_id = #{giftId,jdbcType=INTEGER}
- </select>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.mall.Gift">
- insert into gift (gift_id, gift_name, gold_price,
- seq_no, noble_id, noble_name,
- is_noble_gift, gift_type, gift_status,
- pic_url, has_gif_pic, gif_url,
- has_vgg_pic, vgg_url, is_latest,
- is_time_limit, has_effect, start_valid_time,
- end_valid_time, create_time, is_express_gift,
- is_can_give)
- values (#{giftId,jdbcType=INTEGER}, #{giftName,jdbcType=VARCHAR}, #{goldPrice,jdbcType=BIGINT},
- #{seqNo,jdbcType=INTEGER}, #{nobleId,jdbcType=INTEGER}, #{nobleName,jdbcType=VARCHAR},
- #{isNobleGift,jdbcType=BIT}, #{giftType,jdbcType=TINYINT}, #{giftStatus,jdbcType=TINYINT},
- #{picUrl,jdbcType=VARCHAR}, #{hasGifPic,jdbcType=BIT}, #{gifUrl,jdbcType=VARCHAR},
- #{hasVggPic,jdbcType=BIT}, #{vggUrl,jdbcType=VARCHAR}, #{isLatest,jdbcType=BIT},
- #{isTimeLimit,jdbcType=BIT}, #{hasEffect,jdbcType=BIT}, #{startValidTime,jdbcType=TIMESTAMP},
- #{endValidTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{isExpressGift,jdbcType=BIT},
- #{isCanGive,jdbcType=BIT})
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.mall.Gift" useGeneratedKeys="true" keyProperty="giftId" keyColumn="gift_id">
- insert into gift
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="giftId != null">
- gift_id,
- </if>
- <if test="giftName != null">
- gift_name,
- </if>
- <if test="goldPrice != null">
- gold_price,
- </if>
- <if test="seqNo != null">
- seq_no,
- </if>
- <if test="nobleId != null">
- noble_id,
- </if>
- <if test="nobleName != null">
- noble_name,
- </if>
- <if test="isNobleGift != null">
- is_noble_gift,
- </if>
- <if test="giftType != null">
- gift_type,
- </if>
- <if test="giftStatus != null">
- gift_status,
- </if>
- <if test="picUrl != null">
- pic_url,
- </if>
- <if test="hasGifPic != null">
- has_gif_pic,
- </if>
- <if test="gifUrl != null">
- gif_url,
- </if>
- <if test="hasVggPic != null">
- has_vgg_pic,
- </if>
- <if test="vggUrl != null">
- vgg_url,
- </if>
- <if test="isLatest != null">
- is_latest,
- </if>
- <if test="isTimeLimit != null">
- is_time_limit,
- </if>
- <if test="hasEffect != null">
- has_effect,
- </if>
- <if test="startValidTime != null">
- start_valid_time,
- </if>
- <if test="endValidTime != null">
- end_valid_time,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="isExpressGift != null">
- is_express_gift,
- </if>
- <if test="isCanGive != null">
- is_can_give,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="giftId != null">
- #{giftId,jdbcType=INTEGER},
- </if>
- <if test="giftName != null">
- #{giftName,jdbcType=VARCHAR},
- </if>
- <if test="goldPrice != null">
- #{goldPrice,jdbcType=BIGINT},
- </if>
- <if test="seqNo != null">
- #{seqNo,jdbcType=INTEGER},
- </if>
- <if test="nobleId != null">
- #{nobleId,jdbcType=INTEGER},
- </if>
- <if test="nobleName != null">
- #{nobleName,jdbcType=VARCHAR},
- </if>
- <if test="isNobleGift != null">
- #{isNobleGift,jdbcType=BIT},
- </if>
- <if test="giftType != null">
- #{giftType,jdbcType=TINYINT},
- </if>
- <if test="giftStatus != null">
- #{giftStatus,jdbcType=TINYINT},
- </if>
- <if test="picUrl != null">
- #{picUrl,jdbcType=VARCHAR},
- </if>
- <if test="hasGifPic != null">
- #{hasGifPic,jdbcType=BIT},
- </if>
- <if test="gifUrl != null">
- #{gifUrl,jdbcType=VARCHAR},
- </if>
- <if test="hasVggPic != null">
- #{hasVggPic,jdbcType=BIT},
- </if>
- <if test="vggUrl != null">
- #{vggUrl,jdbcType=VARCHAR},
- </if>
- <if test="isLatest != null">
- #{isLatest,jdbcType=BIT},
- </if>
- <if test="isTimeLimit != null">
- #{isTimeLimit,jdbcType=BIT},
- </if>
- <if test="hasEffect != null">
- #{hasEffect,jdbcType=BIT},
- </if>
- <if test="startValidTime != null">
- #{startValidTime,jdbcType=TIMESTAMP},
- </if>
- <if test="endValidTime != null">
- #{endValidTime,jdbcType=TIMESTAMP},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="isExpressGift != null">
- #{isExpressGift,jdbcType=BIT},
- </if>
- <if test="isCanGive != null">
- #{isCanGive,jdbcType=BIT},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.mall.Gift">
- update gift
- <set>
- <if test="giftName != null">
- gift_name = #{giftName,jdbcType=VARCHAR},
- </if>
- <if test="goldPrice != null">
- gold_price = #{goldPrice,jdbcType=BIGINT},
- </if>
- <if test="seqNo != null">
- seq_no = #{seqNo,jdbcType=INTEGER},
- </if>
- <if test="nobleId != null">
- noble_id = #{nobleId,jdbcType=INTEGER},
- </if>
- <if test="nobleName != null">
- noble_name = #{nobleName,jdbcType=VARCHAR},
- </if>
- <if test="isNobleGift != null">
- is_noble_gift = #{isNobleGift,jdbcType=BIT},
- </if>
- <if test="giftType != null">
- gift_type = #{giftType,jdbcType=TINYINT},
- </if>
- <if test="giftStatus != null">
- gift_status = #{giftStatus,jdbcType=TINYINT},
- </if>
- <if test="picUrl != null">
- pic_url = #{picUrl,jdbcType=VARCHAR},
- </if>
- <if test="hasGifPic != null">
- has_gif_pic = #{hasGifPic,jdbcType=BIT},
- </if>
- <if test="gifUrl != null">
- gif_url = #{gifUrl,jdbcType=VARCHAR},
- </if>
- <if test="hasVggPic != null">
- has_vgg_pic = #{hasVggPic,jdbcType=BIT},
- </if>
- <if test="vggUrl != null">
- vgg_url = #{vggUrl,jdbcType=VARCHAR},
- </if>
- <if test="isLatest != null">
- is_latest = #{isLatest,jdbcType=BIT},
- </if>
- <if test="isTimeLimit != null">
- is_time_limit = #{isTimeLimit,jdbcType=BIT},
- </if>
- <if test="hasEffect != null">
- has_effect = #{hasEffect,jdbcType=BIT},
- </if>
- <if test="startValidTime != null">
- start_valid_time = #{startValidTime,jdbcType=TIMESTAMP},
- </if>
- <if test="endValidTime != null">
- end_valid_time = #{endValidTime,jdbcType=TIMESTAMP},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="isExpressGift != null">
- is_express_gift = #{isExpressGift,jdbcType=BIT},
- </if>
- <if test="isCanGive != null">
- is_can_give = #{isCanGive,jdbcType=BIT},
- </if>
- </set>
- where gift_id = #{giftId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.mall.Gift">
- update gift
- set gift_name = #{giftName,jdbcType=VARCHAR},
- gold_price = #{goldPrice,jdbcType=BIGINT},
- seq_no = #{seqNo,jdbcType=INTEGER},
- noble_id = #{nobleId,jdbcType=INTEGER},
- noble_name = #{nobleName,jdbcType=VARCHAR},
- is_noble_gift = #{isNobleGift,jdbcType=BIT},
- gift_type = #{giftType,jdbcType=TINYINT},
- gift_status = #{giftStatus,jdbcType=TINYINT},
- pic_url = #{picUrl,jdbcType=VARCHAR},
- has_gif_pic = #{hasGifPic,jdbcType=BIT},
- gif_url = #{gifUrl,jdbcType=VARCHAR},
- has_vgg_pic = #{hasVggPic,jdbcType=BIT},
- vgg_url = #{vggUrl,jdbcType=VARCHAR},
- is_latest = #{isLatest,jdbcType=BIT},
- is_time_limit = #{isTimeLimit,jdbcType=BIT},
- has_effect = #{hasEffect,jdbcType=BIT},
- start_valid_time = #{startValidTime,jdbcType=TIMESTAMP},
- end_valid_time = #{endValidTime,jdbcType=TIMESTAMP},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- is_express_gift = #{isExpressGift,jdbcType=BIT},
- is_can_give = #{isCanGive,jdbcType=BIT}
- where gift_id = #{giftId,jdbcType=INTEGER}
- </update>
- <select id="selectByGiftType" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from gift
- where gift_type = #{type}
- </select>
- <select id="selectGiftByList" resultMap="BaseGiftVOResultMap">
- select
- <include refid="Base_Column_List" />
- from gift
- where del_flag = 1
- <if test="name != null and name != ''">
- and gift_name LIKE CONCAT('%',#{name},'%')
- </if>
- <if test="status != null">
- and gift_status = #{status}
- </if>
- <if test="type != null">
- and gift_type = #{type}
- </if>
- order by seq_no asc , create_time desc
- </select>
- <select id="selectByGiftName" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from gift
- where del_flag = 1 and gift_name = #{giftName}
- </select>
- <delete id="deleteGiftByIds" parameterType="java.lang.Long">
- update gift set del_flag = 2 , gift_status = 2 where gift_id in
- <foreach collection="array" item="giftId" open="(" separator="," close=")">
- #{giftId}
- </foreach>
- </delete>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- update gift set , gift_status = 2 del_flag = 2
- where gift_id = #{giftId,jdbcType=INTEGER}
- </delete>
- <select id="selectValidGiftById" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from gift
- where del_flag = 1 and gift_id = #{giftId} and gift_status = 1
- </select>
- <select id="selectGiftValidByList" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from gift
- where del_flag = 1 and gift_status = 1
- </select>
- <select id="selectGifts" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from gift
- where del_flag = 1
- </select>
- </mapper>
|