diff --git a/FrontendWebApi/ApiControllers/DeviceManageController.cs b/FrontendWebApi/ApiControllers/DeviceManageController.cs index f87cdc8..2a2d306 100644 --- a/FrontendWebApi/ApiControllers/DeviceManageController.cs +++ b/FrontendWebApi/ApiControllers/DeviceManageController.cs @@ -682,7 +682,13 @@ namespace FrontendWebApi.ApiControllers { foreach (var p in post) { - var d = await backendRepository.GetOneAsync($@"select * from device where deleted = 0 and device_number = @device_number and device_floor_tag = @device_floor_tag", new { @device_number = p.device_number, @device_floor_tag = p.device_floor_tag }); + var param = new { @device_area_tag = p.device_area_tag, @device_building_tag = p.device_building_tag, @device_system_tag = p.device_system_tag, @device_name_tag = p.device_name_tag, + @device_floor_tag = p.device_floor_tag }; + var d = await backendRepository.GetOneAsync($@"select * from device where deleted = 0 and select * from device + where deleted = 0 and device_area_tag = @device_area_tag and device_building_tag = @device_building_tag + and device_system_tag = @device_system_tag and device_name_tag = @device_name_tag + and device_floor_tag = ifnull(@device_floor_tag, device_floor_tag) " + , param); if (d != null) device.Add(d); } diff --git a/FrontendWebApi/Models/Build.cs b/FrontendWebApi/Models/Build.cs index 16fe41b..a434f80 100644 --- a/FrontendWebApi/Models/Build.cs +++ b/FrontendWebApi/Models/Build.cs @@ -156,6 +156,7 @@ namespace FrontendWebApi.Models public string device_master_full_name { get; set; } public string device_master_icon { get; set; } public string device_model { get; set; } + public string device_area_tag { get; set; } public string device_building_tag { get; set; } public string device_system_tag { get; set; } public string device_floor_tag { get; set; } diff --git a/FrontendWebApi/Models/Device.cs b/FrontendWebApi/Models/Device.cs index ce886dd..b73125b 100644 --- a/FrontendWebApi/Models/Device.cs +++ b/FrontendWebApi/Models/Device.cs @@ -125,6 +125,7 @@ namespace FrontendWebApi.Models { public string device_guid { get; set; } public string device_number { get; set; } + public string device_floor_tag { get; set; } public string device_coordinate_3d { get; set; } public int forge_dbid { get; set; } }