[後端] 修改station獲取問題, 修改device獲取islink問題
This commit is contained in:
parent
9f75864955
commit
2f64f48882
@ -493,7 +493,7 @@ namespace FrontendWebApi.ApiControllers
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
List<string> wheres = new List<string>();
|
List<string> wheres = new List<string>();
|
||||||
wheres.Add("d.deleted = 0");
|
wheres.Add("d.deleted = 0 and d.is_link = 1");
|
||||||
if (postDevice.SelectBuildings != null && postDevice.SelectBuildings.Count() > 0)
|
if (postDevice.SelectBuildings != null && postDevice.SelectBuildings.Count() > 0)
|
||||||
{
|
{
|
||||||
wheres.Add("d.device_building_tag in @builds");
|
wheres.Add("d.device_building_tag in @builds");
|
||||||
@ -525,7 +525,8 @@ namespace FrontendWebApi.ApiControllers
|
|||||||
a.device_number
|
a.device_number
|
||||||
from (SELECT *
|
from (SELECT *
|
||||||
FROM device d
|
FROM device d
|
||||||
WHERE {wheres_str}) a
|
WHERE {wheres_str}
|
||||||
|
) a
|
||||||
join building b on b.building_tag = a.device_building_tag
|
join building b on b.building_tag = a.device_building_tag
|
||||||
join variable v1 on v1.system_value = a.device_system_tag and v1.deleted = 0 and v1.system_type = 'device_system_category_layer2'
|
join variable v1 on v1.system_value = a.device_system_tag and v1.deleted = 0 and v1.system_type = 'device_system_category_layer2'
|
||||||
join variable v2 on v2.system_value = a.device_name_tag and v2.deleted = 0 and v2.system_type = 'device_system_category_layer3'
|
join variable v2 on v2.system_value = a.device_name_tag and v2.deleted = 0 and v2.system_type = 'device_system_category_layer3'
|
||||||
@ -1158,9 +1159,21 @@ namespace FrontendWebApi.ApiControllers
|
|||||||
var device_number_point = historyItem.Device_number_point.Replace(":", "_");
|
var device_number_point = historyItem.Device_number_point.Replace(":", "_");
|
||||||
|
|
||||||
if (tagQuantity.Equals("5"))
|
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") ||
|
||||||
|
device_number_point.Split("_")[1].Equals("FM") || device_number_point.Split("_")[1].Equals("APS") || device_number_point.Split("_")[1].Equals("VICL"))
|
||||||
|
{
|
||||||
|
station = await frontendRepository.GetOneAsync<string>($@"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<string>($@"select parent_path from import_niagara_item_history
|
station = await frontendRepository.GetOneAsync<string>($@"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]}'
|
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]}'");
|
and device_name_tag = '{device_number_point.Split("_")[1]}' and device_point_name = '{device_number_point.Split("_")[5]}'");
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
station = frontendRepository.GetOneAsync<string>($@"select parent_path from import_niagara_item_history
|
station = frontendRepository.GetOneAsync<string>($@"select parent_path from import_niagara_item_history
|
||||||
where device_building_tag = '{device_number_point.Split("_")[1].Replace("$3", "")}' and
|
where device_building_tag = '{device_number_point.Split("_")[1].Replace("$3", "")}' and
|
||||||
|
Loading…
Reference in New Issue
Block a user