This commit is contained in:
張家睿 2024-02-29 14:54:31 +08:00
commit a848dac30a

View File

@ -1161,18 +1161,21 @@ namespace FrontendWebApi.ApiControllers
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") ) //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<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("_")[3]}' and device_point_name = '{device_number_point.Split("_")[5]}'"); // and device_name_tag = '{device_number_point.Split("_")[3]}' and device_point_name = '{device_number_point.Split("_")[5]}'");
} //}
else //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]}'");
} //}
station = await frontendRepository.GetOneAsync<string>($@"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 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