diff --git a/FrontendWebApi/ApiControllers/OperationController.cs b/FrontendWebApi/ApiControllers/OperationController.cs index db61951..2aeda4f 100644 --- a/FrontendWebApi/ApiControllers/OperationController.cs +++ b/FrontendWebApi/ApiControllers/OperationController.cs @@ -925,10 +925,12 @@ namespace FrontendWebApi.ApiControllers sWhere += $@" and opr.formId like '%@formId%'"; } - var sqlString = $@"select opr.*, concat(d.device_floor_tag, ' ', d.device_last_name, ' ', d.device_serial_tag) as device_name, ui.full_name as user_full_name + var sqlString = $@"select opr.* , concat(d.device_floor_tag, ' ', d.device_last_name, ' ', d.device_serial_tag) as device_name, ui.full_name as user_full_name from operation_record opr - left join device d on opr.fix_do_code = d.device_number - left join userinfo ui on opr.work_person_id = ui.userinfo_guid + left join device d on opr.fix_do_code = d.device_number and d.deleted = 0 and d.device_area_tag = SUBSTRING_INDEX(opr.fix_do_code, '_', 1) + and d.device_building_tag = SUBSTRING_INDEX(opr.fix_do_code, '_', 2) and d.device_floor_tag = SUBSTRING_INDEX(opr.fix_do_code, '_', 5) + and d.device_system_tag = opr.device_system_category_layer2 and d.device_name_tag = opr.device_system_category_layer3 + left join userinfo ui on opr.work_person_id = ui.userinfo_guid and ui.deleted = 0 where opr.deleted = 0 and opr.work_type = @work_type" + sWhere; var param = new { @work_type = ofl.work_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, @formId = ofl.serial_number };