From 5af10f175689549ca44b74e9fc1c7ee0ec92c2d7 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期二, 21 四月 2020 14:26:38 +0800
Subject: [PATCH] 后台改造

---
 fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml |   37 ++++++++++++++++++++++++++++++++-----
 1 files changed, 32 insertions(+), 5 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 7def428..2973bb1 100644
--- a/fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
+++ b/fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
@@ -79,6 +79,8 @@
 
 		<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" />
 	</resultMap>
 
 	<resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
@@ -309,7 +311,8 @@
 		AND DATE_FORMAT(hb.`hb_create_time`,'%Y%m') =
 		DATE_FORMAT(CURDATE(),'%Y%m'))AS monthOrder <!-- 绱鏈湀璁㈠崟 -->
 		,(SELECT COUNT(tr.`id`) FROM `yeshi_ec_threesale` tr  <!-- 闃熷憳 -->
-		WHERE tr.`boss_id`=u.id AND tr.state = 1) AS totalPlayers
+		WHERE tr.`boss_id`=u.id AND tr.state = 1) AS totalPlayers,
+		tuls_level As userLevel, ext.uie_invite_code AS inviteCode
 		FROM
 		yeshi_ec_user u
 		LEFT JOIN yeshi_ec_binding_account b ON u.`id` =
@@ -318,7 +321,7 @@
 		LEFT JOIN yeshi_ec_user_rank rak ON rak.ur_id = ext.uie_rank_id
 		LEFT
 		JOIN yeshi_ec_user_info_extra_taobao tb ON tb.`uiet_uid` = u.id
-
+		LEFT JOIN  yeshi_ec_team_user_level_statistic lc ON lc.`tuls_uid` = u.id
 		<if test="userState == 2">
 			LEFT JOIN
 			(SELECT A.uid AS buid,MAX(A.f_wxUnionId) AS
@@ -350,11 +353,11 @@
 			WHERE u.`state` =2
 			)A GROUP BY A.uid) B ON u.id= B.buid
 		</if>
+		
 
 		where 1=1
 		<if test="userState == 1">
-			AND u.`state` <![CDATA[<>]]>
-			2 <!-- 姝e父鐢ㄦ埛 -->
+			AND u.`state` <![CDATA[<>]]>2 <!-- 鏈灏佺鐢ㄦ埛 -->
 		</if>
 		<if test="userState == 2">
 			AND u.`state` =2   <!-- 灏佺鐢ㄦ埛 -->
@@ -363,7 +366,6 @@
 		<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')
@@ -375,6 +377,18 @@
 		<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="days != null">
 			<!-- 娉ㄥ唽鏃堕棿 -->
 			AND <![CDATA[DATE_SUB(CURDATE(), INTERVAL ${days} DAY) <= FROM_UNIXTIME(u.createtime/1000)]]>
@@ -426,6 +440,8 @@
 		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
+		
 		where 1=1
 
 		<if test="userState == 1">
@@ -449,6 +465,17 @@
 		<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="days != null">  <!-- 娉ㄥ唽鏃堕棿 -->
 			AND <![CDATA[DATE_SUB(CURDATE(), INTERVAL ${days} DAY) <= FROM_UNIXTIME(u.createtime/1000)]]>
 		</if>

--
Gitblit v1.8.0