|
@@ -1128,21 +1128,22 @@
|
|
|
|
|
|
|
|
|
<select id="findByAdvertiser" parameterType="map" resultType="map">
|
|
|
- select ad.name as advertiserName,date as reportDate,sum(a.consume) as totalConsume,sum(a.impression) as totalImpression,
|
|
|
-sum(click) as totalClick, if(sum(a.impression) > 0,sum(a.click)/sum(a.impression),0)
|
|
|
+ select ad.name as advertiserName,date as reportDate,a.consume as totalConsume,a.impression as totalImpression,
|
|
|
+click as totalClick, if(a.impression > 0,a.click/a.impression,0)
|
|
|
as clickRate from t_rpt_advertiser as a left join t_advertiser ad on a.advertiser_id=ad.id
|
|
|
- where a.advertiser_id=#{advertiserId}
|
|
|
+ where a.advertiser_id=#{advertiserId} and a.order_id = 0 and a.campaign_id = 0
|
|
|
+ and a.adgroup_id = 0 and a.banner_id = 0
|
|
|
and a.date >= #{startDate} and a.date <=#{endDate}
|
|
|
- group by date(a.date)
|
|
|
</select>
|
|
|
|
|
|
<select id="findByAdvertiser3" parameterType="map" resultType="map">
|
|
|
- select ad.name as advertiserName,date as reportDate,sum(a.consume) as totalConsume,sum(a.impression) as totalImpression,
|
|
|
-sum(click) as totalClick, if(sum(a.impression) > 0,sum(a.click)/sum(a.impression),0)
|
|
|
+ select ad.name as advertiserName,date as reportDate,a.consume as totalConsume,a.impression as totalImpression,
|
|
|
+click as totalClick, if(a.impression > 0,a.click/a.impression,0)
|
|
|
as clickRate from t_rpt_advertiser as a left join t_advertiser ad on a.advertiser_id=ad.id
|
|
|
where a.advertiser_id=#{advertiserId}
|
|
|
+ and a.order_id = 0 and a.campaign_id = 0
|
|
|
+ and a.adgroup_id = 0 and a.banner_id = 0
|
|
|
and a.date >= #{startDate} and a.date <=#{endDate}
|
|
|
- group by date(a.date)
|
|
|
limit #{pager.offset}, #{pager.limit}
|
|
|
</select>
|
|
|
|
|
@@ -1162,11 +1163,11 @@ sum(click) as totalClick, if(sum(a.impression) > 0,sum(a.click)/sum(a.impression
|
|
|
</select>
|
|
|
|
|
|
<select id="findByAdvertiser1" parameterType="map" resultType="map">
|
|
|
- select ad.name as advertiserName,date as reportDate, a.hour as hour,sum(a.consume) as totalConsume,sum(a.impression) as totalImpression,
|
|
|
-sum(click) as totalClick, if(sum(a.impression) > 0,sum(a.click)/sum(a.impression),0)
|
|
|
+ select ad.name as advertiserName,date as reportDate, a.hour as hour,a.consume as totalConsume,a.impression as totalImpression,
|
|
|
+click as totalClick, if(a.impression > 0,a.click/a.impression,0)
|
|
|
as clickRate from t_rpt_advertiser_hour as a left join t_advertiser ad on a.advertiser_id=ad.id
|
|
|
- where a.advertiser_id=#{advertiserId} and a.date = #{startDate}
|
|
|
- group by a.hour
|
|
|
+ where a.advertiser_id=#{advertiserId} and a.date = #{startDate} and a.order_id = 0 and a.campaign_id = 0
|
|
|
+ and a.adgroup_id = 0 and a.banner_id = 0
|
|
|
</select>
|
|
|
|
|
|
<select id="countByPlace" parameterType="map" resultType="int">
|
|
@@ -1176,11 +1177,12 @@ sum(click) as totalClick, if(sum(a.impression) > 0,sum(a.click)/sum(a.impression
|
|
|
|
|
|
|
|
|
<select id="findByAdvertiser2" parameterType="map" resultType="map">
|
|
|
- select ad.name as advertiserName,date as reportDate, a.hour as hour,sum(a.consume) as totalConsume,sum(a.impression) as totalImpression,
|
|
|
-sum(click) as totalClick, if(sum(a.impression) > 0,sum(a.click)/sum(a.impression),0)
|
|
|
+ select ad.name as advertiserName,date as reportDate, a.hour as hour,a.consume as totalConsume,a.impression as totalImpression,
|
|
|
+click as totalClick, if(a.impression > 0,a.click/a.impression,0)
|
|
|
as clickRate from t_rpt_advertiser_hour as a left join t_advertiser ad on a.advertiser_id=ad.id
|
|
|
where a.advertiser_id=#{advertiserId} and a.date = #{startDate}
|
|
|
- group by a.hour
|
|
|
+ and a.order_id = 0 and a.campaign_id = 0
|
|
|
+ and a.adgroup_id = 0 and a.banner_id = 0
|
|
|
limit #{pager.offset}, #{pager.limit}
|
|
|
</select>
|
|
|
|
|
@@ -1200,8 +1202,9 @@ sum(click) as totalClick, if(sum(a.impression) > 0,sum(a.click)/sum(a.impression
|
|
|
</select>
|
|
|
|
|
|
<select id="findCountForChart" parameterType="map" resultType="int">
|
|
|
- select count(date) from((select distinct date from t_rpt_advertiser where advertiser_id=#{advertiserId}
|
|
|
- and date >= #{startDate} and date <=#{endDate}) as a)
|
|
|
+ select count(date) from t_rpt_advertiser where advertiser_id=#{advertiserId} and
|
|
|
+ order_id = 0 and campaign_id = 0 and adgroup_id = 0 and banner_id = 0
|
|
|
+ and date >= #{startDate} and date <=#{endDate}
|
|
|
</select>
|
|
|
|
|
|
<select id="findByPlace1" parameterType="map" resultType="com.cloudcross.ssp.model.DeliverAnalysis">
|
|
@@ -1218,13 +1221,16 @@ sum(click) as totalClick, if(sum(a.impression) > 0,sum(a.click)/sum(a.impression
|
|
|
</select>
|
|
|
|
|
|
<select id="findCountForChart1" parameterType="map" resultType="int">
|
|
|
- select count(hour) from ((select distinct hour from t_rpt_advertiser_hour where advertiser_id=#{advertiserId} and date = #{startDate}) as a)
|
|
|
+ select count(hour) from t_rpt_advertiser_hour where advertiser_id=#{advertiserId} and
|
|
|
+ order_id = 0 and campaign_id = 0 and adgroup_id = 0 and banner_id = 0
|
|
|
+ and date = #{startDate}
|
|
|
</select>
|
|
|
|
|
|
<select id="findTotalImpressionAndClickByAdvertiserId" parameterType="map" resultType="map">
|
|
|
- select sum(impression) as totalImpression, sum(click) as totalClick
|
|
|
+ select impression as totalImpression, click as totalClick
|
|
|
from t_rpt_advertiser
|
|
|
- where advertiser_id = #{advertiserId} and date = #{date}
|
|
|
+ where advertiser_id = #{advertiserId} and date = #{date} and order_id = 0 and campaign_id = 0
|
|
|
+ and adgroup_id = 0 and banner_id = 0
|
|
|
</select>
|
|
|
|
|
|
<select id="countByApmac" parameterType="map" resultType="int">
|
|
@@ -1236,7 +1242,8 @@ sum(click) as totalClick, if(sum(a.impression) > 0,sum(a.click)/sum(a.impression
|
|
|
select sum(a.impression) as totalImpression, sum(a.click) as totalClick
|
|
|
from t_rpt_advertiser a,t_advertiser b
|
|
|
where b.id = a.advertiser_id and b.agent_id = #{agentId}
|
|
|
- and a.date = #{date}
|
|
|
+ and a.date = #{date} and a.advertiser_id != 0 and a.order_id = 0 and a.campaign_id = 0
|
|
|
+ and a.adgroup_id = 0 and a.banner_id = 0
|
|
|
|
|
|
</select>
|
|
|
|