From 16abd9875cb2040161071636496c136965fafc10 Mon Sep 17 00:00:00 2001 From: cwchen <1048842385@qq.com> Date: Tue, 26 Mar 2024 20:55:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/DeviceBdMapper.xml | 18 ++++++++++-------- .../main/resources/mapper/base/ProMapper.xml | 9 ++++++--- .../mapper/base/ProScheduleMapper.xml | 1 + .../resources/mapper/base/SelectMapper.xml | 2 ++ 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/DeviceBdMapper.xml b/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/DeviceBdMapper.xml index 2f07234..3f66351 100644 --- a/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/DeviceBdMapper.xml +++ b/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/DeviceBdMapper.xml @@ -100,11 +100,11 @@ - DELETE FROM tb_pro_bd WHERE id = #{id} + UPDATE tb_pro_bd SET del_flag = 0 WHERE id = #{id} - DELETE FROM tb_bd_device WHERE device_id = #{id} + UPDATE tb_bd_device SET del_flage = 1 WHERE device_id = #{id} @@ -123,9 +123,10 @@ FROM tb_pro_bd tpb LEFT JOIN sys_dict sd ON sd.dict_code = tpb.bd_type LEFT JOIN sys_dict sd2 ON sd2.dict_code = tpb.type_code - LEFT JOIN tb_project tp ON tp.bid_code = tpb.bid_code + LEFT JOIN tb_project tp ON tp.bid_code = tpb.bid_code AND tp.del_flag = 0 LEFT JOIN t_pro_gt tpg ON tpg.gt_id = tpb.gt_id + tpb.del_flag = 0 AND ( INSTR(tpb.bd_name,#{keyWord}) > 0 OR @@ -139,10 +140,10 @@ @@ -160,7 +161,7 @@ - SELECT COUNT(*) FROM tb_bd_device tbd WHERE device_code = #{deviceCode} + SELECT COUNT(*) FROM tb_bd_device tbd WHERE device_code = #{deviceCode} AND del_flage = 0 - SELECT COUNT(*) FROM tb_bd_device tbd WHERE device_code = #{deviceCode} AND device_id != #{deviceId} + SELECT COUNT(*) FROM tb_bd_device tbd WHERE device_code = #{deviceCode} AND device_id != #{deviceId} AND tbd.del_flage = 0 diff --git a/securitycontrol-model/securitycontrol-system/src/main/resources/mapper/base/ProMapper.xml b/securitycontrol-model/securitycontrol-system/src/main/resources/mapper/base/ProMapper.xml index 5c99b8a..ae0025b 100644 --- a/securitycontrol-model/securitycontrol-system/src/main/resources/mapper/base/ProMapper.xml +++ b/securitycontrol-model/securitycontrol-system/src/main/resources/mapper/base/ProMapper.xml @@ -26,6 +26,7 @@ start_time, end_time, org, + del_flag, #{proId}, @@ -48,6 +49,7 @@ #{startTime}, #{endTime}, #{org}, + 0, @@ -156,7 +158,7 @@ - DELETE FROM tb_project WHERE pro_id = #{proId} + UPDATE tb_project SET del_flag = 1 WHERE pro_id = #{proId} @@ -194,6 +196,7 @@ FROM tb_project tp LEFT JOIN sys_build sb ON tp.org = sb.org_id + tp.del_flag = 0 AND ( INSTR(tp.pro_name,#{keyWord}) > 0 OR @@ -298,10 +301,10 @@ diff --git a/securitycontrol-model/securitycontrol-system/src/main/resources/mapper/base/ProScheduleMapper.xml b/securitycontrol-model/securitycontrol-system/src/main/resources/mapper/base/ProScheduleMapper.xml index 4c92b37..b621d53 100644 --- a/securitycontrol-model/securitycontrol-system/src/main/resources/mapper/base/ProScheduleMapper.xml +++ b/securitycontrol-model/securitycontrol-system/src/main/resources/mapper/base/ProScheduleMapper.xml @@ -64,6 +64,7 @@ FROM tb_project tp LEFT JOIN sys_build sb ON tp.org = sb.org_id + tp.del_flag = 0 AND ( INSTR(tp.pro_name,#{keyWord}) > 0 OR diff --git a/securitycontrol-model/securitycontrol-system/src/main/resources/mapper/base/SelectMapper.xml b/securitycontrol-model/securitycontrol-system/src/main/resources/mapper/base/SelectMapper.xml index ddf934b..78f25b1 100644 --- a/securitycontrol-model/securitycontrol-system/src/main/resources/mapper/base/SelectMapper.xml +++ b/securitycontrol-model/securitycontrol-system/src/main/resources/mapper/base/SelectMapper.xml @@ -86,6 +86,7 @@ pro_name AS name, pro_type AS proType FROM tb_project + WHERE del_flag = 0