فهرست منبع

运营绩效功能,头条sql

zhaoxian 2 سال پیش
والد
کامیت
f0f79a9c65

+ 7 - 6
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/report/mapper/xml/KuaishouOperationReportMapper.xml

@@ -253,12 +253,13 @@
     <select id="getTtManageChargeCommission" resultType="java.math.BigDecimal">
         SELECT IFNULL(ROUND(SUM(cost), 3), 0.0)
         FROM application.bytedance_operation_performance_base
-        WHERE account_id IN (
-            SELECT account_id
-            FROM ctop_user_allocation
-            WHERE user_id IN (SELECT user_id
-                              FROM `application`.app_user_manage
-                              WHERE manage_id = #{userId})
+        WHERE leader_id = #{userId}
+          AND user_id NOT IN (
+            SELECT assistant_id
+            FROM sys_operate_rel
+            WHERE operate_id = #{userId}
+              AND stat_month >= DATE_FORMAT(#{startDate}, '%Y-%m')
+              AND stat_month &lt;= DATE_FORMAT(#{endDate}, '%Y-%m')
         )
           AND stat_date >= #{startDate}
           AND stat_date &lt;= #{endDate}