|
@@ -19,10 +19,60 @@
|
|
|
<select id="findEveryHourDataOperator" parameterType="map" resultType="com.cloudcross.ssp.model.RptZoneHour">
|
|
|
select hour,sum(pv) as pv,sum(uv) as uv, sum(impression) as impression, sum(click) as click,sum(uimpression) as uImpression,
|
|
|
sum(uclick) as uClick, sum(income) as income
|
|
|
- from t_rpt_zone_hour where operator_id = #{operatorId} and date = #{startDate}
|
|
|
+ from t_rpt_zone_hour where operator_id = #{operatorId}
|
|
|
+ and date =#{startDate}
|
|
|
<if test="zoneId!=null">
|
|
|
and zone_id = #{zoneId}
|
|
|
- </if>
|
|
|
+ </if>
|
|
|
group by hour
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="countByParams" parameterType="map" resultType="int">
|
|
|
+ select count(id) from t_rpt_zone_hour
|
|
|
+ where operator_id = #{operatorId}
|
|
|
+ and date >=#{startDate} and date <=#{endDate}
|
|
|
+ <if test="zoneId!=null">
|
|
|
+ and zone_id = #{zoneId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findByParams1" parameterType="map" resultType="com.cloudcross.ssp.model.DeliverAnalysis">
|
|
|
+ select
|
|
|
+ zone_id as zoneId,date as reportDate, pv, uv, impression,uimpression as uImpression,
|
|
|
+ uclick as uClick,
|
|
|
+ 100*impression/pv as fillRate,
|
|
|
+ click,100* click/impression as clickRate,ecpm as eCpm,income
|
|
|
+ from t_rpt_zone_hour
|
|
|
+ where operator_id = #{operatorId}
|
|
|
+ and date =#{startDate}
|
|
|
+ <if test="zoneId!=null">
|
|
|
+ and zone_id = #{zoneId}
|
|
|
+ </if>
|
|
|
+ limit #{pager.offset}, #{pager.limit}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findByParams2" parameterType="map" resultType="com.cloudcross.ssp.model.DeliverAnalysis">
|
|
|
+ select
|
|
|
+ zone_id as zoneId,date as reportDate, pv, uv, impression,uimpression as uImpression,
|
|
|
+ uclick as uClick,
|
|
|
+ 100*impression/pv as fillRate,
|
|
|
+ click,100* click/impression as clickRate,ecpm as eCpm,income
|
|
|
+ from t_rpt_zone_hour
|
|
|
+ where operator_id = #{operatorId}
|
|
|
+ and date =#{startDate}
|
|
|
+ <if test="zoneId!=null">
|
|
|
+ and zone_id = #{zoneId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="findSum" parameterType="map" resultType="com.cloudcross.ssp.model.DeliverAnalysis">
|
|
|
+ select sum(pv) as pv, sum(uv) as uv, sum(impression) as impression, sum(click) as click, sum(income) as income
|
|
|
+ from t_rpt_zone_hour
|
|
|
+ where operator_id = #{operatorId}
|
|
|
+ and date =#{startDate}
|
|
|
+ <if test="zoneId!=null">
|
|
|
+ and zone_id = #{zoneId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|