|
@@ -33,50 +33,34 @@
|
|
|
|
|
|
<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
|
|
|
+ (SELECT project_name from ctop_user_allocation where account_id=t1.account_id ) AS projectName,
|
|
|
+ (SELECT auth_name from ctop_user_allocation where account_id=t1.account_id ) AS authName,
|
|
|
+ ROUND(sum(t1.cost), 2) cost
|
|
|
FROM
|
|
|
- ctop_performance_operate_detail t1
|
|
|
- LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
|
|
|
+ ctop_performance_operate_detail t1
|
|
|
WHERE
|
|
|
- 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
|
|
|
- )
|
|
|
+ t1.stat_date >=#{startDate}
|
|
|
+ AND t1.stat_date <=#{endDate}
|
|
|
+ and t1.user_id=#{userId}
|
|
|
+ and t1.media_type=1
|
|
|
GROUP BY
|
|
|
- t2.account_id
|
|
|
+ t1.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.cost), 2) cost
|
|
|
+ (SELECT project_name from ctop_user_allocation where account_id=t1.account_id ) AS projectName,
|
|
|
+ (SELECT auth_name from ctop_user_allocation where account_id=t1.account_id ) AS authName,
|
|
|
+ ROUND(sum(t1.cost), 2) cost
|
|
|
FROM
|
|
|
- ctop_performance_operate_detail t1
|
|
|
- LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
|
|
|
+ ctop_performance_operate_detail t1
|
|
|
WHERE
|
|
|
- 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
|
|
|
- )
|
|
|
+ t1.stat_date >=#{startDate}
|
|
|
+ AND t1.stat_date <=#{endDate}
|
|
|
+ and t1.user_id=#{userId}
|
|
|
+ and t1.media_type=2
|
|
|
GROUP BY
|
|
|
- t2.account_id
|
|
|
+ t1.account_id
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|