From f53edec193227af90aad11f557723e72b4860400 Mon Sep 17 00:00:00 2001
From: yujian <yujian>
Date: 星期四, 03 一月 2019 18:18:21 +0800
Subject: [PATCH] 冲突处理

---
 fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 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 f408ad4..b15ba1d 100644
--- a/fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
+++ b/fanli/src/main/java/com/yeshi/fanli/mapping/UserInfoMapper.xml
@@ -369,4 +369,51 @@
 	</select>
 	
 	
+	<select id="countLoseUser" resultType="java.lang.Long">
+		SELECT  COUNT(DISTINCT t.`id` ) FROM `yeshi_ec_user` t 
+		LEFT JOIN `yeshi_ec_user_money_detail` d ON d.`umd_uid` = t.`id` 
+		WHERE DATE_SUB(CURDATE(), INTERVAL ${num} DAY) > DATE(FROM_UNIXTIME( t.`last_logintime`/1000)) 
+    	 	  AND DATE_SUB(CURDATE(), INTERVAL ${num} DAY) > DATE(d.`umd_createtime`) 
+	</select>
+	
+	<select id="countHasOrderUser" resultType="java.lang.Long">
+		SELECT COUNT(DISTINCT h.`uid`) FROM yeshi_ec_hongbao h 
+		WHERE h.`type`=1 OR h.`type`=20
+	</select>
+	
+	
+	
+	<select id="countNewUserByDate" resultType="java.util.HashMap">
+		SELECT COUNT(h.`id`) AS total,
+			<if test="type == 1">
+			 	FROM_UNIXTIME(h.`createtime`/1000,'%Y-%m-%d') AS 'createDate'
+			</if>
+			<if test="type == 2">
+			 	FROM_UNIXTIME(h.`createtime`/1000,'%m') AS 'createDate'
+			</if>
+			<if test="type == 3">
+			 	FROM_UNIXTIME(h.`createtime`/1000,'%Y') AS 'createDate'
+			</if>
+		FROM yeshi_ec_user h 
+		WHERE 1=1
+			<if test="startTime != null and startTime != '' ">
+		 	AND FROM_UNIXTIME(h.`createtime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
+			</if>
+			<if test="endTime != null and endTime != '' ">
+			 	AND FROM_UNIXTIME(h.`createtime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]> '${endTime}'
+			</if>
+			<if test="years != null and years != '' ">
+			 	AND FROM_UNIXTIME(h.`createtime`/1000,'%Y') = '${years}'
+			</if>
+		<if test="type == 1">
+			GROUP BY FROM_UNIXTIME(h.`createtime`/1000,'%Y-%m-%d') 
+		</if>
+		<if test="type == 2">
+		 	GROUP BY FROM_UNIXTIME(h.`createtime`/1000,'%Y-%m') 
+		</if>
+		<if test="type == 3">
+		 	GROUP BY FROM_UNIXTIME(h.`createtime`/1000,'%Y') 
+		</if>		
+		ORDER BY h.`createtime`
+	</select>
 </mapper>

--
Gitblit v1.8.0