diff --git a/modules/bmw/src/main/resources/mapper/SubContractor/SubContractMapper.xml b/modules/bmw/src/main/resources/mapper/SubContractor/SubContractMapper.xml
index 70a9e72..342fe86 100644
--- a/modules/bmw/src/main/resources/mapper/SubContractor/SubContractMapper.xml
+++ b/modules/bmw/src/main/resources/mapper/SubContractor/SubContractMapper.xml
@@ -87,23 +87,22 @@
-select count(1) from (
- SELECT
- bsc.id
- FROM
- bm_sub_contract bsc
- LEFT JOIN bm_subcontractor bs ON bs.id = bsc.sub_id and bs.is_active = '1'
- LEFT JOIN bm_project bp ON bp.id = bsc.pro_id and bp.is_active = '1'
- LEFT JOIN pm_organization po ON po.id = bp.company_id and po.is_active = '1'
- LEFT JOIN bm_sub_relation bsr1 on bsc.id = bsr1.sub_contract_id and bsr1.type = '1' and bsr1.is_active = '1'
- LEFT JOIN bm_sub_relation bsr2 on bsc.id = bsr2.sub_contract_id and bsr2.type = '2' and bsr2.is_active = '1'
-
- LEFT JOIN sys_user su ON su.id = bsr1.`value` and su.sub_id = bsc.sub_id and su.is_active = '1'
-
- LEFT JOIN bm_team_user_relation btur ON btur.team_id = bst.id and btur.is_active = '1' and btur.id_number is not null
-
- GROUP BY bsc.id
- )a
+ select count(1) from (
+ SELECT
+ bsc.id
+ FROM
+ bm_sub_contract bsc
+ LEFT JOIN bm_subcontractor bs ON bs.id = bsc.sub_id and bs.is_active = '1'
+ LEFT JOIN bm_project bp ON bp.id = bsc.pro_id and bp.is_active = '1'
+ LEFT JOIN pm_organization po ON po.id = bp.company_id and po.is_active = '1'
+ LEFT JOIN bm_sub_relation bsr1 on bsc.id = bsr1.sub_contract_id and bsr1.type = '1' and bsr1.is_active = '1'
+ LEFT JOIN bm_sub_relation bsr2 on bsc.id = bsr2.sub_contract_id and bsr2.type = '2' and bsr2.is_active = '1'
+ LEFT JOIN sys_user su ON su.id = bsr1.`value` and su.sub_id = bsc.sub_id and su.is_active = '1'
+ left join bm_sub_team bst on bst.sub_id = bs.id and bst.is_active = 1
+ LEFT JOIN bm_team_user_relation btur ON btur.team_id = bst.id and btur.is_active = '1' and btur.id_number is not null
+
+ GROUP BY bsc.id
+ )a
@@ -115,7 +114,6 @@ select count(1) from (
bsc.is_complete as isComplete,
bsc.contract_money as contractMoney,
su.username as principal,
-
COUNT(DISTINCT btur.id) as personNumber,
COUNT(DISTINCT bsr2.id) as fileNumber,
GROUP_CONCAT(DISTINCT bsr2.`value`) as filePaths,
@@ -130,9 +128,8 @@ select count(1) from (
LEFT JOIN pm_organization po ON po.id = bp.company_id and po.is_active = '1'
LEFT JOIN bm_sub_relation bsr1 on bsc.id = bsr1.sub_contract_id and bsr1.type = '1' and bsr1.is_active = '1'
LEFT JOIN bm_sub_relation bsr2 on bsc.id = bsr2.sub_contract_id and bsr2.type = '2' and bsr2.is_active = '1'
-
LEFT JOIN sys_user su ON su.id = bsr1.`value` and su.sub_id = bsc.sub_id and su.is_active = '1'
-
+ left join bm_sub_team bst on bst.sub_id = bs.id and bst.is_active = 1
LEFT JOIN bm_team_user_relation btur ON btur.team_id = bst.id and btur.is_active = '1' and btur.id_number is not null
LEFT JOIN bm_worker_ein_history bweh ON bweh.sub_id = bsc.sub_id AND bweh.is_active='1'
@@ -345,4 +342,4 @@ select count(1) from (
and btur.id_number is not null
-
\ No newline at end of file
+