diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml index 91db9bc0..d36ec62b 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml @@ -225,7 +225,7 @@ SELECT bai.agreement_id as agreementId, bai.agreement_code as agreementCode, bai.is_slt as isSlt, bui.unit_id as unitId, bui.unit_name as unitName, bp.pro_id as projectId , bp.pro_name as projectName, - saa.remark, bai.protocol, saa.cost as costs, + bai.protocol, case when (saa.id is null or saa.status = '0') then '0' when saa.status = '1' then '1' @@ -960,16 +960,10 @@ bui.unit_name as unitName, bai.project_id as projectId, bp.pro_name as projectName, - saa.remark, + bai.protocol, - saa.cost as costs, - CASE - WHEN saa.id IS NULL OR saa.status = '0' THEN '0' - WHEN saa.status = '1' THEN '1' - WHEN saa.status = '2' THEN '2' - WHEN saa.status = '3' THEN '3' - ELSE '0' - END as sltStatus, + SUM(IFNULL(saa.`status`,0)) as num, + sai.is_slt as sltStatus, CASE WHEN bp.actual_end_date is not null THEN '1' ELSE '0' @@ -979,9 +973,11 @@ INNER JOIN bm_unit bui ON bui.unit_id = bai.unit_id AND bui.type_id != '1731' LEFT JOIN bm_project bp ON bp.pro_id = bai.project_id LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit - LEFT JOIN slt_agreement_apply saa ON saa.agreement_id = bai.agreement_id AND (saa.status IS NULL OR saa.status != '2') + LEFT JOIN slt_agreement_apply saa on bai.agreement_id = saa.agreement_id AND saa.settlement_type =1 + LEFT JOIN slt_agreement_info sai on bai.agreement_id = sai.agreement_id WHERE bai.status = '1' - AND (bai.is_slt = '0' OR bai.is_slt IS NULL) + AND sai.is_slt = 0 + AND bai.unit_id IN @@ -1009,6 +1005,8 @@ AND bp.actual_end_date is null + GROUP BY bai.agreement_id + HAVING num = 0 ORDER BY bai.create_time DESC @@ -1712,12 +1710,15 @@