|
@@ -33,11 +33,15 @@
|
|
ctop_kuaishou_strategy t1
|
|
ctop_kuaishou_strategy t1
|
|
LEFT JOIN ctop_ai_kuaishou_strategy_map_creative t2 on t1.id=t2.strategy_id
|
|
LEFT JOIN ctop_ai_kuaishou_strategy_map_creative t2 on t1.id=t2.strategy_id
|
|
left join ctop_kuaishou_report_daily_campaign t3 on t2.campaign_id=t3.campaign_id
|
|
left join ctop_kuaishou_report_daily_campaign t3 on t2.campaign_id=t3.campaign_id
|
|
- where t1.account_id in
|
|
|
|
- <foreach item="item" index="index" collection="accountIds"
|
|
|
|
- open="(" separator="," close=")">
|
|
|
|
- #{item}
|
|
|
|
- </foreach>
|
|
|
|
|
|
+ where
|
|
|
|
+ 1=1
|
|
|
|
+ <if test="accountIds!=null">
|
|
|
|
+ and t1.account_id in
|
|
|
|
+ <foreach item="item" index="index" collection="accountIds"
|
|
|
|
+ open="(" separator="," close=")">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
<if test="strategyName != null">
|
|
<if test="strategyName != null">
|
|
AND t1.strategy_name like '%${strategyName}%'
|
|
AND t1.strategy_name like '%${strategyName}%'
|
|
</if>
|
|
</if>
|
|
@@ -47,12 +51,13 @@
|
|
<if test="id != null">
|
|
<if test="id != null">
|
|
AND t1.id=#{id}
|
|
AND t1.id=#{id}
|
|
</if>
|
|
</if>
|
|
|
|
+ group by t1.id
|
|
order by t1.create_time desc
|
|
order by t1.create_time desc
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="queryCampaignByStrategyId" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="queryCampaignByStrategyId" resultType="com.alibaba.fastjson.JSONObject">
|
|
SELECT
|
|
SELECT
|
|
- t1.campaign_id as campaignId,
|
|
|
|
|
|
+ t2.campaign_id as campaignId,
|
|
t1.campaign_name as campaignName,
|
|
t1.campaign_name as campaignName,
|
|
t1.status,
|
|
t1.status,
|
|
t3.id as strategyId,
|
|
t3.id as strategyId,
|
|
@@ -75,8 +80,8 @@
|
|
IFNULL(sum(t1.event_next_day_stay),0) as nextDayOpen,
|
|
IFNULL(sum(t1.event_next_day_stay),0) as nextDayOpen,
|
|
CASE WHEN sum(t1.event_next_day_stay) / sum(t1.activation) IS NULL THEN 0 ELSE concat(round(sum(t1.event_next_day_stay) / sum(t1.activation)*100,2),'%') end as nextDayOpenRate
|
|
CASE WHEN sum(t1.event_next_day_stay) / sum(t1.activation) IS NULL THEN 0 ELSE concat(round(sum(t1.event_next_day_stay) / sum(t1.activation)*100,2),'%') end as nextDayOpenRate
|
|
FROM
|
|
FROM
|
|
- ctop_kuaishou_report_daily_campaign t1
|
|
|
|
- LEFT JOIN ctop_ai_kuaishou_strategy_map_creative t2 on t1.campaign_id=t2.campaign_id
|
|
|
|
|
|
+ ctop_ai_kuaishou_strategy_map_creative t2
|
|
|
|
+ LEFT JOIN ctop_kuaishou_report_daily_campaign t1 on t1.campaign_id=t2.campaign_id
|
|
left join ctop_kuaishou_strategy t3 on t2.strategy_id=t3.id
|
|
left join ctop_kuaishou_strategy t3 on t2.strategy_id=t3.id
|
|
where t3.id= #{strategyId}
|
|
where t3.id= #{strategyId}
|
|
<if test="campaignName != null">
|
|
<if test="campaignName != null">
|
|
@@ -94,9 +99,9 @@
|
|
|
|
|
|
<select id="queryUnitByCampaignId" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="queryUnitByCampaignId" resultType="com.alibaba.fastjson.JSONObject">
|
|
SELECT
|
|
SELECT
|
|
- t1.campaign_id as campaignId,
|
|
|
|
|
|
+ t2.campaign_id as campaignId,
|
|
t1.campaign_name as campaignName,
|
|
t1.campaign_name as campaignName,
|
|
- t1.unit_id as unitId,
|
|
|
|
|
|
+ t2.unit_id as unitId,
|
|
t1.unit_name as unitName,
|
|
t1.unit_name as unitName,
|
|
t1.status,
|
|
t1.status,
|
|
t3.id as strategyId,
|
|
t3.id as strategyId,
|
|
@@ -119,10 +124,10 @@
|
|
IFNULL(sum(t1.event_next_day_stay),0) as nextDayOpen,
|
|
IFNULL(sum(t1.event_next_day_stay),0) as nextDayOpen,
|
|
CASE WHEN sum(t1.event_next_day_stay) / sum(t1.activation) IS NULL THEN 0 ELSE concat(round(sum(t1.event_next_day_stay) / sum(t1.activation)*100,2),'%') end as nextDayOpenRate
|
|
CASE WHEN sum(t1.event_next_day_stay) / sum(t1.activation) IS NULL THEN 0 ELSE concat(round(sum(t1.event_next_day_stay) / sum(t1.activation)*100,2),'%') end as nextDayOpenRate
|
|
FROM
|
|
FROM
|
|
- ctop_kuaishou_report_daily_group t1
|
|
|
|
- LEFT JOIN ctop_ai_kuaishou_strategy_map_creative t2 on t1.unit_id=t2.unit_id
|
|
|
|
|
|
+ ctop_ai_kuaishou_strategy_map_creative t2
|
|
|
|
+ LEFT JOIN ctop_kuaishou_report_daily_group t1 on t1.unit_id=t2.unit_id
|
|
left join ctop_kuaishou_strategy t3 on t2.strategy_id=t3.id
|
|
left join ctop_kuaishou_strategy t3 on t2.strategy_id=t3.id
|
|
- where t1.campaign_id= #{campaignId}
|
|
|
|
|
|
+ where t2.campaign_id= #{campaignId}
|
|
<if test="unitName != null">
|
|
<if test="unitName != null">
|
|
and t1.unit_name like '%${unitName}}%'
|
|
and t1.unit_name like '%${unitName}}%'
|
|
</if>
|
|
</if>
|
|
@@ -132,7 +137,7 @@
|
|
<if test="status != null">
|
|
<if test="status != null">
|
|
AND t1.status=#{status}
|
|
AND t1.status=#{status}
|
|
</if>
|
|
</if>
|
|
- GROUP BY t1.unit_id
|
|
|
|
|
|
+ GROUP BY t2.unit_id
|
|
order by t1.create_time desc
|
|
order by t1.create_time desc
|
|
</select>
|
|
</select>
|
|
-</mapper>
|
|
|
|
|
|
+</mapper>
|