瀏覽代碼

修改sql

yumeng 5 年之前
父節點
當前提交
450d207af2
共有 1 個文件被更改,包括 13 次插入12 次删除
  1. 13 12
      module-report/src/main/java/cn/com/ctop/bytedance/mapper/xml/MaterialReportMapper.xml

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

@@ -92,31 +92,34 @@
         END
         ) conversionPrice, -- 转化单价
 
-        t2.url url, -- 视频url
+        --  t2.url url, -- 视频url
+
+        (SELECT  url
+        FROM ctop_kuaishou_video_get
+        WHERE signature = t2.signature
+        LIMIT 1
+        ) url,
         t2.signature signature -- 视频md5
         from
         ctop_user_allocation t1
         left join
-        ctop_kuaishou_report_hourly_creative_statistic t2
+        ctop_kuaishou_report_daily_creative t2
         on t1.account_id = t2.account_id
+
         <where>
             <if test="userId != null">
                 and t1.user_id = #{userId,jdbcType=VARCHAR}
             </if>
-            and t1.media_id = '2'
-            and t1.account_id != ''
-            and t2.signature != ''
+
             <if test="startDate != null">
                 and t2.stat_date = #{startDate}
             </if>
-            <if test="statHour != null">
-                and t2.stat_hour &lt;= #{statHour}
-            </if>
+            and t2.signature is not null
         </where>
-
         group by t2.signature
         order by sum(t2.charge) desc
-        limit 100
+        limit 100;
+
 
 
     </select>
@@ -207,8 +210,6 @@
 
     <select id="selectDailyByMap" parameterType="Map" resultType="com.alibaba.fastjson.JSONObject">
 
-
-
         SELECT
         sum(t2.charge) cost, -- 花费
         sum(t2.photo_show) photoShow, -- 封面曝光数