|
@@ -245,13 +245,14 @@
|
|
|
t2.operator_id AS 'userId',
|
|
|
t2.operator_name AS 'userName',
|
|
|
SUM(cost_total) AS 'costTotal',
|
|
|
- count( DISTINCT CASE WHEN t1.cost_total > 0 THEN t1.account_id ELSE 0 END ) AS 'accountNum',
|
|
|
- count( DISTINCT CASE WHEN t1.cost_total > 0 THEN t1.project_id ELSE 0 END ) AS 'projectNum'
|
|
|
+ count( DISTINCT t1.account_id ) AS 'accountNum',
|
|
|
+ count( DISTINCT t1.project_id) AS 'projectNum'
|
|
|
FROM
|
|
|
kuaishou_live_account_report_hourly_dw t1
|
|
|
LEFT JOIN kuaishou_account t2 ON t1.account_id = t2.account_id
|
|
|
WHERE report_date = #{today}
|
|
|
AND hour <= #{hour}
|
|
|
+ AND t1.cost_total >0
|
|
|
AND t2.account_type = 1
|
|
|
<if test="userList != null and userList.size() > 0 ">
|
|
|
AND t1.user_id IN
|
|
@@ -293,13 +294,14 @@
|
|
|
t2.operator_id AS 'userId',
|
|
|
t2.operator_name AS 'userName',
|
|
|
SUM(cost_total) AS 'costTotal',
|
|
|
- count( DISTINCT CASE WHEN t1.cost_total > 0 THEN t1.account_id ELSE 0 END ) AS 'accountNum',
|
|
|
- count( DISTINCT CASE WHEN t1.cost_total > 0 THEN t1.project_id ELSE 0 END ) AS 'projectNum'
|
|
|
+ count( DISTINCT t1.account_id ) AS 'accountNum',
|
|
|
+ count( DISTINCT t1.project_id) AS 'projectNum'
|
|
|
FROM
|
|
|
kuaishou_live_account_report_daily_dw t1
|
|
|
LEFT JOIN kuaishou_account t2 ON t1.account_id = t2.account_id
|
|
|
WHERE report_date >= #{startDate}
|
|
|
AND report_date <= #{endDate}
|
|
|
+ AND t1.cost_total >0
|
|
|
AND t2.account_type = 1
|
|
|
<if test="userList != null and userList.size() > 0 ">
|
|
|
AND user_id IN
|
|
@@ -341,14 +343,15 @@
|
|
|
SELECT
|
|
|
'汇总' AS 'userName',
|
|
|
SUM(cost_total) AS 'costTotal',
|
|
|
- count( DISTINCT CASE WHEN t1.cost_total > 0 THEN t1.account_id ELSE 0 END ) AS 'accountNum',
|
|
|
- count( DISTINCT CASE WHEN t1.cost_total > 0 THEN t1.project_id ELSE 0 END ) AS 'projectNum'
|
|
|
+ count( DISTINCT t1.account_id ) AS 'accountNum',
|
|
|
+ count( DISTINCT t1.project_id) AS 'projectNum'
|
|
|
FROM
|
|
|
kuaishou_live_account_report_hourly_dw t1
|
|
|
LEFT JOIN kuaishou_account t2 ON t1.account_id = t2.account_id
|
|
|
WHERE report_date = #{today}
|
|
|
AND hour <= #{hour}
|
|
|
AND t2.account_type = 1
|
|
|
+ AND t1.cost_total >0
|
|
|
<if test="userList != null and userList.size() > 0 ">
|
|
|
AND t1.user_id IN
|
|
|
<foreach collection="userList" item="userId" open="(" separator="," close=")">
|
|
@@ -382,14 +385,15 @@
|
|
|
SELECT
|
|
|
'汇总' AS 'userName',
|
|
|
SUM(cost_total) AS 'costTotal',
|
|
|
- count( DISTINCT CASE WHEN t1.cost_total > 0 THEN t1.account_id ELSE 0 END ) AS 'accountNum',
|
|
|
- count( DISTINCT CASE WHEN t1.cost_total > 0 THEN t1.project_id ELSE 0 END ) AS 'projectNum'
|
|
|
+ count( DISTINCT t1.account_id ) AS 'accountNum',
|
|
|
+ count( DISTINCT t1.project_id) AS 'projectNum'
|
|
|
FROM
|
|
|
kuaishou_live_account_report_daily_dw t1
|
|
|
LEFT JOIN kuaishou_account t2 ON t1.account_id = t2.account_id
|
|
|
WHERE report_date >= #{startDate}
|
|
|
AND report_date <= #{endDate}
|
|
|
AND t2.account_type = 1
|
|
|
+ AND t1.cost_total >0
|
|
|
<if test="userList != null and userList.size() > 0 ">
|
|
|
AND user_id IN
|
|
|
<foreach collection="userList" item="userId" open="(" separator="," close=")">
|