From 21a17b9067069a3d3dc82d92c991efdd79f53dd3 Mon Sep 17 00:00:00 2001 From: dev01 Date: Sat, 12 Nov 2022 12:04:36 +0800 Subject: [PATCH] =?UTF-8?q?[ForntedWebApi][=E9=81=8B=E7=B6=AD=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=20API=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/OperationController.cs | 12 ++++++------ FrontendWebApi/Models/Operation.cs | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/FrontendWebApi/ApiControllers/OperationController.cs b/FrontendWebApi/ApiControllers/OperationController.cs index 4672c78..d308b43 100644 --- a/FrontendWebApi/ApiControllers/OperationController.cs +++ b/FrontendWebApi/ApiControllers/OperationController.cs @@ -140,7 +140,7 @@ namespace FrontendWebApi.ApiControllers from device d join building b on d.device_building_tag = b.building_tag where d.deleted = 0 and d.device_area_tag = @device_area_tag - group by b.building_name, d.device_building_tag"; + group by b.full_name, d.device_building_tag"; bl = await backendRepository.GetAllAsync(sqlString, new { @device_area_tag = b.device_area_tag }); @@ -675,11 +675,11 @@ namespace FrontendWebApi.ApiControllers sWhere += $@" and (of.device_system_category_layer2 = ifnull(@main_system_tag, device_system_category_layer2) AND of.device_system_category_layer3 = ifnull(@sub_system_tag, device_system_category_layer3))"; } - var sqlString = @$"select of.*, v2.system_key - from operation_firm of - left join variable v1 on of.device_system_category_layer2 = v1.system_value and v1.system_type = @main_system_type and v1.delted = 0 - left join variable v2 on v1.id = v2.system_parent_id and of.device_system_category_layer3 = v2.system_value and v2.system_type = @sub_system_type and v2.deleted = 0 - where of.deleted = 0" + sWhere; + var sqlString = @$"select ofi.*, v2.system_key + from operation_firm ofi + left join variable v1 on ofi.device_system_category_layer2 = v1.system_value and v1.system_type = @main_system_type and v1.deleted = 0 + left join variable v2 on v1.id = v2.system_parent_id and ofi.device_system_category_layer3 = v2.system_value and v2.system_type = @sub_system_type and v2.deleted = 0 + where ofi.deleted = 0" + sWhere; var param = new { @sub_system_type = sub_system_type, @start_created_at = ofl.start_created_at, @end_created_at = ofl.end_created_at, @sub_system_tag = ofl.sub_system_tag, @main_system_tag = ofl.main_system_tag }; diff --git a/FrontendWebApi/Models/Operation.cs b/FrontendWebApi/Models/Operation.cs index 09833fa..12fbcf3 100644 --- a/FrontendWebApi/Models/Operation.cs +++ b/FrontendWebApi/Models/Operation.cs @@ -50,6 +50,7 @@ namespace FrontendWebApi.Models public class BuildingList { + public string device_area_tag { get; set; } public string device_building_tag { get; set; } public string device_floor_tag { get; set; } public string full_name { get; set; }