From aac9ef3f9e9741b7e81ff2ac094a809e005e44cf Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 17 Nov 2022 14:57:08 +0800 Subject: [PATCH] fix error --- FrontendWebApi/ApiControllers/DeviceManageController.cs | 4 ++-- FrontendWebApi/Models/Device.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/FrontendWebApi/ApiControllers/DeviceManageController.cs b/FrontendWebApi/ApiControllers/DeviceManageController.cs index 2c2366d..ad7739f 100644 --- a/FrontendWebApi/ApiControllers/DeviceManageController.cs +++ b/FrontendWebApi/ApiControllers/DeviceManageController.cs @@ -186,8 +186,8 @@ namespace FrontendWebApi.ApiControllers from device d left join device_kind dk on d.device_building_tag = dk.device_building_tag and d.device_system_tag = dk.device_system_tag and d.device_name_tag = dk.device_name_tag - where d.deleted = 0 and d.device_system_tag = @sub_system_tag and d.device_building_tag = @building_tag and d.device_floor_tag = ifnull(@floor_tag, d.device_floor_tag)"; - var dlParam = new { @main_system_tag = fd.main_system_tag, @building_tag = fd.building_tag, @floor_tag = fd.floor_tag }; + where d.deleted = 0 and d.device_name_tag = @sub_system_tag and d.device_building_tag = @building_tag and d.device_floor_tag = ifnull(@floor_tag, d.device_floor_tag)"; + var dlParam = new { @sub_system_tag = fd.sub_system_tag, @building_tag = fd.building_tag, @floor_tag = fd.floor_tag }; dl = await backendRepository.GetAllAsync(sqlString, dlParam); f.device_list = dl; } diff --git a/FrontendWebApi/Models/Device.cs b/FrontendWebApi/Models/Device.cs index 0a10c4b..ec8c44f 100644 --- a/FrontendWebApi/Models/Device.cs +++ b/FrontendWebApi/Models/Device.cs @@ -7,6 +7,7 @@ namespace FrontendWebApi.Models public class FindDevice { public string main_system_tag { get; set; } + public string sub_system_tag { get; set; } public string building_tag { get; set; } public string floor_tag { get; set; } public string device_guid { get; set; }