|
@@ -155,8 +155,6 @@
|
|
|
WHERE clip_id = #{userId}
|
|
|
AND d.stat_date >= #{startTime}
|
|
|
AND d.stat_date <= #{endTime}
|
|
|
- AND d.first_cost_day >= #{startTime}
|
|
|
- AND d.first_cost_day <= #{endTime}
|
|
|
UNION ALL
|
|
|
SELECT QUARTER(d.first_cost_day) quaterTime,
|
|
|
DATE_FORMAT(d.first_cost_day, '%Y') yearTime,
|
|
@@ -169,8 +167,6 @@
|
|
|
WHERE shot_id = #{userId}
|
|
|
AND d.stat_date >= #{startTime}
|
|
|
AND d.stat_date <= #{endTime}
|
|
|
- AND d.first_cost_day >= #{startTime}
|
|
|
- AND d.first_cost_day <= #{endTime}
|
|
|
UNION ALL
|
|
|
SELECT QUARTER(d.first_cost_day) quaterTime,
|
|
|
DATE_FORMAT(d.first_cost_day, '%Y') yearTime,
|
|
@@ -183,8 +179,6 @@
|
|
|
WHERE plan_id = #{userId}
|
|
|
AND d.stat_date >= #{startTime}
|
|
|
AND d.stat_date <= #{endTime}
|
|
|
- AND d.first_cost_day >= #{startTime}
|
|
|
- AND d.first_cost_day <= #{endTime}
|
|
|
</select>
|
|
|
|
|
|
|
|
@@ -201,8 +195,6 @@
|
|
|
WHERE clip_id = #{userId}
|
|
|
AND d.stat_date >= #{startTime}
|
|
|
AND d.stat_date <= #{endTime}
|
|
|
- AND d.first_cost_day >= #{startTime}
|
|
|
- AND d.first_cost_day <= #{endTime}
|
|
|
UNION ALL
|
|
|
SELECT QUARTER(d.first_cost_day) quaterTime,
|
|
|
DATE_FORMAT(d.first_cost_day, '%Y') yearTime,
|
|
@@ -215,8 +207,6 @@
|
|
|
WHERE shot_id = #{userId}
|
|
|
AND d.stat_date >= #{startTime}
|
|
|
AND d.stat_date <= #{endTime}
|
|
|
- AND d.first_cost_day >= #{startTime}
|
|
|
- AND d.first_cost_day <= #{endTime}
|
|
|
UNION ALL
|
|
|
SELECT QUARTER(d.first_cost_day) quaterTime,
|
|
|
DATE_FORMAT(d.first_cost_day, '%Y') yearTime,
|
|
@@ -229,8 +219,6 @@
|
|
|
WHERE plan_id = #{userId}
|
|
|
AND d.stat_date >= #{startTime}
|
|
|
AND d.stat_date <= #{endTime}
|
|
|
- AND d.first_cost_day >= #{startTime}
|
|
|
- AND d.first_cost_day <= #{endTime}
|
|
|
</select>
|
|
|
|
|
|
<!-- 查询设计 本季度 头条季度消耗汇总-->
|
|
@@ -250,8 +238,6 @@
|
|
|
)
|
|
|
AND stat_date >= #{startTime}
|
|
|
AND stat_date <= #{endTime}
|
|
|
- AND d.first_cost_day >= #{startTime}
|
|
|
- AND d.first_cost_day <= #{endTime}
|
|
|
</select>
|
|
|
<!-- 查询设计 本季度 快手季度消耗汇总-->
|
|
|
<select id="getDesignerKuaishouQuaterCost" resultType="com.alibaba.fastjson.JSONObject">
|
|
@@ -270,8 +256,6 @@
|
|
|
)
|
|
|
AND stat_date >= #{startTime}
|
|
|
AND stat_date <= #{endTime}
|
|
|
- AND d.first_cost_day >= #{startTime}
|
|
|
- AND d.first_cost_day <= #{endTime}
|
|
|
</select>
|
|
|
|
|
|
<!-- 管理消耗-->
|
|
@@ -283,16 +267,12 @@
|
|
|
WHERE leader_id = #{userId}
|
|
|
AND stat_date >= #{startTime}
|
|
|
AND stat_date <= #{endTime}
|
|
|
- AND first_cost_day >= #{startTime}
|
|
|
- AND first_cost_day <= #{endTime}
|
|
|
UNION
|
|
|
SELECT IFNULL(SUM(charge), 0) cost, leader_id, 'kuaishou' as type, 2 as sort
|
|
|
FROM application.kuaishou_material_cost_daily
|
|
|
WHERE leader_id = #{userId}
|
|
|
AND stat_date >= #{startTime}
|
|
|
AND stat_date <= #{endTime}
|
|
|
- AND first_cost_day >= #{startTime}
|
|
|
- AND first_cost_day <= #{endTime}
|
|
|
) t
|
|
|
ORDER BY t.sort
|
|
|
</select>
|
|
@@ -394,8 +374,6 @@
|
|
|
WHERE clip_id = #{userId}
|
|
|
AND d.stat_date >= #{month1.startTime}
|
|
|
AND d.stat_date <= #{month1.endTime}
|
|
|
- AND d.first_cost_day >= #{month1.startTime}
|
|
|
- AND d.first_cost_day <= #{month1.endTime}
|
|
|
UNION
|
|
|
SELECT DATE_FORMAT(#{month1.startTime}, '%m') monthTime,
|
|
|
IFNULL(ROUND(SUM(d.cost), 2), 0) AS cost,
|
|
@@ -406,8 +384,6 @@
|
|
|
WHERE shot_id = #{userId}
|
|
|
AND d.stat_date >= #{month1.startTime}
|
|
|
AND d.stat_date <= #{month1.endTime}
|
|
|
- AND d.first_cost_day >= #{month1.startTime}
|
|
|
- AND d.first_cost_day <= #{month1.endTime}
|
|
|
UNION
|
|
|
SELECT DATE_FORMAT(#{month1.startTime}, '%m') monthTime,
|
|
|
IFNULL(ROUND(SUM(d.cost), 2), 0) AS cost,
|
|
@@ -418,8 +394,6 @@
|
|
|
WHERE plan_id = #{userId}
|
|
|
AND d.stat_date >= #{month1.startTime}
|
|
|
AND d.stat_date <= #{month1.endTime}
|
|
|
- AND d.first_cost_day >= #{month1.startTime}
|
|
|
- AND d.first_cost_day <= #{month1.endTime}
|
|
|
UNION
|
|
|
SELECT DATE_FORMAT(#{month2.startTime}, '%m') monthTime,
|
|
|
IFNULL(ROUND(SUM(d.cost), 2), 0) AS cost,
|
|
@@ -430,8 +404,6 @@
|
|
|
WHERE clip_id = #{userId}
|
|
|
AND d.stat_date >= #{month2.startTime}
|
|
|
AND d.stat_date <= #{month2.endTime}
|
|
|
- AND d.first_cost_day >= #{month2.startTime}
|
|
|
- AND d.first_cost_day <= #{month2.endTime}
|
|
|
UNION
|
|
|
SELECT DATE_FORMAT(#{month2.startTime}, '%m') monthTime,
|
|
|
IFNULL(ROUND(SUM(d.cost), 2), 0) AS cost,
|
|
@@ -442,8 +414,6 @@
|
|
|
WHERE shot_id = #{userId}
|
|
|
AND d.stat_date >= #{month2.startTime}
|
|
|
AND d.stat_date <= #{month2.endTime}
|
|
|
- AND d.first_cost_day >= #{month2.startTime}
|
|
|
- AND d.first_cost_day <= #{month2.endTime}
|
|
|
UNION
|
|
|
SELECT DATE_FORMAT(#{month2.startTime}, '%m') monthTime,
|
|
|
IFNULL(ROUND(SUM(d.cost), 2), 0) AS cost,
|
|
@@ -454,8 +424,6 @@
|
|
|
WHERE plan_id = #{userId}
|
|
|
AND d.stat_date >= #{month2.startTime}
|
|
|
AND d.stat_date <= #{month2.endTime}
|
|
|
- AND d.first_cost_day >= #{month2.startTime}
|
|
|
- AND d.first_cost_day <= #{month2.endTime}
|
|
|
UNION
|
|
|
SELECT DATE_FORMAT(#{month3.startTime}, '%m') monthTime,
|
|
|
IFNULL(ROUND(SUM(d.cost), 2), 0) AS cost,
|
|
@@ -466,8 +434,6 @@
|
|
|
WHERE clip_id = #{userId}
|
|
|
AND d.stat_date >= #{month3.startTime}
|
|
|
AND d.stat_date <= #{month3.endTime}
|
|
|
- AND d.first_cost_day >= #{month3.startTime}
|
|
|
- AND d.first_cost_day <= #{month3.endTime}
|
|
|
UNION
|
|
|
SELECT DATE_FORMAT(#{month3.startTime}, '%m') monthTime,
|
|
|
IFNULL(ROUND(SUM(d.cost), 2), 0) AS cost,
|
|
@@ -478,8 +444,6 @@
|
|
|
WHERE shot_id = #{userId}
|
|
|
AND d.stat_date >= #{month3.startTime}
|
|
|
AND d.stat_date <= #{month3.endTime}
|
|
|
- AND d.first_cost_day >= #{month3.startTime}
|
|
|
- AND d.first_cost_day <= #{month3.endTime}
|
|
|
UNION
|
|
|
SELECT DATE_FORMAT(#{month3.startTime}, '%m') monthTime,
|
|
|
IFNULL(ROUND(SUM(d.cost), 2), 0) AS cost,
|
|
@@ -490,8 +454,6 @@
|
|
|
WHERE plan_id = #{userId}
|
|
|
AND d.stat_date >= #{month3.startTime}
|
|
|
AND d.stat_date <= #{month3.endTime}
|
|
|
- AND d.first_cost_day >= #{month3.startTime}
|
|
|
- AND d.first_cost_day <= #{month3.endTime}
|
|
|
) t
|
|
|
order by monthTime, type
|
|
|
</select>
|
|
@@ -510,8 +472,6 @@
|
|
|
WHERE clip_id = #{userId}
|
|
|
AND d.stat_date >= #{month1.startTime}
|
|
|
AND d.stat_date <= #{month1.endTime}
|
|
|
- AND d.first_cost_day >= #{month1.startTime}
|
|
|
- AND d.first_cost_day <= #{month1.endTime}
|
|
|
UNION
|
|
|
SELECT DATE_FORMAT(#{month1.startTime}, '%m') monthTime,
|
|
|
IFNULL(ROUND(SUM(d.charge), 2), 0) AS cost,
|
|
@@ -522,8 +482,6 @@
|
|
|
WHERE shot_id = #{userId}
|
|
|
AND d.stat_date >= #{month1.startTime}
|
|
|
AND d.stat_date <= #{month1.endTime}
|
|
|
- AND d.first_cost_day >= #{month1.startTime}
|
|
|
- AND d.first_cost_day <= #{month1.endTime}
|
|
|
UNION
|
|
|
SELECT DATE_FORMAT(#{month1.startTime}, '%m') monthTime,
|
|
|
IFNULL(ROUND(SUM(d.charge), 2), 0) AS cost,
|
|
@@ -534,8 +492,6 @@
|
|
|
WHERE plan_id = #{userId}
|
|
|
AND d.stat_date >= #{month1.startTime}
|
|
|
AND d.stat_date <= #{month1.endTime}
|
|
|
- AND d.first_cost_day >= #{month1.startTime}
|
|
|
- AND d.first_cost_day <= #{month1.endTime}
|
|
|
UNION
|
|
|
SELECT DATE_FORMAT(#{month2.startTime}, '%m') monthTime,
|
|
|
IFNULL(ROUND(SUM(d.charge), 2), 0) AS cost,
|
|
@@ -546,8 +502,6 @@
|
|
|
WHERE clip_id = #{userId}
|
|
|
AND d.stat_date >= #{month2.startTime}
|
|
|
AND d.stat_date <= #{month2.endTime}
|
|
|
- AND d.first_cost_day >= #{month2.startTime}
|
|
|
- AND d.first_cost_day <= #{month2.endTime}
|
|
|
UNION
|
|
|
SELECT DATE_FORMAT(#{month2.startTime}, '%m') monthTime,
|
|
|
IFNULL(ROUND(SUM(d.charge), 2), 0) AS cost,
|
|
@@ -558,8 +512,6 @@
|
|
|
WHERE shot_id = #{userId}
|
|
|
AND d.stat_date >= #{month2.startTime}
|
|
|
AND d.stat_date <= #{month2.endTime}
|
|
|
- AND d.first_cost_day >= #{month2.startTime}
|
|
|
- AND d.first_cost_day <= #{month2.endTime}
|
|
|
UNION
|
|
|
SELECT DATE_FORMAT(#{month2.startTime}, '%m') monthTime,
|
|
|
IFNULL(ROUND(SUM(d.charge), 2), 0) AS cost,
|
|
@@ -570,8 +522,6 @@
|
|
|
WHERE plan_id = #{userId}
|
|
|
AND d.stat_date >= #{month2.startTime}
|
|
|
AND d.stat_date <= #{month2.endTime}
|
|
|
- AND d.first_cost_day >= #{month2.startTime}
|
|
|
- AND d.first_cost_day <= #{month2.endTime}
|
|
|
UNION
|
|
|
SELECT DATE_FORMAT(#{month3.startTime}, '%m') monthTime,
|
|
|
IFNULL(ROUND(SUM(d.charge), 2), 0) AS cost,
|
|
@@ -582,8 +532,6 @@
|
|
|
WHERE clip_id = #{userId}
|
|
|
AND d.stat_date >= #{month3.startTime}
|
|
|
AND d.stat_date <= #{month3.endTime}
|
|
|
- AND d.first_cost_day >= #{month3.startTime}
|
|
|
- AND d.first_cost_day <= #{month3.endTime}
|
|
|
UNION
|
|
|
SELECT DATE_FORMAT(#{month3.startTime}, '%m') monthTime,
|
|
|
IFNULL(ROUND(SUM(d.charge), 2), 0) AS cost,
|
|
@@ -594,8 +542,6 @@
|
|
|
WHERE shot_id = #{userId}
|
|
|
AND d.stat_date >= #{month3.startTime}
|
|
|
AND d.stat_date <= #{month3.endTime}
|
|
|
- AND d.first_cost_day >= #{month3.startTime}
|
|
|
- AND d.first_cost_day <= #{month3.endTime}
|
|
|
UNION
|
|
|
SELECT DATE_FORMAT(#{month3.startTime}, '%m') monthTime,
|
|
|
IFNULL(ROUND(SUM(d.charge), 2), 0) AS cost,
|
|
@@ -606,8 +552,6 @@
|
|
|
WHERE plan_id = #{userId}
|
|
|
AND d.stat_date >= #{month3.startTime}
|
|
|
AND d.stat_date <= #{month3.endTime}
|
|
|
- AND d.first_cost_day >= #{month3.startTime}
|
|
|
- AND d.first_cost_day <= #{month3.endTime}
|
|
|
) t
|
|
|
order by monthTime, type
|
|
|
</select>
|