From 0c662ec5d13481064f74bb0847be064446a4744c Mon Sep 17 00:00:00 2001 From: dev02 Date: Wed, 22 Nov 2023 10:22:43 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=89=8D=E5=8F=B0api=20=E9=96=83=E5=85=89=E5=96=87=E5=8F=AD?= =?UTF-8?q?=E8=99=95=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/BuildController.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/FrontendWebApi/ApiControllers/BuildController.cs b/FrontendWebApi/ApiControllers/BuildController.cs index def95f1..27818f7 100644 --- a/FrontendWebApi/ApiControllers/BuildController.cs +++ b/FrontendWebApi/ApiControllers/BuildController.cs @@ -477,6 +477,7 @@ namespace FrontendWebApi.ApiControllers var devicesql = ""; var layer3sql = ""; var sWhere = ""; + var singleSubSql = ""; if (!String.IsNullOrEmpty(post.main_system_tag)) { main_system_guidsql = $" and d.device_system_tag = '{post.main_system_tag}'"; @@ -484,9 +485,15 @@ namespace FrontendWebApi.ApiControllers if (!String.IsNullOrEmpty(post.sub_system_tag)) { if (!string.IsNullOrEmpty(projectName) && projectName.Contains("ibms_dome") && (post.main_system_tag == "S" && post.sub_system_tag == "P")) + { sub_system_guidsql = $@" and (d.device_name_tag = '{post.sub_system_tag}' or d.device_name_tag = 'B')"; + singleSubSql = $"and (di.device_name_tag = '{post.sub_system_tag}' or di.device_name_tag = 'B')"; + } else + { sub_system_guidsql = $" and d.device_name_tag = '{post.sub_system_tag}'"; + singleSubSql = $"and di.device_name_tag = '{post.sub_system_tag}'"; + } } if (!String.IsNullOrEmpty(post.device_system_category_layer3)) { @@ -592,7 +599,7 @@ namespace FrontendWebApi.ApiControllers AND di.deleted = 0 AND di.is_link = 1 AND di.is_show_riserDiagram = 1 - and di.device_name_tag = '{post.sub_system_tag}' + {(string.IsNullOrEmpty(singleSubSql) ? $"and di.device_name_tag = '{post.sub_system_tag}'" : singleSubSql)} limit 1000 ) di on di.device_name_tag = d.device_name_tag left join floor f on d.device_floor_tag = f.full_name and f.deleted = 0