|
@@ -285,13 +285,13 @@
|
|
|
AND media_id =2
|
|
|
GROUP BY user_id) t) as 'totle'
|
|
|
FROM (
|
|
|
- SELECT sum(charge) as 'charge', t2.user_id 'userId' FROM ctop_etl_kuaishou_report_account_daily t1
|
|
|
+ SELECT sum (charge) as 'charge', t2.user_id 'userId' FROM ctop_etl_kuaishou_report_account_daily t1
|
|
|
LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
|
|
|
WHERE t1.stat_date >= #{mStartDate}
|
|
|
AND t1.stat_date <= #{today}
|
|
|
AND media_id =2
|
|
|
GROUP BY user_id
|
|
|
- ORDER BY SUM(charge) DESC
|
|
|
+ ORDER BY SUM (charge) DESC
|
|
|
) t, (select @rownum := 0) a
|
|
|
) tt
|
|
|
WHERE tt.userId = #{userId}
|
|
@@ -520,22 +520,22 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="projectPageListTotal" resultType="java.lang.Integer">
|
|
|
- SELECT IFNULL(SUM(1),0) from
|
|
|
- (
|
|
|
- SELECT
|
|
|
- t3.id
|
|
|
- FROM ctop_etl_kuaishou_report_account_daily t1
|
|
|
- LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
|
|
|
- INNER JOIN ctop_project t3 ON t2.project_id = t3.id
|
|
|
- where t1.stat_date >= #{startTime}
|
|
|
- AND t1.stat_date <= #{endTime}
|
|
|
- GROUP BY t3.id
|
|
|
- HAVING SUM(charge)>0
|
|
|
- ) t
|
|
|
+ SELECT IFNULL(SUM(1), 0)
|
|
|
+ from (
|
|
|
+ SELECT t3.id
|
|
|
+ FROM ctop_etl_kuaishou_report_account_daily t1
|
|
|
+ LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
|
|
|
+ INNER JOIN ctop_project t3 ON t2.project_id = t3.id
|
|
|
+ where t1.stat_date >= #{startTime}
|
|
|
+ AND t1.stat_date <= #{endTime}
|
|
|
+ GROUP BY t3.id
|
|
|
+ HAVING SUM(charge) > 0
|
|
|
+ ) t
|
|
|
</select>
|
|
|
|
|
|
<select id="selectList" resultType="cn.com.ctop.kuaishou.modules.report.entity.EtlKuaishouReportAccountHourly">
|
|
|
- SELECT * from ctop_etl_kuaishou_report_account_daily
|
|
|
+ SELECT *
|
|
|
+ from ctop_etl_kuaishou_report_account_daily
|
|
|
WHERE stat_date >= #{startDate}
|
|
|
and stat_date <= #{endDate}
|
|
|
</select>
|
|
@@ -572,8 +572,9 @@
|
|
|
ctop_etl_kuaishou_report_account_daily t1
|
|
|
LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
|
|
|
LEFT JOIN(
|
|
|
- SELECT user_id,COUNT(1) 'accountCount' FROM ctop_user_allocation i1
|
|
|
- INNER JOIN ctop_etl_kuaishou_report_account_daily i2 ON i1.account_id = i2.account_id
|
|
|
+ SELECT user_id,COUNT(1) 'accountCount' FROM (
|
|
|
+ SELECT user_id,i1.account_id FROM ctop_user_allocation i1
|
|
|
+ INNER JOIN ctop_etl_kuaishou_report_account_daily i2 ON i1.account_id = i2.account_id
|
|
|
AND i2.stat_date >= #{startTime}
|
|
|
and i2.stat_date <= #{endTime}
|
|
|
WHERE user_id IN
|
|
@@ -581,7 +582,8 @@
|
|
|
open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
- GROUP BY user_id
|
|
|
+ GROUP BY user_id,i1.account_id
|
|
|
+ )t GROUP BY user_id
|
|
|
) t3 ON t2.user_id = t3.user_id
|
|
|
LEFT JOIN (
|
|
|
SELECT
|