From 0adecac5d89d6cfacd5438f12b0f086ad6ae3cb1 Mon Sep 17 00:00:00 2001 From: dev01 Date: Mon, 15 May 2023 15:18:43 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=BE=8C=E5=8F=B0]=E5=BE=8C=E7=AB=AF=20buildC?= =?UTF-8?q?ontroller=20getallfloor=20order=20by=20=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E8=A3=9C=E4=B8=8A=20|=20=E5=8F=96=E5=BE=97=E6=B0=B4=E9=9B=BB?= =?UTF-8?q?=E5=88=97=E8=A1=A8=20api=20=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FrontendWebApi/ApiControllers/BuildController.cs | 2 +- .../ApiControllers/HydroMeterController.cs | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/FrontendWebApi/ApiControllers/BuildController.cs b/FrontendWebApi/ApiControllers/BuildController.cs index a71651c..c751dc4 100644 --- a/FrontendWebApi/ApiControllers/BuildController.cs +++ b/FrontendWebApi/ApiControllers/BuildController.cs @@ -707,7 +707,7 @@ namespace FrontendWebApi.ApiControllers SELECT floor_guid,full_name,building_tag FROM floor - where building_tag = @building_tag and deleted = 0"; + where building_tag = @building_tag and deleted = 0 order by priority"; var floor = await backendRepository.GetAllAsync(sWhere, new { building_tag = building_tag }); apiResult.Data = floor; diff --git a/FrontendWebApi/ApiControllers/HydroMeterController.cs b/FrontendWebApi/ApiControllers/HydroMeterController.cs index 1bb4bc3..aeddb78 100644 --- a/FrontendWebApi/ApiControllers/HydroMeterController.cs +++ b/FrontendWebApi/ApiControllers/HydroMeterController.cs @@ -53,6 +53,12 @@ namespace FrontendWebApi.ApiControllers apiResult.Msg = "表單類別錯誤"; return BadRequest(apiResult); } + else if (input.floor_tag.Count == 0) + { + apiResult.Code = "0000"; + apiResult.Data = new List() { }; + return Ok(apiResult); + } try { @@ -172,6 +178,12 @@ namespace FrontendWebApi.ApiControllers apiResult.Msg = "表單類別錯誤"; return BadRequest(apiResult); } + else if (input.floor_tag.Count == 0) + { + apiResult.Code = "0000"; + apiResult.Data = new List() { }; + return Ok(apiResult); + } try { @@ -282,7 +294,7 @@ namespace FrontendWebApi.ApiControllers try { apiResult.Code = "0000"; - apiResult.Data = await backendRepository.GetOneAsync($@"select system_value from variable where system_type = {input.type}Price and deleted = 0"); + apiResult.Data = await backendRepository.GetOneAsync($@"select system_value from variable where system_type = '{input.type}Price' and deleted = 0"); } catch (Exception exception) {