From 987bedea787d66c351cc5d3c94053ed73b333c5a Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 29 Feb 2024 09:56:57 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BE=8C=E7=AB=AF]=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=8D=B2=E5=8F=96parent=5Fpath=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApiControllers/HistoryController.cs | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/FrontendWebApi/ApiControllers/HistoryController.cs b/FrontendWebApi/ApiControllers/HistoryController.cs index cebd90d..7b535f9 100644 --- a/FrontendWebApi/ApiControllers/HistoryController.cs +++ b/FrontendWebApi/ApiControllers/HistoryController.cs @@ -1161,18 +1161,21 @@ namespace FrontendWebApi.ApiControllers if (tagQuantity.Equals("5")) { - if (device_number_point.Split("_")[1].Equals("S") || device_number_point.Split("_")[1].Equals("CWB") || device_number_point.Split("_")[1].Equals("B") ) - { - station = await frontendRepository.GetOneAsync($@"select parent_path from import_niagara_item_history - where device_building_tag = '{device_number_point.Split("_")[0]}' and device_floor_tag = '{device_number_point.Split("_")[2]}' - and device_name_tag = '{device_number_point.Split("_")[3]}' and device_point_name = '{device_number_point.Split("_")[5]}'"); - } - else - { - station = await frontendRepository.GetOneAsync($@"select parent_path from import_niagara_item_history - where device_building_tag = '{device_number_point.Split("_")[0]}' and device_floor_tag = '{device_number_point.Split("_")[2]}' - and device_name_tag = '{device_number_point.Split("_")[1]}' and device_point_name = '{device_number_point.Split("_")[5]}'"); - } + //if (device_number_point.Split("_")[1].Equals("S") || device_number_point.Split("_")[1].Equals("CWB") || device_number_point.Split("_")[1].Equals("B") ) + //{ + // station = await frontendRepository.GetOneAsync($@"select parent_path from import_niagara_item_history + // where device_building_tag = '{device_number_point.Split("_")[0]}' and device_floor_tag = '{device_number_point.Split("_")[2]}' + // and device_name_tag = '{device_number_point.Split("_")[3]}' and device_point_name = '{device_number_point.Split("_")[5]}'"); + //} + //else + //{ + // station = await frontendRepository.GetOneAsync($@"select parent_path from import_niagara_item_history + // where device_building_tag = '{device_number_point.Split("_")[0]}' and device_floor_tag = '{device_number_point.Split("_")[2]}' + // and device_name_tag = '{device_number_point.Split("_")[1]}' and device_point_name = '{device_number_point.Split("_")[5]}'"); + //} + + station = await frontendRepository.GetOneAsync($@"select distinct parent_path from import_niagara_item_history + where device_building_tag = '{device_number_point.Split("_")[0].Replace("$3", "")}' and (parent_path != '' or parent_path is not null) limit 1;"); } else station = frontendRepository.GetOneAsync($@"select parent_path from import_niagara_item_history