<?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.yeshi.fanli.dao.mybatis.user.UserInfoExtraMapper">
|
<resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserInfoExtra">
|
<id column="uie_id" property="id" jdbcType="BIGINT" />
|
<result column="uie_rank_source" property="rankSource"
|
jdbcType="INTEGER" />
|
<result column="uie_rank_order_num" property="rankOrderNum"
|
jdbcType="INTEGER" />
|
<result column="uie_rank_update_time" property="rankUpdateTime"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_invite_code" property="inviteCode"
|
jdbcType="VARCHAR" />
|
<result column="uie_lottery_newbies" property="lotteryNewbies"
|
jdbcType="INTEGER" />
|
<result column="uie_coupon_news" property="couponNews"
|
jdbcType="INTEGER" />
|
<result column="uie_synch_navbar" property="synchNavbar"
|
jdbcType="VARCHAR" />
|
<result column="uie_first_login_time" property="firstLoginTime"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_create_time" property="createTime"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_update_time" property="updateTime"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_sex" property="sex" jdbcType="INTEGER" />
|
<result column="uie_weixin" property="weiXin" jdbcType="VARCHAR" />
|
<result column="uie_ercode" property="erCode" jdbcType="VARCHAR" />
|
<result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" />
|
<result column="uie_auto_extract" property="autoExtract"
|
jdbcType="BOOLEAN" />
|
<result column="uie_close_time_extract" property="closeTimeExtract"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_active_time" property="activeTime"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_mark" property="mark" jdbcType="VARCHAR" />
|
<result column="uie_invite_code_vip" property="inviteCodeVip"
|
jdbcType="VARCHAR" />
|
<association property="userInfo" column="uie_uid"
|
javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
<id column="uie_uid" property="id" jdbcType="BIGINT" />
|
</association>
|
<association property="userRank" column="uie_rank_id"
|
javaType="com.yeshi.fanli.entity.bus.user.UserRank"
|
select="com.yeshi.fanli.dao.mybatis.user.UserRankMapper.selectByPrimaryKey" />
|
|
</resultMap>
|
<resultMap id="VOResultMap" type="com.yeshi.fanli.vo.user.UserInfoExtraVO">
|
<id column="uie_id" property="id" jdbcType="BIGINT" />
|
<result column="uie_rank_source" property="rankSource"
|
jdbcType="INTEGER" />
|
<result column="uie_rank_order_num" property="rankOrderNum"
|
jdbcType="INTEGER" />
|
<result column="uie_rank_update_time" property="rankUpdateTime"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_invite_code" property="inviteCode"
|
jdbcType="VARCHAR" />
|
<result column="uie_lottery_newbies" property="lotteryNewbies"
|
jdbcType="INTEGER" />
|
<result column="uie_coupon_news" property="couponNews"
|
jdbcType="INTEGER" />
|
<result column="uie_synch_navbar" property="synchNavbar"
|
jdbcType="VARCHAR" />
|
<result column="uie_first_login_time" property="firstLoginTime"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_create_time" property="createTime"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_update_time" property="updateTime"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_sex" property="sex" jdbcType="INTEGER" />
|
<result column="uie_weixin" property="weiXin" jdbcType="VARCHAR" />
|
<result column="uie_ercode" property="erCode" jdbcType="VARCHAR" />
|
<result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" />
|
<result column="uie_auto_extract" property="autoExtract"
|
jdbcType="BOOLEAN" />
|
<result column="uie_close_time_extract" property="closeTimeExtract"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_active_time" property="activeTime"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_mark" property="mark" jdbcType="VARCHAR" />
|
<result column="uie_invite_code_vip" property="inviteCodeVip"
|
jdbcType="VARCHAR" />
|
<association property="userInfo" column="uie_uid"
|
resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap" />
|
<association property="userRank" column="uie_rank_id"
|
resultMap="com.yeshi.fanli.dao.mybatis.user.UserRankMapper.BaseResultMap" />
|
</resultMap>
|
<resultMap id="AllResultMap" type="com.yeshi.fanli.entity.bus.user.UserInfoExtra">
|
<id column="uie_id" property="id" jdbcType="BIGINT" />
|
<result column="uie_rank_source" property="rankSource"
|
jdbcType="INTEGER" />
|
<result column="uie_rank_order_num" property="rankOrderNum"
|
jdbcType="INTEGER" />
|
<result column="uie_rank_update_time" property="rankUpdateTime"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_invite_code" property="inviteCode"
|
jdbcType="VARCHAR" />
|
<result column="uie_lottery_newbies" property="lotteryNewbies"
|
jdbcType="INTEGER" />
|
<result column="uie_coupon_news" property="couponNews"
|
jdbcType="INTEGER" />
|
<result column="uie_synch_navbar" property="synchNavbar"
|
jdbcType="VARCHAR" />
|
<result column="uie_first_login_time" property="firstLoginTime"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_create_time" property="createTime"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_update_time" property="updateTime"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_sex" property="sex" jdbcType="INTEGER" />
|
<result column="uie_weixin" property="weiXin" jdbcType="VARCHAR" />
|
<result column="uie_ercode" property="erCode" jdbcType="VARCHAR" />
|
<result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" />
|
<result column="uie_auto_extract" property="autoExtract"
|
jdbcType="BOOLEAN" />
|
<result column="uie_close_time_extract" property="closeTimeExtract"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_active_time" property="activeTime"
|
jdbcType="TIMESTAMP" />
|
<result column="uie_mark" property="mark" jdbcType="VARCHAR" />
|
<result column="uie_invite_code_vip" property="inviteCodeVip"
|
jdbcType="VARCHAR" />
|
<association property="userInfo" column="uie_uid"
|
javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
<id column="uie_uid" property="id" jdbcType="BIGINT" />
|
</association>
|
<association property="userRank" column="uie_rank_id"
|
resultMap="com.yeshi.fanli.dao.mybatis.user.UserRankMapper.BaseResultMap" />
|
</resultMap>
|
<sql id="Base_Column_List">uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_sex,uie_weixin,uie_gold_coin,uie_create_time,uie_update_time,uie_auto_extract,uie_close_time_extract,uie_active_time,uie_mark,uie_invite_code_vip,uie_ercode
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
parameterType="java.lang.Long">
|
select
|
<include refid="Base_Column_List" />
|
from yeshi_ec_user_info_extra where uie_id = #{id,jdbcType=BIGINT}
|
</select>
|
|
<select id="countByInviteCode" resultType="Long">
|
SELECT IFNULL(COUNT(uie_id),0) FROM yeshi_ec_user_info_extra
|
WHERE uie_invite_code = #{inviteCode} OR uie_invite_code_vip = #{inviteCode}
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
yeshi_ec_user_info_extra where uie_id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra"
|
useGeneratedKeys="true" keyProperty="id">insert into
|
yeshi_ec_user_info_extra
|
(uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_sex,uie_weixin,uie_gold_coin,uie_create_time,uie_update_time,uie_auto_extract,uie_close_time_extract,uie_active_time,uie_mark,uie_invite_code_vip,uie_ercode)
|
values
|
(#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{userRank.id,jdbcType=BIGINT},#{rankSource,jdbcType=INTEGER},#{rankOrderNum,jdbcType=INTEGER},#{rankUpdateTime,jdbcType=TIMESTAMP},#{inviteCode,jdbcType=VARCHAR},#{lotteryNewbies,jdbcType=INTEGER},#{couponNews,jdbcType=INTEGER},#{synchNavbar,jdbcType=VARCHAR},#{firstLoginTime,jdbcType=TIMESTAMP},#{sex,jdbcType=INTEGER},#{weiXin,jdbcType=VARCHAR},#{goldCoin,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{autoExtract,jdbcType=BOOLEAN},#{closeTimeExtract,jdbcType=TIMESTAMP},#{activeTime,jdbcType=TIMESTAMP},#{mark,jdbcType=VARCHAR},#{inviteCodeVip,jdbcType=VARCHAR},#{erCode,jdbcType=VARCHAR})
|
</insert>
|
<insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra"
|
useGeneratedKeys="true" keyProperty="id">
|
insert into yeshi_ec_user_info_extra
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">uie_id,</if>
|
<if test="userInfo != null">uie_uid,</if>
|
<if test="userRank != null">uie_rank_id,</if>
|
<if test="rankSource != null">uie_rank_source,</if>
|
<if test="rankOrderNum != null">uie_rank_order_num,</if>
|
<if test="rankUpdateTime != null">uie_rank_update_time,</if>
|
<if test="inviteCode != null">uie_invite_code,</if>
|
<if test="lotteryNewbies != null">uie_lottery_newbies,</if>
|
<if test="couponNews != null">uie_coupon_news,</if>
|
<if test="synchNavbar != null">uie_synch_navbar,</if>
|
<if test="firstLoginTime != null">uie_first_login_time,</if>
|
<if test="sex != null">uie_sex,</if>
|
<if test="weiXin != null">uie_weixin,</if>
|
<if test="erCode != null">uie_ercode,</if>
|
<if test="goldCoin != null">uie_gold_coin,</if>
|
<if test="createTime != null">uie_create_time,</if>
|
<if test="updateTime != null">uie_update_time,</if>
|
<if test="autoExtract != null">uie_auto_extract,</if>
|
<if test="closeTimeExtract != null">uie_close_time_extract,</if>
|
<if test="activeTime != null">uie_active_time,</if>
|
<if test="mark != null">uie_mark,</if>
|
<if test="inviteCodeVip != null">uie_invite_code_vip,</if>
|
</trim>
|
values
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id,jdbcType=BIGINT},</if>
|
<if test="userInfo != null">#{userInfo.id,jdbcType=BIGINT},</if>
|
<if test="userRank != null">#{userRank.id,jdbcType=BIGINT},</if>
|
<if test="rankSource != null">#{rankSource,jdbcType=INTEGER},</if>
|
<if test="rankOrderNum != null">#{rankOrderNum,jdbcType=INTEGER},</if>
|
<if test="rankUpdateTime != null">#{rankUpdateTime,jdbcType=TIMESTAMP},</if>
|
<if test="inviteCode != null">#{inviteCode,jdbcType=VARCHAR},</if>
|
<if test="lotteryNewbies != null">#{lotteryNewbies,jdbcType=INTEGER},</if>
|
<if test="couponNews != null">#{couponNews,jdbcType=INTEGER},</if>
|
<if test="synchNavbar != null">#{synchNavbar,jdbcType=VARCHAR},</if>
|
<if test="firstLoginTime != null">#{firstLoginTime,jdbcType=TIMESTAMP},</if>
|
<if test="sex != null">#{sex,jdbcType=INTEGER},</if>
|
<if test="weiXin != null">#{weiXin,jdbcType=VARCHAR},</if>
|
<if test="erCode != null">#{erCode,jdbcType=VARCHAR},</if>
|
<if test="goldCoin != null">#{goldCoin,jdbcType=INTEGER},</if>
|
<if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
<if test="autoExtract != null">#{autoExtract,jdbcType=BOOLEAN},</if>
|
<if test="closeTimeExtract != null">#{closeTimeExtract,jdbcType=TIMESTAMP},</if>
|
<if test="activeTime != null">#{activeTime,jdbcType=TIMESTAMP},</if>
|
<if test="mark != null">#{mark,jdbcType=VARCHAR},</if>
|
<if test="inviteCodeVip != null">#{inviteCodeVip,jdbcType=VARCHAR}</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">update
|
yeshi_ec_user_info_extra set uie_uid =
|
#{userInfo.id,jdbcType=BIGINT},uie_rank_id =
|
#{userRank.id,jdbcType=BIGINT},uie_rank_source =
|
#{rankSource,jdbcType=INTEGER},uie_rank_order_num =
|
#{rankOrderNum,jdbcType=INTEGER},uie_rank_update_time =
|
#{rankUpdateTime,jdbcType=TIMESTAMP},uie_invite_code =
|
#{inviteCode,jdbcType=VARCHAR},uie_lottery_newbies =
|
#{lotteryNewbies,jdbcType=INTEGER},uie_coupon_news =
|
#{couponNews,jdbcType=INTEGER},uie_synch_navbar =
|
#{synchNavbar,jdbcType=VARCHAR},uie_first_login_time =
|
#{firstLoginTime,jdbcType=TIMESTAMP},uie_sex =
|
#{sex,jdbcType=INTEGER},uie_weixin =
|
#{weiXin,jdbcType=VARCHAR},uie_ercode =
|
#{erCode,jdbcType=VARCHAR},uie_gold_coin =
|
#{goldCoin,jdbcType=INTEGER},uie_create_time =
|
#{createTime,jdbcType=TIMESTAMP},uie_update_time =
|
#{updateTime,jdbcType=TIMESTAMP},uie_auto_extract =
|
#{autoExtract,jdbcType=BOOLEAN},uie_close_time_extract =
|
#{closeTimeExtract,jdbcType=TIMESTAMP},uie_active_time =
|
#{activeTime,jdbcType=TIMESTAMP},uie_mark = #{mark,jdbcType=VARCHAR}
|
,uie_invite_code_vip =#{inviteCodeVip,jdbcType=VARCHAR} where
|
uie_id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">
|
update yeshi_ec_user_info_extra
|
<set>
|
<if test="userInfo != null">uie_uid=#{userInfo.id,jdbcType=BIGINT},</if>
|
<if test="userRank != null">uie_rank_id=#{userRank.id,jdbcType=BIGINT},</if>
|
<if test="rankSource != null">uie_rank_source=#{rankSource,jdbcType=INTEGER},</if>
|
<if test="rankOrderNum != null">uie_rank_order_num=#{rankOrderNum,jdbcType=INTEGER},</if>
|
<if test="rankUpdateTime != null">uie_rank_update_time=#{rankUpdateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="inviteCode != null">uie_invite_code=#{inviteCode,jdbcType=VARCHAR},</if>
|
<if test="lotteryNewbies != null">uie_lottery_newbies=#{lotteryNewbies,jdbcType=INTEGER},
|
</if>
|
<if test="couponNews != null">uie_coupon_news=#{couponNews,jdbcType=INTEGER},</if>
|
<if test="synchNavbar != null">uie_synch_navbar=#{synchNavbar,jdbcType=VARCHAR},</if>
|
<if test="firstLoginTime != null">uie_first_login_time=#{firstLoginTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="sex != null">uie_sex=#{sex,jdbcType=INTEGER},</if>
|
<if test="weiXin != null">uie_weixin=#{weiXin,jdbcType=VARCHAR},</if>
|
<if test="erCode != null">uie_ercode=#{erCode,jdbcType=VARCHAR},</if>
|
<if test="goldCoin != null">uie_gold_coin=#{goldCoin,jdbcType=INTEGER},</if>
|
<if test="createTime != null">uie_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">uie_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
<if test="autoExtract != null">uie_auto_extract=#{autoExtract,jdbcType=BOOLEAN},</if>
|
<if test="closeTimeExtract != null">uie_close_time_extract=#{closeTimeExtract,jdbcType=TIMESTAMP},
|
</if>
|
<if test="activeTime != null">uie_active_time=#{activeTime,jdbcType=TIMESTAMP},</if>
|
<if test="mark != null">uie_mark=#{mark,jdbcType=VARCHAR},</if>
|
<if test="inviteCodeVip !=null">uie_invite_code_vip=#{inviteCodeVip,jdbcType=VARCHAR},
|
</if>
|
</set>
|
where uie_id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateInfoExtraByUid" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">
|
update yeshi_ec_user_info_extra
|
<set>
|
<if test="userRank != null">uie_rank_id=#{userRank.id,jdbcType=BIGINT},</if>
|
<if test="rankSource != null">uie_rank_source=#{rankSource,jdbcType=INTEGER},</if>
|
<if test="rankOrderNum != null">uie_rank_order_num=#{rankOrderNum,jdbcType=INTEGER},</if>
|
<if test="rankUpdateTime != null">uie_rank_update_time=#{rankUpdateTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="inviteCode != null">uie_invite_code=#{inviteCode,jdbcType=VARCHAR},</if>
|
<if test="lotteryNewbies != null">uie_lottery_newbies=#{lotteryNewbies,jdbcType=INTEGER},
|
</if>
|
<if test="couponNews != null">uie_coupon_news=#{couponNews,jdbcType=INTEGER},</if>
|
<if test="synchNavbar != null">uie_synch_navbar=#{synchNavbar,jdbcType=VARCHAR},</if>
|
<if test="firstLoginTime != null">uie_first_login_time=#{firstLoginTime,jdbcType=TIMESTAMP},
|
</if>
|
<if test="sex != null">uie_sex=#{sex,jdbcType=INTEGER},</if>
|
<if test="weiXin != null">uie_weixin=#{weiXin,jdbcType=VARCHAR},</if>
|
<if test="erCode != null">uie_ercode=#{erCode,jdbcType=VARCHAR},</if>
|
<if test="goldCoin != null">uie_gold_coin=#{goldCoin,jdbcType=INTEGER},</if>
|
<if test="createTime != null">uie_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
<if test="updateTime != null">uie_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
<if test="autoExtract != null">uie_auto_extract=#{autoExtract,jdbcType=BOOLEAN},</if>
|
<if test="closeTimeExtract != null">uie_close_time_extract=#{closeTimeExtract,jdbcType=TIMESTAMP},
|
</if>
|
<if test="activeTime != null">uie_active_time=#{activeTime,jdbcType=TIMESTAMP},</if>
|
<if test="mark != null">uie_mark=#{mark,jdbcType=VARCHAR},</if>
|
</set>
|
where uie_uid = #{userInfo.id,jdbcType=BIGINT}
|
</update>
|
<update id="updateGoldCoin">UPDATE yeshi_ec_user_info_extra SET uie_gold_coin =
|
IF(uie_gold_coin IS NULL,#{goldCoin}, uie_gold_coin + #{goldCoin})
|
WHERE uie_id = #{id}
|
</update>
|
|
<update id="addGoldCoinByUid">
|
UPDATE yeshi_ec_user_info_extra SET uie_gold_coin = IF(uie_gold_coin IS NULL,#{goldCoin}, uie_gold_coin + #{goldCoin})
|
WHERE uie_uid = #{uid}
|
</update>
|
|
|
<select id="getInfoExtraByUid" resultMap="BaseResultMap">SELECT * FROM
|
yeshi_ec_user_info_extra WHERE uie_uid = #{uid}
|
</select>
|
<select id="getByUidForUpdate" resultMap="BaseResultMap">SELECT * FROM
|
yeshi_ec_user_info_extra WHERE uie_uid = #{uid} FOR UPDATE
|
</select>
|
<select id="getInfoExtraVOByUid" resultMap="VOResultMap">SELECT
|
u.`id`,u.`nick_name`,u.`portrait`,ue.*,rk.* FROM
|
yeshi_ec_user_info_extra ue LEFT JOIN yeshi_ec_user u ON ue.`uie_uid`
|
= u.`id` LEFT JOIN yeshi_ec_user_rank rk ON rk.`ur_id` =
|
ue.`uie_rank_id` WHERE u.id = #{uid}
|
</select>
|
<select id="countByRankId" parameterType="java.lang.Long"
|
resultType="java.lang.Long">SELECT IFNULL(COUNT(t.`uie_id`),0) FROM
|
`yeshi_ec_user_info_extra` t WHERE t.`uie_rank_id` = #{rankId}
|
</select>
|
<select id="gerUserRank" resultMap="AllResultMap">SELECT * FROM
|
yeshi_ec_user_info_extra ue LEFT JOIN yeshi_ec_user_rank rk ON
|
rk.`ur_id` = ue.`uie_rank_id` WHERE ue.`uie_uid` = #{uid}
|
</select>
|
<update id="updateAutoExtract">UPDATE
|
yeshi_ec_user_info_extra SET uie_auto_extract = 1 WHERE
|
uie_auto_extract = 0 AND DATEDIFF(NOW(),uie_close_time_extract) <![CDATA[>]]>
|
#{days}
|
</update>
|
</mapper>
|