123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <?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.users.UserPurseMapper" >
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.users.UserPurse" >
- <id column="uid" property="uid" jdbcType="BIGINT" />
- <result column="charge_gold_num" property="chargeGoldNum" jdbcType="BIGINT" />
- <result column="noble_gold_num" property="nobleGoldNum" jdbcType="BIGINT" />
- <result column="gold_num" property="goldNum" jdbcType="BIGINT" />
- <result column="diamond_num" property="diamondNum" jdbcType="DOUBLE" />
- <result column="deposit_num" property="depositNum" jdbcType="BIGINT" />
- <result column="is_first_charge" property="isFirstCharge" jdbcType="BIT" />
- <result column="first_recharge_time" property="firstRechargeTime" jdbcType="TIMESTAMP" />
- <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
- </resultMap>
- <sql id="Base_Column_List" >
- uid, charge_gold_num, noble_gold_num, gold_num, diamond_num, deposit_num, is_first_charge,
- first_recharge_time, update_time
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
- select
- <include refid="Base_Column_List" />
- from user_purse
- where uid = #{uid,jdbcType=BIGINT}
- </select>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserPurse" >
- insert into user_purse (uid, charge_gold_num, noble_gold_num,
- gold_num, diamond_num, deposit_num,
- is_first_charge, first_recharge_time, update_time
- )
- values (#{uid,jdbcType=BIGINT}, #{chargeGoldNum,jdbcType=BIGINT}, #{nobleGoldNum,jdbcType=BIGINT},
- #{goldNum,jdbcType=BIGINT}, #{diamondNum,jdbcType=DOUBLE}, #{depositNum,jdbcType=BIGINT},
- #{isFirstCharge,jdbcType=BIT}, #{firstRechargeTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserPurse" >
- insert into user_purse
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="uid != null" >
- uid,
- </if>
- <if test="chargeGoldNum != null" >
- charge_gold_num,
- </if>
- <if test="nobleGoldNum != null" >
- noble_gold_num,
- </if>
- <if test="goldNum != null" >
- gold_num,
- </if>
- <if test="diamondNum != null" >
- diamond_num,
- </if>
- <if test="depositNum != null" >
- deposit_num,
- </if>
- <if test="isFirstCharge != null" >
- is_first_charge,
- </if>
- <if test="firstRechargeTime != null" >
- first_recharge_time,
- </if>
- <if test="updateTime != null" >
- update_time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="uid != null" >
- #{uid,jdbcType=BIGINT},
- </if>
- <if test="chargeGoldNum != null" >
- #{chargeGoldNum,jdbcType=BIGINT},
- </if>
- <if test="nobleGoldNum != null" >
- #{nobleGoldNum,jdbcType=BIGINT},
- </if>
- <if test="goldNum != null" >
- #{goldNum,jdbcType=BIGINT},
- </if>
- <if test="diamondNum != null" >
- #{diamondNum,jdbcType=DOUBLE},
- </if>
- <if test="depositNum != null" >
- #{depositNum,jdbcType=BIGINT},
- </if>
- <if test="isFirstCharge != null" >
- #{isFirstCharge,jdbcType=BIT},
- </if>
- <if test="firstRechargeTime != null" >
- #{firstRechargeTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateTime != null" >
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserPurse" >
- update user_purse
- <set >
- <if test="chargeGoldNum != null" >
- charge_gold_num = #{chargeGoldNum,jdbcType=BIGINT},
- </if>
- <if test="nobleGoldNum != null" >
- noble_gold_num = #{nobleGoldNum,jdbcType=BIGINT},
- </if>
- <if test="goldNum != null" >
- gold_num = #{goldNum,jdbcType=BIGINT},
- </if>
- <if test="diamondNum != null" >
- diamond_num = #{diamondNum,jdbcType=DOUBLE},
- </if>
- <if test="depositNum != null" >
- deposit_num = #{depositNum,jdbcType=BIGINT},
- </if>
- <if test="isFirstCharge != null" >
- is_first_charge = #{isFirstCharge,jdbcType=BIT},
- </if>
- <if test="firstRechargeTime != null" >
- first_recharge_time = #{firstRechargeTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateTime != null" >
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where uid = #{uid,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserPurse" >
- update user_purse
- set charge_gold_num = #{chargeGoldNum,jdbcType=BIGINT},
- noble_gold_num = #{nobleGoldNum,jdbcType=BIGINT},
- gold_num = #{goldNum,jdbcType=BIGINT},
- diamond_num = #{diamondNum,jdbcType=DOUBLE},
- deposit_num = #{depositNum,jdbcType=BIGINT},
- is_first_charge = #{isFirstCharge,jdbcType=BIT},
- first_recharge_time = #{firstRechargeTime,jdbcType=TIMESTAMP},
- update_time = #{updateTime,jdbcType=TIMESTAMP}
- where uid = #{uid,jdbcType=BIGINT}
- </update>
- <update id="updateAddChargeGold">
- update user_purse set is_first_charge = 0, gold_num=gold_num + #{num},charge_gold_num=charge_gold_num + #{num},update_time=now()
- where uid=#{uid}
- </update>
- </mapper>
|