From dd5b15229cb15459fa7c31ccea77dac28cbfafbd Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 13 四月 2020 10:04:20 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div

---
 fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml |   99 ++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 81 insertions(+), 18 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
index 2c67d24..7def428 100644
--- a/fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
+++ b/fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
@@ -18,8 +18,7 @@
 		<result column="last_logintime" property="lastLoginTime"
 			jdbcType="BIGINT" />
 		<result column="loginip" property="lastLoginIp" jdbcType="VARCHAR" />
-		<result column="tuiguang_code" property="tuiGuangCode"
-			jdbcType="VARCHAR" />
+		<result column="type" property="type" jdbcType="INTEGER" />
 		<result column="appid" property="appId" jdbcType="VARCHAR" />
 		<result column="my_hongBao" property="myHongBao" jdbcType="DECIMAL" />
 		<result column="pay_password" property="payPassword" jdbcType="VARCHAR" />
@@ -48,8 +47,7 @@
 		<result column="last_logintime" property="lastLoginTime"
 			jdbcType="BIGINT" />
 		<result column="loginip" property="lastLoginIp" jdbcType="VARCHAR" />
-		<result column="tuiguang_code" property="tuiGuangCode"
-			jdbcType="VARCHAR" />
+		<result column="type" property="type" jdbcType="INTEGER" />
 		<result column="appid" property="appId" jdbcType="VARCHAR" />
 		<result column="my_hongBao" property="myHongBao" jdbcType="DECIMAL" />
 		<result column="pay_password" property="payPassword" jdbcType="VARCHAR" />
@@ -80,14 +78,15 @@
 			jdbcType="VARCHAR" />
 
 		<result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" />
+		<result column="uie_mark" property="mark" jdbcType="VARCHAR" />
 	</resultMap>
 
 	<resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
 		<result column="showDate" property="showDate" jdbcType="VARCHAR" />
 		<result column="showValue" property="showValue" jdbcType="VARCHAR" />
 	</resultMap>
-	
-	<sql id="Base_Column_List">id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,tuiguang_code,appid,my_hongBao,pay_password,sid,rank,phone,state,state_desc
+
+	<sql id="Base_Column_List">id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,type,appid,my_hongBao,pay_password,sid,rank,phone,state,state_desc
 	</sql>
 	<!-- 涓嶈兘鏌ヨ缂撳瓨 -->
 	<select id="selectByPrimaryKey" resultMap="BaseResultMap"
@@ -116,9 +115,9 @@
 	</delete>
 	<insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserInfo"
 		useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user
-		(id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,tuiguang_code,appid,my_hongBao,pay_password,sid,rank,phone,state,state_desc)
+		(id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,type,appid,my_hongBao,pay_password,sid,rank,phone,state,state_desc,platform)
 		values
