소스 검색

素材已关联账户列表sql优化

zhaoxian 4 년 전
부모
커밋
4326ed51ae
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouProjectVideoGetMapper.xml

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaishouProjectVideoGetMapper.xml

@@ -202,10 +202,10 @@
                IFNULL(ROUND(SUM(t1.charge) / SUM(t1.photo_click), 2), 0) 'photoClickCost',
                IFNULL(ROUND(SUM(t1.charge) / SUM(t1.bclick), 2), 0) 'actionCost'
         FROM  ctop_kuaishou_video_get t0
-                  LEFT JOIN ctop_kuaishou_report_daily_material t1 ON t0.signature = t1.signature
+                  LEFT JOIN ctop_kuaishou_report_daily_material t1 ON t0.account_id = t1.account_id
                   LEFT JOIN ctop_user_allocation t2 ON t0.account_id = t2.account_id
                   LEFT JOIN (
-            SELECT COUNT(1) 'rejectCount',account_id FROM ctop_kuaishou_creative WHERE `status` = 42 GROUP BY account_id
+            SELECT IFNULL(COUNT(1),0) 'rejectCount',account_id FROM ctop_kuaishou_creative WHERE `status` = 42 GROUP BY account_id
         ) t3 ON t0.account_id = t3.account_id
         WHERE t2.project_id = #{projectId}
           AND t0.signature = #{signature}