浏览代码

下载文件设置延长超时时间

yumeng 5 年之前
父节点
当前提交
364da36078
共有 1 个文件被更改,包括 41 次插入40 次删除
  1. 41 40
      module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/MaterialReportMapper.xml

+ 41 - 40
module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/MaterialReportMapper.xml

@@ -206,6 +206,9 @@
 
 
     <select id="selectDailyByMap" parameterType="Map" resultType="com.alibaba.fastjson.JSONObject">
+
+
+
         SELECT
         sum(t2.charge) cost, -- 花费
         sum(t2.photo_show) photoShow, -- 封面曝光数
@@ -265,13 +268,13 @@
         ELSE 0
         END
         ) conversionPrice, -- 转化单价
-
-        t2.url url, -- 视频url
+        ( SELECT url from ctop_kuaishou_video_get WHERE signature = t2.signature limit 1) url,
+        -- t2.url url, -- 视频url
         t2.signature signature -- 视频md5
         from
         ctop_user_allocation t1
         left join
-        ctop_kuaishou_report_daily_creative_statistic t2
+        ctop_kuaishou_report_daily_creative_new t2
         on t1.account_id = t2.account_id
         <where>
             <if test="userId != null">
@@ -279,7 +282,7 @@
             </if>
             and t1.media_id = '2'
             and t1.account_id != ''
-            and t2.signature != ''
+            and t2.signature is not null
             <if test="startDate != null">
                 and t2.stat_date &lt;= #{startDate}
             </if>
@@ -290,6 +293,7 @@
         group by t2.signature
         order by sum(t2.charge) desc
         limit 100
+
     </select>
 
 
@@ -354,7 +358,7 @@
         END
         ) conversionPrice -- 转化单价
         from
-        ctop_kuaishou_report_daily_creative_statistic
+        ctop_kuaishou_report_daily_creative_new
         <where>
             <if test="signature != null">
                 and signature = #{signature}
@@ -467,90 +471,87 @@
 
     <select id="selectDayMaterialList" parameterType="Map" resultType="com.alibaba.fastjson.JSONObject">
         SELECT
-        sum(t2.charge) cost, -- 花费
-        sum(t2.photo_show) photoShow, -- 封面曝光数
-        sum(t2.photo_click) photoClick, -- 封面点击数
-        sum(t2.aclick) aclick, -- 素材曝光数
-        sum(t2.bclick) bclick, -- 行为数
+        sum(charge) cost, -- 花费
+        sum(photo_show) photoShow, -- 封面曝光数
+        sum(photo_click) photoClick, -- 封面点击数
+        sum(aclick) aclick, -- 素材曝光数
+        sum(bclick) bclick, -- 行为数
         (case
         when sum(photo_show) != 0
-        then (sum(t2.photo_click) / sum(photo_show))
+        then (sum(photo_click) / sum(photo_show))
         else 0
         end
         ) photoClickRatio, -- 封面点击率
 
         (case
         when sum(aclick) != 0
-        then (sum(t2.bclick) / sum(aclick))
+        then (sum(bclick) / sum(aclick))
         else 0
         end
         ) actionRatio, -- 行为率
 
         (case
-        when sum(t2.photo_show) != 0
-        then ((sum(t2.charge) / sum(t2.photo_show)) * 1000)
+        when sum(photo_show) != 0
+        then ((sum(charge) / sum(photo_show)) * 1000)
         else 0
         end
         ) impression1kCost, -- 均千次封面曝光花费
 
         (case
-        when sum(t2.photo_click) != 0
-        then (sum(t2.charge) / sum(t2.photo_click))
+        when sum(photo_click) != 0
+        then (sum(charge) / sum(photo_click))
         else 0
         end
         ) photoClickCost, -- 平均封面点击单价
 
         (CASE
-        WHEN sum(t2.photo_click) != 0
-        THEN (sum(t2.charge) / sum(t2.photo_click))
+        WHEN sum(photo_click) != 0
+        THEN (sum(charge) / sum(photo_click))
         ELSE 0
         end
         ) actionCost, -- 平均行为单价
 
         (case
-        WHEN sum(t2.form_count) != 0
-        THEN sum(t2.form_count)
-        WHEN sum(t2.activation) != 0
-        THEN sum(t2.activation)
+        WHEN sum(form_count) != 0
+        THEN sum(form_count)
+        WHEN sum(activation) != 0
+        THEN sum(activation)
         ELSE 0
         END
         ) conversions, -- 转化数
 
         (
         CASE
-        WHEN sum(t2.form_count) != 0
-        THEN (sum(t2.charge) / sum(t2.form_count))
-        WHEN sum(t2.activation) != 0
-        THEN (sum(t2.charge) / sum(t2.activation))
+        WHEN sum(form_count) != 0
+        THEN (sum(charge) / sum(form_count))
+        WHEN sum(activation) != 0
+        THEN (sum(charge) / sum(activation))
         ELSE 0
         END
         ) conversionPrice, -- 转化单价
 
-        t2.url url, -- 视频url
-        t2.signature signature, -- 视频md5
-        t2.account_id accountId
+        ( SELECT url from ctop_kuaishou_video_get WHERE signature = signature limit 1) url,
+        signature signature, -- 视频md5
+        account_id accountId
         from
-        ctop_oauth_token t1
-        left join
-        ctop_kuaishou_report_daily_creative_statistic t2
-        on t1.id = t2.account_id
-        where t1.id in
+        ctop_kuaishou_report_daily_creative_new
+        where  account_id in
         <foreach item="item" index="index" collection="accountIds"
                  open="(" separator="," close=")">
             #{item}
         </foreach>
-        and t1.media_id = '2'
+
 
         <if test="startDate != null">
-            and t2.stat_date &gt;= #{startDate}
+            and stat_date &gt;= #{startDate}
         </if>
 
         <if test="endDate != null">
-            and t2.stat_date &lt;= #{endDate}
+            and stat_date &lt;= #{endDate}
         </if>
-        and t2.signature != ''
-        GROUP BY t2.signature
-        order by sum(t2.charge) desc
+        and signature is not null
+        GROUP BY signature
+        order by sum(charge) desc
         limit 100
     </select>