From 07b5ee41a26bd479e11f09d0be78041f0cdb2a71 Mon Sep 17 00:00:00 2001 From: dev02 Date: Tue, 12 Mar 2024 12:26:29 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E9=87=9D=E5=B0=8Dcctv?= =?UTF-8?q?=E9=A1=9E=E5=88=A5=E5=81=9A=E8=99=95=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Backend/Controllers/DeviceManageController.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Backend/Controllers/DeviceManageController.cs b/Backend/Controllers/DeviceManageController.cs index 3692b43..0511da2 100644 --- a/Backend/Controllers/DeviceManageController.cs +++ b/Backend/Controllers/DeviceManageController.cs @@ -211,7 +211,15 @@ namespace Backend.Controllers JOIN variable mv ON d.device_system_tag = mv.system_value AND mv.system_type = @main_system_type and mv.deleted = 0 JOIN variable sv ON d.device_name_tag = sv.system_value AND sv.system_type = @sub_system_type and sv.deleted = 0 JOIN floor f ON d.device_floor_tag = f.full_name AND d.device_building_tag = f.building_tag and f.deleted = 0 - LEFT JOIN device_kind dk ON dk.device_building_tag = d.device_building_tag AND dk.device_system_tag = d.device_system_tag AND dk.device_name_tag = d.device_name_tag and dk.is_link = 1 + LEFT JOIN device_kind dk ON + dk.device_building_tag = d.device_building_tag + AND dk.device_system_tag = d.device_system_tag + AND dk.device_name_tag = d.device_name_tag + and dk.is_link = 1 + and ( + (dk.device_name_tag <> 'c' and dk.device_system_tag <> 's') or + (dk.device_name_tag = 'c' and dk.device_system_tag = 's' and dk.device_model_tag = d.device_model_tag) + ) ORDER BY d.priority ASC, d.device_number ASC"; var devices = await backendRepository.GetAllAsync(sql, new