From 80a9e2e166688276981220131be5dff3a7da9b56 Mon Sep 17 00:00:00 2001 From: itcast Date: Tue, 3 Feb 2026 18:00:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=BD=E5=B7=A5=E4=BA=BA=E5=91=98=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=9F=A5=E8=AF=A2=E4=B8=8D=E5=8C=85=E5=90=AB=E4=B8=B4?= =?UTF-8?q?=E6=97=B6=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../person/PersonComprehensiveMapper.xml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/bmw/src/main/resources/mapper/person/PersonComprehensiveMapper.xml b/modules/bmw/src/main/resources/mapper/person/PersonComprehensiveMapper.xml index 84dbb19..e2a1076 100644 --- a/modules/bmw/src/main/resources/mapper/person/PersonComprehensiveMapper.xml +++ b/modules/bmw/src/main/resources/mapper/person/PersonComprehensiveMapper.xml @@ -803,9 +803,10 @@ LEFT JOIN bm_project bp ON bp.project_general_id = bpg.id AND bp.is_active = '1' LEFT JOIN ( - SELECT project_id, id_number, ein_time, IS_ACTIVE - FROM bm_worker_ein_history - WHERE IS_ACTIVE IN ('0', '1') + SELECT a.project_id, a.id_number, a.ein_time, a.IS_ACTIVE + FROM bm_worker_ein_history a + left join bm_worker b on a.id_number = b.id_number + WHERE a.IS_ACTIVE IN ('0', '1') and b.worker_type != '0' ) weh ON weh.project_id = bp.id -- LEFT JOIN -- bm_worker_ein_history bweh1 ON bweh1.project_id = bp.id AND bweh1.IS_ACTIVE = '1' @@ -890,7 +891,7 @@ GROUP BY id_number ) latest ON bweh.id_number = latest.id_number AND bweh.ein_time = latest.latest_ein_time WHERE bweh.project_id = #{ params.proId} - ) latest ON bw.id_number = latest.id_number + ) latest ON bw.id_number = latest.id_number and bw.worker_type != '0' LEFT JOIN bm_worker_contract bwc ON bwc.idCard = bw.id_number AND bwc.is_active = '1' LEFT JOIN bm_worker_bank bwb ON bwb.ID_NUMBER = bw.id_number LEFT JOIN t_dict td ON td.id = bw.post_id AND td.is_active = '1' @@ -1300,7 +1301,7 @@ GROUP BY id_number ) latest ON bweh.id_number = latest.id_number AND bweh.ein_time = latest.latest_ein_time WHERE bweh.project_id = #{ params.proId} - ) latest ON bw.id_number = latest.id_number + ) latest ON bw.id_number = latest.id_number and bw.worker_type != '0' LEFT JOIN bm_worker_contract bwc ON bwc.idCard = bw.id_number AND bwc.is_active = '1' LEFT JOIN bm_worker_bank bwb ON bwb.ID_NUMBER = bw.id_number LEFT JOIN t_dict td ON td.id = bw.post_id AND td.is_active = '1' @@ -1522,9 +1523,10 @@ LEFT JOIN bm_project bp ON bp.project_general_id = bpg.id AND bp.is_active = '1' LEFT JOIN ( - SELECT project_id, id_number, ein_time, IS_ACTIVE - FROM bm_worker_ein_history - WHERE IS_ACTIVE IN ('0', '1') + SELECT a.project_id, a.id_number, a.ein_time, a.IS_ACTIVE + FROM bm_worker_ein_history a + left join bm_worker b on a.id_number = b.id_number + WHERE a.IS_ACTIVE IN ('0', '1') and b.worker_type != '0' ) weh ON weh.project_id = bp.id -- LEFT JOIN -- bm_worker_ein_history bweh1 ON bweh1.project_id = bp.id AND bweh1.IS_ACTIVE = '1'