From ba3470bc26a30d4d52a40aa0229abcce460011f7 Mon Sep 17 00:00:00 2001 From: syruan <15555146157@163.com> Date: Sat, 27 Sep 2025 10:21:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9F=A5=E8=AF=A2=E6=9C=AA?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BB=B4=E4=BF=AE=E5=8D=95=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BC=98=E5=8C=96=E7=9B=B8=E5=85=B3?= =?UTF-8?q?SQL=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/SltAgreementInfoMapper.java | 4 ++ .../settlement/SltAgreementInfoMapper.xml | 41 +++++++++---------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java index c32a643c..835985e5 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java @@ -307,5 +307,9 @@ public interface SltAgreementInfoMapper { */ List selectPeriodCostListForCharge(PeriodCostQueryDto queryDto); + /** + * 查询某个协议未完成的维修单列表 + * @param bean 协议ID + */ List getRepairCodeList(SltAgreementInfo bean); } 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 f862fd5e..674a9144 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 @@ -1370,27 +1370,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" tt.task_id as taskId, tt.code as repairCode, tt.task_type as taskType, - sdd.dict_label as repairStatus - - from tm_task tt - left join tm_task_agreement tta on tta.task_id = tt.task_id - left join sys_dict_data sdd on sdd.dict_value = tt.task_status and sdd.dict_type = 'repair_task_status' - where tta.agreement_id = #{agreementId} and tt.task_type = 4 and tt.task_status != 1 - - and tt.task_id not in ( select - tt.task_id as taskId - - from tm_task tt - left join tm_task_agreement tta on tta.task_id = tt.task_id - LEFT JOIN repair_apply_details rad on tt.task_id = rad.task_id and is_ds =1 - where tta.agreement_id = #{agreementId} and tt.task_type = 4 and tt.task_status != 1 - AND IFNULL(rad.repaired_num,0) > 0 - ) - - - - and tt.code like concat('%', #{repairCode}, '%') - + sdd.dict_label as repairStatus + from + tm_task tt + left join tm_task_agreement tta on tta.task_id = tt.task_id + left join sys_dict_data sdd on sdd.dict_value = tt.task_status and sdd.dict_type = 'repair_task_status' + where + tta.agreement_id = #{agreementId} and tt.task_type = 4 and tt.task_status != 1 + and tt.task_id not in ( + select + tt.task_id as taskId + from tm_task tt + left join tm_task_agreement tta on tta.task_id = tt.task_id + left join repair_apply_details rad on tt.task_id = rad.task_id and is_ds =1 + where + tta.agreement_id = #{agreementId} and tt.task_type = 4 and tt.task_status != 1 + AND IFNULL(rad.repaired_num,0) > 0 + ) + + and tt.code like concat('%', #{repairCode}, '%') +