From 471c867c1368788f8a3d011c786b55e2d7f0c2fa Mon Sep 17 00:00:00 2001 From: bonus <1203338439@qq.com> Date: Mon, 22 Sep 2025 13:56:16 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E8=B4=B9=E7=94=A8?= =?UTF-8?q?=E4=B8=BA0=E7=9A=84=E6=95=B0=E6=8D=AE=E4=B8=8D=E5=B1=95?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/material/settlement/SltAgreementInfoMapper.xml | 2 ++ 1 file changed, 2 insertions(+) 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 44b628a1..d385c21f 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 @@ -367,6 +367,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{task.taskId} + having costs > 0 SELECT mt.type_id as typeId, - SUM( CASE WHEN sai.agreement_id = #{agreementId} AND sai.STATUS = '0' THEN sai.num ELSE 0 END ) AS useNum + SUM(sai.num) AS useNum FROM ma_type mt LEFT JOIN clz_slt_agreement_info sai ON mt.type_id = sai.type_id WHERE - mt.type_id IN + sai.STATUS = '0' + AND mt.type_id IN #{typeId} - AND EXISTS ( SELECT 1 FROM clz_slt_agreement_info sai2 WHERE sai2.type_id = mt.type_id AND sai2.agreement_id = #{agreementId} - AND sai2.STATUS = '0' and sai2.num > 0) + AND sai.agreement_id in + + #{id} + GROUP BY mt.type_id + HAVING + useNum > 0 - + - + insert into bm_agreement_info (agreement_code, sign_time, unit_id, project_unit_id, project_id, create_by, lease_day, @@ -140,7 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from bm_agreement_info where agreement_id in + delete from bm_agreement_info where agreement_id in #{agreementId} @@ -195,9 +195,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" WHERE unit_id = #{unitId} and project_id = #{projectId} + limit 1 - \ No newline at end of file + diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialBackInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialBackInfoMapper.xml index ef9201e0..3774c23e 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialBackInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialBackInfoMapper.xml @@ -729,7 +729,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id and mt1.del_flag = '0' LEFT JOIN clz_lease_apply_info clai ON sai.lease_id = clai.id WHERE - sai.STATUS = '0' and sai.agreement_id = #{agreementId} + sai.STATUS = '0' + + + and sai.agreement_id in + + #{item} + + + GROUP BY mt.type_id @@ -851,4 +859,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - \ No newline at end of file +