123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <?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.record.UserGiftPurseMapper">
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.record.UserGiftPurse" >
- <id column="gift_purse_id" property="giftPurseId" jdbcType="INTEGER" />
- <result column="uid" property="uid" jdbcType="BIGINT" />
- <result column="gift_id" property="giftId" jdbcType="INTEGER" />
- <result column="count_num" property="countNum" jdbcType="INTEGER" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- </resultMap>
- <sql id="Base_Column_List" >
- gift_purse_id, uid, gift_id, count_num, create_time
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from user_gift_purse
- where gift_purse_id = #{giftPurseId,jdbcType=INTEGER}
- </select>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.record.UserGiftPurse" >
- <selectKey resultType="java.lang.Integer" keyProperty="giftPurseId" order="AFTER" >
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into user_gift_purse (uid, gift_id, count_num,
- create_time)
- values (#{uid,jdbcType=BIGINT}, #{giftId,jdbcType=INTEGER}, #{countNum,jdbcType=INTEGER},
- #{createTime,jdbcType=TIMESTAMP})
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.record.UserGiftPurse" >
- <selectKey resultType="java.lang.Integer" keyProperty="giftPurseId" order="AFTER" >
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into user_gift_purse
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="uid != null" >
- uid,
- </if>
- <if test="giftId != null" >
- gift_id,
- </if>
- <if test="countNum != null" >
- count_num,
- </if>
- <if test="createTime != null" >
- create_time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="uid != null" >
- #{uid,jdbcType=BIGINT},
- </if>
- <if test="giftId != null" >
- #{giftId,jdbcType=INTEGER},
- </if>
- <if test="countNum != null" >
- #{countNum,jdbcType=INTEGER},
- </if>
- <if test="createTime != null" >
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.record.UserGiftPurse" >
- update user_gift_purse
- <set >
- <if test="uid != null" >
- uid = #{uid,jdbcType=BIGINT},
- </if>
- <if test="giftId != null" >
- gift_id = #{giftId,jdbcType=INTEGER},
- </if>
- <if test="countNum != null" >
- count_num = #{countNum,jdbcType=INTEGER},
- </if>
- <if test="createTime != null" >
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where gift_purse_id = #{giftPurseId,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.record.UserGiftPurse" >
- update user_gift_purse
- set uid = #{uid,jdbcType=BIGINT},
- gift_id = #{giftId,jdbcType=INTEGER},
- count_num = #{countNum,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP}
- where gift_purse_id = #{giftPurseId,jdbcType=INTEGER}
- </update>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from user_gift_purse
- where gift_purse_id = #{giftPurseId,jdbcType=INTEGER}
- </delete>
- <select id="selectByUidOrGiftId" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from user_gift_purse
- where uid = #{uid} and gift_id = #{giftId}
- </select>
- </mapper>
|