瀏覽代碼

同步素材供应商 优化sql

zhaoxian 3 年之前
父節點
當前提交
3e9d93016f

+ 7 - 4
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouVideoGetMapper.xml

@@ -317,11 +317,14 @@
     </select>
 
     <select id="getAccountIds" resultType="com.alibaba.fastjson.JSONObject">
-        SELECT account_id 'accountId',DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 65 MINUTE), '%Y-%m-%d %H:%i:%s') 'startDate'
-        FROM ctop_kuaishou_video_get
+        SELECT t1.account_id 'accountId',DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 15 MINUTE), '%Y-%m-%d %H:%i:%s') 'startDate'
+        FROM ctop_kuaishou_video_get t1
+                 LEFT JOIN ctop_user_allocation t2 ON t1.account_id = t2.account_id
         where channel_type = 1
-          and status = 0
-        GROUP BY account_id
+          AND t2.account_status = 0
+          AND t1.status = 0
+          AND t1.stat_date >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 2 DAY), '%Y-%m-%d')
+        GROUP BY t1.account_id
     </select>
 
     <select id="queryPhotoIdsByProjectAndMd5" resultType="java.lang.String">