From 47f157086a556d96e7bcfc9adfe17ecf7c154dfe Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 08 六月 2020 17:27:14 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div

---
 fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml |  117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 115 insertions(+), 2 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 2973bb1..f73948a 100644
--- a/fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
+++ b/fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
@@ -77,10 +77,12 @@
 		<result column="alipayAccountInvalid" property="alipayAccountInvalid"
 			jdbcType="VARCHAR" />
 
+		<result column="tuls_level" property="userLevel" jdbcType="VARCHAR" />
 		<result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" />
 		<result column="uie_mark" property="mark" jdbcType="VARCHAR" />
-		<result column="userLevel" property="userLevel" jdbcType="VARCHAR" />
-		<result column="inviteCode" property="inviteCode" jdbcType="VARCHAR" />
+		<result column="uie_invite_code" property="inviteCode" jdbcType="VARCHAR" />
+		<result column="uie_invite_code_vip" property="inviteCodeVip" jdbcType="VARCHAR" />
+		<result column="uie_weixin" property="wxId" jdbcType="VARCHAR" />
 	</resultMap>
 
 	<resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
@@ -300,6 +302,117 @@
 		call procedure_connect_user(#{mainUid},#{lessUid})
 	</select>
 
+
+	<select id="queryInfo" resultMap="BaseResultMapVO">
+	SELECT * FROM yeshi_ec_user u
+	LEFT JOIN yeshi_ec_user_info_extra ext ON u.`id` = ext.uie_uid
+	LEFT JOIN yeshi_ec_user_rank rak ON rak.ur_id = ext.uie_rank_id
+	<if test="keyType == 4">
+		LEFT JOIN yeshi_ec_binding_account b ON u.`id` = b.`uid`
+	</if>
+	WHERE 1=1
+		<if test="userState != null">
+			AND u.`state` = #{userState}
+		</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')
+		</if>
+		<if test="endTime != null and endTime !=''">
+			AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[<=]]>
+			DATE_FORMAT(#{endTime},'%Y%m%d')
+		</if>
+		<if test="userRank != null">
+			AND rak.ur_name = #{userRank}
+		</if>
+		<if test = "level != null and level != ''">
+			AND lc.tuls_level = #{level}
+		</if>
+		<if test="activeCode == 0">
+			AND (ext.`uie_invite_code` is null OR ext.`uie_invite_code`='')
+		</if>
+		<if test="activeCode == 1">
+			AND (ext.`uie_invite_code` is not null OR ext.`uie_invite_code`<![CDATA[<>]]>'')
+		</if>
+		<if test="key != null and key !='' ">
+			<if test="keyType == 1">
+				AND u.id = #{key}
+			</if>
+			<if test="keyType == 2">
+				AND u.`nick_name` LIKE '%${key}%'
+			</if>
+			<if test="keyType == 3">
+				AND u.`phone` = #{key}
+			</if>
+			<if test="keyType == 4">
+				AND b.`account` = #{key}
+			</if>
+			<if test="keyType == 5">
+				AND (ext.`uie_invite_code` =  #{key} OR ext.`uie_invite_code_vip`= #{key})
+			</if>
+		</if>
+		ORDER BY u.id DESC
+		LIMIT ${start},${count}
+	</select>
+
+	<select id="countInfo" resultType="java.lang.Long">
+		SELECT IFNULL(count(u.id),0) FROM yeshi_ec_user u
+		LEFT JOIN yeshi_ec_user_info_extra ext ON u.`id` = ext.uie_uid
+		LEFT JOIN yeshi_ec_user_rank rak ON rak.ur_id = ext.uie_rank_id
+		LEFT JOIN yeshi_ec_team_user_level_statistic lc ON lc.`tuls_uid` = u.id
+		<if test="keyType == 4">
+			LEFT JOIN yeshi_ec_binding_account b ON u.`id` = b.`uid`
+		</if>
+		where 1=1
+		<if test="userState != null">
+			AND u.`state` = #{userState}
+		</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')
+		</if>
+		<if test="endTime != null and endTime !=''">
+			AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[<=]]>
+			DATE_FORMAT(#{endTime},'%Y%m%d')
+		</if>
+		<if test="userRank != null">
+			AND rak.ur_name = #{userRank}
+		</if>
+		<if test = "level != null and level != ''">
+			AND lc.tuls_level = #{level}
+		</if>
+		<if test="activeCode == 0">
+			AND (ext.`uie_invite_code` is null OR ext.`uie_invite_code`='')
+		</if>
+		<if test="activeCode == 1">
+			AND (ext.`uie_invite_code` is not null OR ext.`uie_invite_code`<![CDATA[<>]]>'')
+		</if>
+		<if test="key != null and key !='' ">
+			<if test="keyType == 1">
+				AND u.id = #{key}
+			</if>
+			<if test="keyType == 2">
+				AND u.`nick_name` LIKE '%${key}%'
+			</if>
+			<if test="keyType == 3">
+				AND u.`phone` = #{key}
+			</if>
+			<if test="keyType == 4">
+				AND b.`account` = #{key}
+			</if>
+			<if test="keyType == 5">
+				AND (ext.`uie_invite_code` =  #{key} OR ext.`uie_invite_code_vip`= #{key})
+			</if>
+		</if>
+	</select>
+
+
 	<select id="query" resultMap="BaseResultMapVO">
 		SELECT *
 		,(SELECT COUNT(hb.hb_id) FROM `yeshi_ec_hongbao_v2` hb

--
Gitblit v1.8.0