-		(#{id,jdbcType=BIGINT},#{openid,jdbcType=VARCHAR},#{loginType,jdbcType=INTEGER},#{wxOpenId,jdbcType=VARCHAR},#{wxUnionId,jdbcType=VARCHAR},#{nickName,jdbcType=VARCHAR},#{tbName,jdbcType=VARCHAR},#{tbPic,jdbcType=VARCHAR},#{wxName,jdbcType=VARCHAR},#{wxPic,jdbcType=VARCHAR},#{portrait,jdbcType=VARCHAR},#{createtime,jdbcType=BIGINT},#{lastLoginTime,jdbcType=BIGINT},#{lastLoginIp,jdbcType=VARCHAR},#{tuiGuangCode,jdbcType=VARCHAR},#{appId,jdbcType=VARCHAR},#{myHongBao,jdbcType=DECIMAL},#{payPassword,jdbcType=VARCHAR},#{system.id,jdbcType=BIGINT},#{rank,jdbcType=INTEGER},#{phone,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{stateDesc,jdbcType=VARCHAR})
+		(#{id,jdbcType=BIGINT},#{openid,jdbcType=VARCHAR},#{loginType,jdbcType=INTEGER},#{wxOpenId,jdbcType=VARCHAR},#{wxUnionId,jdbcType=VARCHAR},#{nickName,jdbcType=VARCHAR},#{tbName,jdbcType=VARCHAR},#{tbPic,jdbcType=VARCHAR},#{wxName,jdbcType=VARCHAR},#{wxPic,jdbcType=VARCHAR},#{portrait,jdbcType=VARCHAR},#{createtime,jdbcType=BIGINT},#{lastLoginTime,jdbcType=BIGINT},#{lastLoginIp,jdbcType=VARCHAR},#{type,jdbcType=INTEGER},#{appId,jdbcType=VARCHAR},#{myHongBao,jdbcType=DECIMAL},#{payPassword,jdbcType=VARCHAR},#{system.id,jdbcType=BIGINT},#{rank,jdbcType=INTEGER},#{phone,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{stateDesc,jdbcType=VARCHAR},#{platform,jdbcType=VARCHAR})
 	</insert>
 	<insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfo"
 		useGeneratedKeys="true" keyProperty="id">
@@ -138,7 +137,7 @@
 			<if test="createtime != null">createtime,</if>
 			<if test="lastLoginTime != null">last_logintime,</if>
 			<if test="lastLoginIp != null">loginip,</if>
-			<if test="tuiGuangCode != null">tuiguang_code,</if>
+			<if test="type != null">type,</if>
 			<if test="appId != null">appid,</if>
 			<if test="myHongBao != null">my_hongBao,</if>
 			<if test="payPassword != null">pay_password,</if>
@@ -147,6 +146,7 @@
 			<if test="phone != null">phone,</if>
 			<if test="state != null">state,</if>
 			<if test="stateDesc != null">state_desc,</if>
+			<if test="platform != null">platform,</if>
 		</trim>
 		values
 		<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -164,7 +164,7 @@
 			<if test="createtime != null">#{createtime,jdbcType=BIGINT},</if>
 			<if test="lastLoginTime != null">#{lastLoginTime,jdbcType=BIGINT},</if>
 			<if test="lastLoginIp != null">#{lastLoginIp,jdbcType=VARCHAR},</if>
-			<if test="tuiGuangCode != null">#{tuiGuangCode,jdbcType=VARCHAR},</if>
+			<if test="type != null">#{type,jdbcType=INTEGER},</if>
 			<if test="appId != null">#{appId,jdbcType=VARCHAR},</if>
 			<if test="myHongBao != null">#{myHongBao,jdbcType=DECIMAL},</if>
 			<if test="payPassword != null">#{payPassword,jdbcType=VARCHAR},</if>
@@ -173,6 +173,7 @@
 			<if test="phone != null">#{phone,jdbcType=VARCHAR},</if>
 			<if test="state != null">#{state,jdbcType=INTEGER},</if>
 			<if test="stateDesc != null">#{stateDesc,jdbcType=VARCHAR}</if>
+			<if test="platform != null">#{platform,jdbcType=VARCHAR}</if>
 		</trim>
 	</insert>
 	<update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserInfo">update
@@ -186,8 +187,8 @@
 		#{portrait,jdbcType=VARCHAR},createtime =
 		#{createtime,jdbcType=BIGINT},last_logintime =
 		#{lastLoginTime,jdbcType=BIGINT},loginip =
-		#{lastLoginIp,jdbcType=VARCHAR},tuiguang_code =
-		#{tuiGuangCode,jdbcType=VARCHAR},appid =
+		#{lastLoginIp,jdbcType=VARCHAR},type =
+		#{type,jdbcType=INTEGER},appid =
 		#{appId,jdbcType=VARCHAR},my_hongBao =
 		#{myHongBao,jdbcType=DECIMAL},pay_password =
 		#{payPassword,jdbcType=VARCHAR},sid =
@@ -212,7 +213,7 @@
 			<if test="createtime != null">createtime=#{createtime,jdbcType=BIGINT},</if>
 			<if test="lastLoginTime != null">last_logintime=#{lastLoginTime,jdbcType=BIGINT},</if>
 			<if test="lastLoginIp != null">loginip=#{lastLoginIp,jdbcType=VARCHAR},</if>
-			<if test="tuiGuangCode != null">tuiguang_code=#{tuiGuangCode,jdbcType=VARCHAR},</if>
+			<if test="type != null">type=#{type,jdbcType=INTEGER},</if>
 			<if test="appId != null">appid=#{appId,jdbcType=VARCHAR},</if>
 			<if test="myHongBao != null">my_hongBao=#{myHongBao,jdbcType=DECIMAL},</if>
 			<if test="payPassword != null">pay_password=#{payPassword,jdbcType=VARCHAR},</if>
@@ -277,6 +278,15 @@
 		<include refid="Base_Column_List" />
 		from yeshi_ec_user
 		where wx_union_id=#{unionId} AND state = 0
+		LIMIT 1
+	</select>
+
+
+	<select id="getEffectiveUserInfoByWXOpenId" resultMap="BaseResultMap">
+		select
+		<include refid="Base_Column_List" />
+		from yeshi_ec_user
+		where wx_open_id=#{wxOpenId} AND state = 0
 		LIMIT 1
 	</select>
 
@@ -349,6 +359,11 @@
 		<if test="userState == 2">
 			AND u.`state` =2   <!-- 灏佺鐢ㄦ埛 -->
 		</if>
+
+		<if test="userType!=null">
+			AND u.type=#{userType}
+		</if>
+
 		<if test="startTime != null and startTime !='' ">
 			AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[>=]]>
 			DATE_FORMAT(#{startTime},'%Y%m%d')
@@ -419,6 +434,9 @@
 		</if>
 		<if test="userState == 2">
 			AND u.`state` =2   <!-- 灏佺鐢ㄦ埛 -->
+		</if>
+		<if test="userType!=null">
+			AND u.type=#{userType}
 		</if>
 		<if test="startTime != null and startTime !='' ">
 			AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[>=]]>
@@ -681,15 +699,13 @@
 		u.`createtime`
 	</select>
 
-	<select id="getInfoByPhoneOrInviteCode" resultMap="BaseResultMap">
+	<select id="getUserInfoByInviteCode" resultMap="BaseResultMap">
 		SELECT * FROM
 		yeshi_ec_user u
 		LEFT JOIN yeshi_ec_user_info_extra uf ON uf.`uie_uid` =
 		u.`id`
-		WHERE
-		uf.`uie_invite_code` IS NOT NULL
-		AND (u.`phone` =#{phone} OR
-		uf.`uie_invite_code` = #{inviteCode})
+		WHERE uf.`uie_invite_code_vip` = #{inviteCode} OR
+		uf.`uie_invite_code` = #{inviteCode}
 		LIMIT 1
 	</select>
 
@@ -700,4 +716,51 @@
 		where u.state=0
 	</select>
 
+	<select id="getAutoExtractUser" resultMap="BaseResultMap">
+		SELECT u.* FROM `yeshi_ec_user_info_extra` t
+		LEFT JOIN `yeshi_ec_user`
+		u ON u.`id` = t.`uie_uid`
+		WHERE t.`uie_auto_extract` = 1 AND
+		t.uie_active_time <![CDATA[>=]]>
+		#{beganDate} AND t.uie_active_time <![CDATA[<]]>
+		#{endDate}
+		AND (t.`uie_mark` IS NULL OR t.`uie_mark` = '')
+		AND u.`state`
+		= 0 AND u.`my_hongBao` <![CDATA[>=]]>
+		#{money}
+		AND u.`wx_open_id` IS NOT NULL AND
+		LENGTH(TRIM(u.`wx_open_id`)) <![CDATA[>]]>
+		0
+		AND u.`wx_open_id` NOT LIKE 'o_b9%'
+		LIMIT #{start},#{count}
+	</select>
+
+	<select id="getAutoExtractUserTo1212" resultMap="BaseResultMap">
+		SELECT u.* FROM (SELECT v2.`hb_uid` FROM `yeshi_ec_hongbao_v2` v2
+		WHERE <![CDATA[v2.`hb_create_time` > '2019-01-01' AND v2.`hb_create_time` < '2019-06-18']]>
+		GROUP BY hb_uid)h
+		LEFT JOIN `yeshi_ec_user_info_extra` t ON t.`uie_uid`
+		= h.hb_uid
+		LEFT JOIN `yeshi_ec_user` u ON u.`id` = t.`uie_uid`
+		WHERE <![CDATA[ t.uie_active_time < '2019-06-19']]>
+		AND (t.`uie_mark` IS NULL OR t.`uie_mark` = '')
+		AND u.`state` = 0 AND
+		u.`my_hongBao`<![CDATA[> 1]]>
+		AND u.`wx_open_id` IS NOT NULL AND <![CDATA[LENGTH(TRIM(u.`wx_open_id`)) > 0]]>
+		AND u.`wx_open_id` NOT LIKE 'o_b9%'
+		LIMIT #{start},#{count}
+	</select>
+
+
+	<select id="listByType" resultMap="BaseResultMap">
+		select * from yeshi_ec_user u
+		where u.type=#{type} limit #{start},#{count}
+	</select>
+
+	<select id="countByType" resultType="java.lang.Long"
+		parameterType="java.lang.Integer">
+		select count(*) from
+		yeshi_ec_user u where u.type=#{0}
+	</select>
+
 </mapper>

--
Gitblit v1.8.0