Просмотр исходного кода

Merge branch 'master' of http://git.tjyourong.com.cn/ctop/adsp-boot

syh 4 лет назад
Родитель
Сommit
c747dbdd95

+ 9 - 11
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KsVideoReportMapper.xml

@@ -10,23 +10,22 @@
         IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.shot_id=u.id where t3.material_id=t1.signature limit 1),'') AS shot,
         IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.shot_id=u.id where t3.material_id=t1.signature limit 1),'') AS shot,
         IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.plan_id=u.id where t3.material_id=t1.signature limit 1),'') AS plan,
         IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.plan_id=u.id where t3.material_id=t1.signature limit 1),'') AS plan,
         t1.cover_url as converUrl,
         t1.cover_url as converUrl,
-        t2.material_name AS materialName,
+        (select t2.material_name from ctop_material_info t2 where t2.code=t1.signature limit 1) AS materialName,
         (SELECT project_name FROM ctop_project t4 WHERE t4.id = t3.project_id) AS projectName,
         (SELECT project_name FROM ctop_project t4 WHERE t4.id = t3.project_id) AS projectName,
-        t2.create_time as createTime,
+        (select t2.create_time from ctop_material_info t2 where t2.code=t1.signature limit 1) as createTime,
         ${filed}
         ${filed}
         FROM
         FROM
         ctop_kuaishou_report_daily_material t1
         ctop_kuaishou_report_daily_material t1
-        LEFT JOIN ctop_material_info t2 ON t1.signature = t2. CODE
         LEFT JOIN ctop_user_allocation t3 ON t3.account_id=t1.account_id
         LEFT JOIN ctop_user_allocation t3 ON t3.account_id=t1.account_id
         WHERE
         WHERE
         t1.stat_date >= #{startDate}
         t1.stat_date >= #{startDate}
         AND t1.stat_date <= #{endDate}
         AND t1.stat_date <= #{endDate}
         <if test="accountIds != null">
         <if test="accountIds != null">
-        AND t1.account_id in
-        <foreach item="item" index="index" collection="accountIds"
-                 open="(" separator="," close=")">
-            #{item}
-        </foreach>
+            AND t1.account_id in
+            <foreach item="item" index="index" collection="accountIds"
+                     open="(" separator="," close=")">
+                #{item}
+            </foreach>
         </if>
         </if>
         GROUP BY t1.signature
         GROUP BY t1.signature
         ) t
         ) t
@@ -42,7 +41,7 @@
         t1.signature,
         t1.signature,
         t1.photo_url as url,
         t1.photo_url as url,
         t1.cover_url as converUrl,
         t1.cover_url as converUrl,
-        t2.material_name AS materialName,
+        (select t2.material_name from ctop_material_info t2 where t2.code=t1.signature limit 1) AS materialName,
         (
         (
         SELECT
         SELECT
         project_name
         project_name
@@ -59,11 +58,10 @@
         WHERE
         WHERE
         t4.id = t3.project_id limit 1
         t4.id = t3.project_id limit 1
         ) AS advertiserName,
         ) AS advertiserName,
-        t2.create_time as createTime,
+        (select t2.create_time from ctop_material_info t2 where t2.code=t1.signature limit 1) as createTime,
         ${filed}
         ${filed}
         FROM
         FROM
         ctop_kuaishou_report_daily_material t1
         ctop_kuaishou_report_daily_material t1
-        left join ctop_material_info t2 on t1.signature=t2.code
         LEFT JOIN ctop_user_allocation t3 ON t3.account_id=t1.account_id
         LEFT JOIN ctop_user_allocation t3 ON t3.account_id=t1.account_id
         WHERE t1.signature=#{signature}
         WHERE t1.signature=#{signature}
         AND t1.stat_date >= #{startDate}
         AND t1.stat_date >= #{startDate}

+ 8 - 12
module-toutiao/src/main/java/cn/com/ctop/toutiao/modules/report/mapper/xml/BytedanceVideoReportMapper.xml

