From 723f7f30bd818548cb3dc2a75d11e9666cca4f8a Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 03 一月 2019 15:05:11 +0800
Subject: [PATCH] 冲突解决

---
 fanli/src/main/java/com/yeshi/fanli/mapping/user/UserActiveLogMapper.xml |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/user/UserActiveLogMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/user/UserActiveLogMapper.xml
index efa7524..caa574f 100644
--- a/fanli/src/main/java/com/yeshi/fanli/mapping/user/UserActiveLogMapper.xml
+++ b/fanli/src/main/java/com/yeshi/fanli/mapping/user/UserActiveLogMapper.xml
@@ -93,4 +93,41 @@
 		</set>
 		where lua_id = #{id,jdbcType=BIGINT}
 	</update>
+	
+	<select id="countSameDayByChannel" resultType="java.util.HashMap">
+		SELECT COALESCE(COUNT(*),0) AS 'sameDayNum', 
+			<if test="type == 1">
+			 	FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') AS 'createDate'
+			</if>
+			<if test="type == 2">
+			 	FROM_UNIXTIME(u.`createtime`/1000,'%m') AS 'createDate'
+			</if>
+			<if test="type == 3">
+			 	FROM_UNIXTIME(u.`createtime`/1000,'%Y') AS 'createDate'
+			</if>
+		FROM  (SELECT a.`lua_uid` AS uid FROM `yeshi_ec_log_user_active`  a 
+			    WHERE a.`lua_channel`='${channel}' GROUP BY a.`lua_uid`) a 
+		LEFT JOIN yeshi_ec_user u ON u.`id`=a.uid   
+		WHERE 1=1 
+			<if test="startTime != null and startTime != '' ">
+		 	AND FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
+			</if>
+			<if test="endTime != null and endTime != '' ">
+			 	AND FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]> '${endTime}'
+			</if>
+			<if test="years != null and years != '' ">
+			 	AND FROM_UNIXTIME(u.`createtime`/1000,'%Y') = '${years}'
+			</if>
+		<if test="type == 1">
+			GROUP BY FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') 
+		</if>
+		<if test="type == 2">
+		 	GROUP BY FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m') 
+		</if>
+		<if test="type == 3">
+		 	GROUP BY FROM_UNIXTIME(u.`createtime`/1000,'%Y') 
+		</if>		
+		
+		ORDER BY u.`createtime`
+	</select>
 </mapper>

--
Gitblit v1.8.0