|
@@ -1,7 +1,7 @@
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="cn.com.ctop.kuaishou.modules.report.mapper.NewMonitorMapper">
|
|
|
- <resultMap id="BaseResultMap" type="cn.com.ctop.kuaishou.modules.report.mapper.NewMonitorMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="cn.com.ctop.kuaishou.modules.report.entity.NewMonitorInfo">
|
|
|
<id column="id" property="user_id" />
|
|
|
<result column="realname" property="user_name"/>
|
|
|
<result column="leader_id" property="parent_id"/>
|
|
@@ -9,7 +9,6 @@
|
|
|
select="cn.com.ctop.kuaishou.modules.report.mapper.NewMonitorMapper.getOperator" column="id">
|
|
|
</collection>
|
|
|
</resultMap>
|
|
|
-
|
|
|
<select id="getOperator" resultMap="BaseResultMap" parameterType="String">
|
|
|
SELECT id,realname,leader_id
|
|
|
FROM sys_user
|
|
@@ -17,21 +16,21 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getAllAccountId" resultType="Long">
|
|
|
- SELECT DISTINCT t.account_id as 'accountId' from ctop_user_allocation t
|
|
|
+ SELECT DISTINCT t.account_id as 'accountId' from ctop_user_allocation t where account_status=0
|
|
|
</select>
|
|
|
<select id="getKuaiShouGroup" resultType="Map">
|
|
|
- SELECT t1.account_id as 'accountId',t1.auth_name as 'accountName',t1.user_name as 'userName',t.unit_id as 'unitId',t.group_create_time as 'groupCreatTime',DATE_FORMAT(DATE_ADD(t.group_create_time,INTERVAL 7 DAY),'%Y-%m-%d') as 'afterTime'
|
|
|
- from ctop_user_allocation t1 LEFT JOIN ctop_kuaishou_group t on t1.account_id=t.account_id and t.account_id=#{accountId}
|
|
|
- <where>
|
|
|
- <choose>
|
|
|
- <when test="date!= null and date!=''">
|
|
|
- and t.group_create_time >= DATE_SUB(#{date},INTERVAL 7 DAY)
|
|
|
- </when>
|
|
|
- <otherwise>
|
|
|
- t.group_create_time >= DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 YEAR),'%Y-%m-%d')
|
|
|
- </otherwise>
|
|
|
- </choose>
|
|
|
- </where>
|
|
|
+ SELECT t1.account_id as 'accountId',t1.auth_name as 'accountName',t1.user_name as 'userName',t.unit_id as 'unitId',t.group_create_time as 'groupCreatTime',DATE_FORMAT(DATE_ADD(t.group_create_time,INTERVAL 7 DAY),'%Y-%m-%d') as 'afterTime'
|
|
|
+ from ctop_user_allocation t1 LEFT JOIN ctop_kuaishou_group t on t1.account_id=t.account_id and t.account_id=#{accountId}
|
|
|
+ <where>
|
|
|
+ <choose>
|
|
|
+ <when test="date!= null and date!=''">
|
|
|
+ and t.group_create_time >= DATE_SUB(#{date},INTERVAL 7 DAY)
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ t.group_create_time >= DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 YEAR),'%Y-%m-%d')
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
|
|
|
<select id="getKuaiShouCampaign" resultType="Map">
|
|
@@ -107,13 +106,13 @@
|
|
|
|
|
|
<select id="getKuaiShouGroupMessage" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
select account_id as 'accountId',account_name as 'authName',MAX(create_time) as 'maxCreateTime',COUNT(IF(effective ='1', TRUE, NULL)) as 'valid',count(effective) as 'new',operating_name as 'userName','' as 'projectName'
|
|
|
- from ctop_new_monitor_group where ( create_time between #{startDate} and #{endDate})
|
|
|
+ from ctop_new_monitor_group where ( create_time between #{startDate} and #{endDate})
|
|
|
and account_id in
|
|
|
<foreach item="item" collection="array" separator="," open="(" close=")" index="">
|
|
|
- #{item}
|
|
|
+ #{item}
|
|
|
</foreach>
|
|
|
GROUP BY account_id
|
|
|
-
|
|
|
+ order by account_id desc
|
|
|
</select>
|
|
|
|
|
|
|
|
@@ -125,7 +124,7 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
GROUP BY account_id
|
|
|
-
|
|
|
+ order by account_id desc
|
|
|
</select>
|
|
|
|
|
|
<select id="getKuaiShouGroupSum" resultType="com.alibaba.fastjson.JSONObject">
|
|
@@ -147,8 +146,8 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getKuaiShouGroupMessageGroup" resultType="com.alibaba.fastjson.JSONObject" >
|
|
|
- SELECT DATE_FORMAT(t.create_time,'%Y-%m-%d') as 'statDate',COUNT(t.effective) as 'new',COUNT(IF(t.effective ='1', TRUE, NULL)) as 'valid' from ctop_new_monitor_group t
|
|
|
- where (create_time between #{startDate} and #{endDate}) and t.account_id in
|
|
|
+ SELECT DATE_FORMAT(t.create_time,'%Y-%m-%d') as 'statDate',COUNT(t.effective) as 'new',COUNT(IF(t.effective ='1', TRUE, NULL)) as 'valid' from ctop_new_monitor_group t
|
|
|
+ where (create_time between #{startDate} and #{endDate}) and t.account_id in
|
|
|
<foreach item="item" collection="array" separator="," open="(" close=")" index="">
|
|
|
#{item}
|
|
|
</foreach>
|
|
@@ -179,5 +178,4 @@
|
|
|
</select>
|
|
|
|
|
|
|
|
|
-
|
|
|
</mapper>
|