Selaa lähdekoodia

fix on 2020.10.27

jiequan.bi 4 vuotta sitten
vanhempi
commit
210f472294

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

@@ -6,9 +6,9 @@
         SELECT * from (SELECT
         t1.signature,
         t1.photo_url as url,
-        (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,
-        (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,
-        (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.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.plan_id=u.id where t3.material_id=t1.signature limit 1),'') AS plan,
         t1.cover_url as converUrl,
         t2.material_name AS materialName,
         (SELECT project_name FROM ctop_project t4 WHERE t4.id = t3.project_id) AS projectName,
@@ -30,9 +30,9 @@
         </if>
         GROUP BY t1.signature
         ) t
-        WHERE (t.clip LIKE '%${clip}%' or t.clip is null)
-        AND (t.shot LIKE '%${shot}%' or t.shot is null)
-        AND (t.plan LIKE '%${plan}%' or t.plan is null)
+        WHERE (t.clip LIKE '%${clip}%')
+        AND (t.shot LIKE '%${shot}%')
+        AND (t.plan LIKE '%${plan}%')
         ORDER BY ${target} ${order}
     </select>
 

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

@@ -6,9 +6,9 @@
         SELECT * from (SELECT
         t1.signature,
         t2.url,
-        (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,
-        (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,
-        (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.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.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 project_name FROM ctop_project t4 WHERE t4.id = t3.project_id) AS projectName,
@@ -22,18 +22,18 @@
         t1.stat_datetime >= #{startDate}
         AND t1.stat_datetime &lt;= #{endDate}
         <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>
         AND t2.url!=""
         GROUP BY t1.signature
         ) t
-        WHERE (t.clip LIKE '%${clip}%' or t.clip is null)
-        AND (t.shot LIKE '%${shot}%' or t.shot is null)
-        AND (t.plan LIKE '%${plan}%' or t.plan is null)
+        WHERE (t.clip LIKE '%${clip}%')
+        AND (t.shot LIKE '%${shot}%')
+        AND (t.plan LIKE '%${plan}%')
         ORDER BY ${target} ${order}
     </select>