FengChaoYu 8 ay önce
ebeveyn
işleme
3c72941ff9

+ 4 - 56
mall-miniapp-service/src/main/resources/mapper/DailyReportMapper.xml

@@ -44,20 +44,7 @@
         select
           c.*,b.bank_account ,b.bank_account_name,deposit_bank,a.issue_time ,a.issue_by,a.salary_no,a.status 'issueStatus'
         from settle_daily_issue_summary_record a
-        join (
-            SELECT
-                u.id_card,
-                wb.worker_number,
-                u.nick_name
-            FROM
-                user u, websit_user wb
-            WHERE
-                u.company_wechat_id = wb.company_wechat_id
-                AND u.user_id = wb.user_id
-                AND u.apply_type = 'WORKER'
-                AND wb.examine_status = 'OK'
-            GROUP BY wb.worker_number
-        ) aa on a.service_number = aa.worker_number
+        join user aa on a.service_number = aa.worker_number AND aa.apply_type = 'WORKER'
         join settle_daily_bank_account b  on  aa.id_card = b.idcard
         join settle_daily_import_summary_item c  on a.id  = c.issue_salary_id
 
@@ -85,20 +72,7 @@
         select
         c.*,b.bank_account ,b.bank_account_name,deposit_bank,a.issue_time ,a.issue_by,a.salary_no,a.status 'issueStatus'
         from settle_daily_issue_summary_record a
-        join (
-            SELECT
-                u.id_card,
-                wb.worker_number,
-                u.nick_name
-            FROM
-                user u, websit_user wb
-            WHERE
-                u.company_wechat_id = wb.company_wechat_id
-                AND u.user_id = wb.user_id
-                AND u.apply_type = 'WORKER'
-                AND wb.examine_status = 'OK'
-            GROUP BY wb.worker_number
-        ) aa on a.service_number = aa.worker_number
+        join user aa on a.service_number = aa.worker_number AND aa.apply_type = 'WORKER'
         join settle_daily_bank_account b  on  aa.id_card = b.idcard
         join settle_daily_import_summary_item c  on a.id  = c.issue_salary_id
 
@@ -125,20 +99,7 @@
         select
             c.*,b.bank_account ,b.bank_account_name,deposit_bank,a.issue_time ,a.issue_by,a.salary_no,if(a.status = 2,2,1) 'issueStatus'
         from settle_daily_issue_summary_record a
-        join (
-            SELECT
-                u.id_card,
-                wb.worker_number,
-                u.nick_name
-            FROM
-                user u, websit_user wb
-            WHERE
-                u.company_wechat_id = wb.company_wechat_id
-                AND u.user_id = wb.user_id
-                AND u.apply_type = 'WORKER'
-                AND wb.examine_status = 'OK'
-                GROUP BY wb.worker_number
-        ) aa on a.service_number = aa.worker_number
+        join user aa on a.service_number = aa.worker_number AND aa.apply_type = 'WORKER'
         join settle_daily_bank_account b  on  aa.id_card = b.idcard
         join settle_daily_import_summary_item c  on a.id  = c.issue_salary_id
        <where>
@@ -178,20 +139,7 @@
             1 'issueStatus'
         from
             settle_daily_import_summary_item c
-        join (
-            SELECT
-                u.id_card,
-                wb.worker_number,
-                u.nick_name
-            FROM
-                user u, websit_user wb
-            WHERE
-                u.company_wechat_id = wb.company_wechat_id
-                AND u.user_id = wb.user_id
-                AND u.apply_type = 'WORKER'
-                AND wb.examine_status = 'OK'
-                GROUP BY wb.worker_number
-        ) aa on c.worker_number = aa.worker_number
+        join user aa on a.service_number = aa.worker_number AND aa.apply_type = 'WORKER'
         join settle_daily_bank_account b  on  aa.id_card = b.idcard
         where
             c.summary_status != 1