From d472a4364185022c57ce218c2f0ec174b5a9f832 Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Tue, 27 Aug 2024 16:27:29 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E9=80=80=E6=96=99=E6=8E=A5=E6=94=B6?= =?UTF-8?q?=E6=97=B6,=E6=A3=80=E6=9F=A5=E7=BB=93=E7=AE=97=E8=A1=A8?= =?UTF-8?q?=E6=8B=BF=E5=88=B0=E5=BE=85=E9=80=80=E6=96=99=E6=95=B0=E9=87=8F?= =?UTF-8?q?,=E9=98=B2=E6=AD=A2=E5=A4=9A=E9=80=80"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 76a98b70ea286318b9e1bb1de08da0b23e15bcde. --- .../mapper/app/BackReceiveMapper.xml | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackReceiveMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackReceiveMapper.xml index 477bf57b..d0bc4741 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackReceiveMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackReceiveMapper.xml @@ -715,7 +715,7 @@ bad.audit_num as preNum, bad.status as status, bad.back_status as backStatus, - COALESCE(sai.num, 0) as num, + IFNULL(bad.audit_num,0)-IFNULL(aa.back_num,0) as num, bb.finished_back_num, mt.manage_type as manageType, mt.company_id as companyId, @@ -724,19 +724,28 @@ back_apply_details bad LEFT JOIN back_apply_info bai on bai.id=bad.parent_id LEFT JOIN tm_task_agreement tta on tta.task_id=bai.task_id - LEFT JOIN (select agreement_id, COALESCE(num, 0) as num from slt_agreement_info where 'status'='0') sai on tta.agreement_id=sai.agreement_id LEFT JOIN ma_type mt on mt.type_id=bad.type_id LEFT JOIN ma_type mt2 ON mt2.type_id=mt.parent_id LEFT JOIN ( - SELECT + SELECT type_id as typeId, - SUM(IFNULL(back_num,0)) as finished_back_num - FROM + SUM(IFNULL(back_num,0)) as back_num + FROM back_check_details - WHERE - parent_id=#{id} and is_finished = 1 - GROUP BY type_id - ) bb on bb.typeId=bad.type_id + WHERE + parent_id=#{id} + GROUP BY type_id + ) aa on aa.typeId=bad.type_id + LEFT JOIN ( + SELECT + type_id as typeId, + SUM(IFNULL(back_num,0)) as finished_back_num + FROM + back_check_details + WHERE + parent_id=#{id} and is_finished = 1 + GROUP BY type_id + ) bb on bb.typeId=bad.type_id WHERE bai.id=#{id}