[FrontedWebApi][運維管理] 廠商列表sql調整
This commit is contained in:
		
							parent
							
								
									671a9b84e9
								
							
						
					
					
						commit
						869951fcf4
					
				@ -107,9 +107,9 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            try
 | 
					            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<BuildingList>(sqlString, null);
 | 
					                bl = await backendRepository.GetAllAsync<BuildingList>(sqlString);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                apiResult.Code = "0000";
 | 
					                apiResult.Code = "0000";
 | 
				
			||||||
                apiResult.Data = bl;
 | 
					                apiResult.Data = bl;
 | 
				
			||||||
@ -136,10 +136,10 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            try
 | 
					            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 
 | 
					                                   from building b 
 | 
				
			||||||
                                   where deleted = 0 and area_tag = @device_area_tag
 | 
					                                   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<BuildingList>(sqlString, new { @device_area_tag = b.device_area_tag });
 | 
					                bl = await backendRepository.GetAllAsync<BuildingList>(sqlString, new { @device_area_tag = b.device_area_tag });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -224,8 +224,7 @@ namespace FrontendWebApi.ApiControllers
 | 
				
			|||||||
        /// 汇出excel (work_type: null=廠商, 1=保養, 2=維修)
 | 
					        /// 汇出excel (work_type: null=廠商, 1=保養, 2=維修)
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        [HttpPost]
 | 
					        public FileResult OpeExportExcel([FromQuery] byte? work_type)
 | 
				
			||||||
        public FileResult OpeExportExcel([FromBody] byte? work_type)
 | 
					 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var workbook = new XSSFWorkbook();
 | 
					            var workbook = new XSSFWorkbook();
 | 
				
			||||||
            #region excel設定
 | 
					            #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
 | 
					                                    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;
 | 
					                                    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<Operation_Firm>(sqlString, param);
 | 
					                    opList = await backendRepository.GetAllAsync<Operation_Firm>(sqlString, param);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user