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) {