|
@@ -33,46 +33,50 @@
|
|
|
|
|
|
<select id="ByteDanceOperateDetailGroupAccountByDate" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
SELECT
|
|
|
- t2.project_name AS projectName,
|
|
|
- t2.auth_name AS authName,
|
|
|
- ROUND(sum(t1.cost), 2) cost
|
|
|
+ t2.project_name AS projectName,
|
|
|
+ t2.auth_name AS authName,
|
|
|
+ ROUND(sum(t1.cost), 2) cost
|
|
|
FROM
|
|
|
- ctop_bytedance_report_advertiser_daily t1
|
|
|
- LEFT JOIN ctop_user_allocation t2 on t1.advertiser_id=t2.account_id
|
|
|
+ ctop_performance_operate_detail t1
|
|
|
+ LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
|
|
|
WHERE
|
|
|
- t1.stat_datetime >= #{startDate} '00:00:00'
|
|
|
- AND t1.stat_datetime <= #{endDate}
|
|
|
- AND t1.advertiser_id IN (
|
|
|
- SELECT
|
|
|
- account_id
|
|
|
- FROM
|
|
|
- ctop_user_allocation
|
|
|
- WHERE
|
|
|
- user_id = #{userId}
|
|
|
- AND media_id = 1
|
|
|
- ) GROUP BY t2.account_id
|
|
|
+ t1.stat_date >=#{startDate}
|
|
|
+ AND t1.stat_date <=#{endDate}
|
|
|
+ AND t1.account_id IN (
|
|
|
+ SELECT
|
|
|
+ account_id
|
|
|
+ FROM
|
|
|
+ ctop_user_allocation
|
|
|
+ WHERE
|
|
|
+ user_id = #{userId}
|
|
|
+ AND media_id = 1
|
|
|
+ )
|
|
|
+ GROUP BY
|
|
|
+ t2.account_id
|
|
|
</select>
|
|
|
|
|
|
<select id="kuaiShouOperateDetailGroupAccountByDate" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
SELECT
|
|
|
- t2.project_name AS projectName,
|
|
|
- t2.auth_name AS authName,
|
|
|
- ROUND(sum(t1.charge), 2) cost
|
|
|
- FROM
|
|
|
- ctop_kuaishou_report_daily_account t1
|
|
|
- LEFT JOIN ctop_user_allocation t2 on t1.account_id=t2.account_id
|
|
|
- WHERE
|
|
|
- t1.stat_date >=#{startDate}
|
|
|
- AND t1.stat_date <=#{endDate}
|
|
|
- AND t1.account_id IN (
|
|
|
- SELECT
|
|
|
- account_id
|
|
|
+ t2.project_name AS projectName,
|
|
|
+ t2.auth_name AS authName,
|
|
|
+ ROUND(sum(t1.cost), 2) cost
|
|
|
FROM
|
|
|
- ctop_user_allocation
|
|
|
+ ctop_performance_operate_detail t1
|
|
|
+ LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
|
|
|
WHERE
|
|
|
- user_id = #{userId}
|
|
|
- AND media_id = 2
|
|
|
- ) GROUP BY t2.account_id
|
|
|
+ t1.stat_date >=#{startDate}
|
|
|
+ AND t1.stat_date <=#{endDate}
|
|
|
+ AND t1.account_id IN (
|
|
|
+ SELECT
|
|
|
+ account_id
|
|
|
+ FROM
|
|
|
+ ctop_user_allocation
|
|
|
+ WHERE
|
|
|
+ user_id = #{userId}
|
|
|
+ AND media_id = 2
|
|
|
+ )
|
|
|
+ GROUP BY
|
|
|
+ t2.account_id
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|