From 3e149a2cd99e4583eef979e1380af74b94ef0713 Mon Sep 17 00:00:00 2001 From: dev02 Date: Tue, 27 Dec 2022 10:10:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9api=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/DeviceManageController.cs | 8 +++++++- FrontendWebApi/Models/Build.cs | 1 + FrontendWebApi/Models/Device.cs | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) 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; } }