diff --git a/FrontendWebApi/ApiControllers/OperationController.cs b/FrontendWebApi/ApiControllers/OperationController.cs index ea4ae71..028d8ce 100644 --- a/FrontendWebApi/ApiControllers/OperationController.cs +++ b/FrontendWebApi/ApiControllers/OperationController.cs @@ -107,9 +107,9 @@ namespace FrontendWebApi.ApiControllers try { - var sqlString = @$"select system_value as device_area_tag, system_key as area_name from variable where system_type = 'area' and deleted = 0"; + var sqlString = $@"select system_value as device_area_tag, system_key as area_name from variable where system_type = 'area' and deleted = 0"; - bl = await backendRepository.GetAllAsync(sqlString, null); + bl = await backendRepository.GetAllAsync(sqlString); apiResult.Code = "0000"; apiResult.Data = bl; @@ -136,10 +136,10 @@ namespace FrontendWebApi.ApiControllers try { - var sqlString = @$"select d.device_building_tag, b.full_name as building_name + var sqlString = @$"select b.building_tag, b.full_name as building_name from building b where deleted = 0 and area_tag = @device_area_tag - group by b.full_name, d.device_building_tag"; + group by b.full_name, b.building_tag"; bl = await backendRepository.GetAllAsync(sqlString, new { @device_area_tag = b.device_area_tag }); @@ -224,8 +224,7 @@ namespace FrontendWebApi.ApiControllers /// 汇出excel (work_type: null=廠商, 1=保養, 2=維修) /// /// - [HttpPost] - public FileResult OpeExportExcel([FromBody] byte? work_type) + public FileResult OpeExportExcel([FromQuery] byte? work_type) { var workbook = new XSSFWorkbook(); #region excel設定 @@ -680,7 +679,7 @@ namespace FrontendWebApi.ApiControllers 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 }; + var param = new { @main_system_type = main_system_type, @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 }; opList = await backendRepository.GetAllAsync(sqlString, param); } else