@@ -5,18 +5,17 @@
     <select id="queryVideoReportBy" resultType="com.alibaba.fastjson.JSONObject">
     <select id="queryVideoReportBy" resultType="com.alibaba.fastjson.JSONObject">
         SELECT * from (SELECT
         SELECT * from (SELECT
         t1.signature,
         t1.signature,
-        t2.url,
+        t1.video_url as url,
         IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.clip_id=u.id where t3.material_id=t1.signature limit 1),'') AS clip,
         IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.clip_id=u.id where t3.material_id=t1.signature limit 1),'') AS clip,
         IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.shot_id=u.id where t3.material_id=t1.signature limit 1),'') AS shot,
         IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.shot_id=u.id where t3.material_id=t1.signature limit 1),'') AS shot,
         IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.plan_id=u.id where t3.material_id=t1.signature limit 1),'') AS plan,
         IFNULL((SELECT u.realname FROM ctop_material_ascription t3 LEFT JOIN sys_user u on t3.plan_id=u.id where t3.material_id=t1.signature limit 1),'') AS plan,
-        t2.cover_url as converUrl,
-        t2.material_name AS materialName,
+        (select t2.cover_url from ctop_material_info t2 where t2.code=t1.signature limit 1) AS converUrl,
+        (select t2.material_name from ctop_material_info t2 where t2.code=t1.signature limit 1) AS materialName,
         (SELECT project_name FROM ctop_project t4 WHERE t4.id = t3.project_id) AS projectName,
         (SELECT project_name FROM ctop_project t4 WHERE t4.id = t3.project_id) AS projectName,
-        t2.create_time as createTime,
+        (select t2.create_time from ctop_material_info t2 where t2.code=t1.signature limit 1) as createTime,
         ${filed}
         ${filed}
         FROM
         FROM
         ctop_bytedance_video_report_daily t1
         ctop_bytedance_video_report_daily t1
-        left join ctop_material_info t2 on t1.signature=t2.code
         LEFT JOIN ctop_user_allocation t3 ON t3.account_id=t1.account_id
         LEFT JOIN ctop_user_allocation t3 ON t3.account_id=t1.account_id
         WHERE
         WHERE
         t1.stat_datetime >= #{startDate}
         t1.stat_datetime >= #{startDate}
@@ -28,7 +27,6 @@
                 #{item}
                 #{item}
             </foreach>
             </foreach>
         </if>
         </if>
-        AND t2.url!=""
         GROUP BY t1.signature
         GROUP BY t1.signature
         ) t
         ) t
         WHERE (t.clip LIKE '%${clip}%')
         WHERE (t.clip LIKE '%${clip}%')
@@ -41,9 +39,9 @@
         SELECT
         SELECT
         t1.stat_datetime as statDate,
         t1.stat_datetime as statDate,
         t1.signature,
         t1.signature,
-        t2.url,
-        t2.cover_url as converUrl,
-        t2.material_name AS materialName,
+        t1.video_url as url,
+        (select t2.cover_url from ctop_material_info t2 where t2.code=t1.signature limit 1) AS converUrl,
+        (select t2.material_name from ctop_material_info t2 where t2.code=t1.signature limit 1) AS materialName,
         (
         (
         SELECT
         SELECT
         project_name
         project_name
@@ -60,11 +58,10 @@
         WHERE
         WHERE
         t4.id = t3.project_id limit 1
         t4.id = t3.project_id limit 1
         ) AS advertiserName,
         ) AS advertiserName,
-        t2.create_time as createTime,
+        (select t2.create_time from ctop_material_info t2 where t2.code=t1.signature limit 1) as createTime,
         ${filed}
         ${filed}
         FROM
         FROM
         ctop_bytedance_video_report_daily t1
         ctop_bytedance_video_report_daily t1
-        left join ctop_material_info t2 on t1.signature=t2.code
         LEFT JOIN ctop_user_allocation t3 ON t3.account_id=t1.account_id
         LEFT JOIN ctop_user_allocation t3 ON t3.account_id=t1.account_id
         WHERE t1.signature=#{signature}
         WHERE t1.signature=#{signature}
         AND t1.stat_datetime >= #{startDate}
         AND t1.stat_datetime >= #{startDate}
@@ -76,7 +73,6 @@
                 #{item}
                 #{item}
             </foreach>
             </foreach>
         </if>
         </if>
-        AND t2.url!=""
         GROUP BY t1.signature,t1.stat_datetime
         GROUP BY t1.signature,t1.stat_datetime
     </select>
     </select>
 </mapper>
 </mapper>