left join plm_routing_component b on a.site = b.site and a.orderRef6 = convert(varchar(20), b.operation_id)
left join plm_routing_component b on a.site = b.site and a.orderRef6 = convert(varchar(20), b.operation_id)
left join plm_project_info f on a.site = f.site and a.orderRef1 = f.project_id
left join plm_project_info f on a.site = f.site and a.orderRef1 = f.project_id
left join plm_customer_part_info g on a.site = g.site and f.customer_id = g.customer_no and a.orderRef2 = g.part_no
left join plm_customer_part_info g on a.site = g.site and f.customer_id = g.customer_no and a.orderRef2 = g.part_no
left join view_Project_Part h on b.site = h.site and (case when h.final_part_no is null then h.test_part_no else h.final_part_no end ) = a.orderRef2 and a.orderRef1 = h.project_id
left join view_Project_Part h on a.site = h.site and h.test_part_no = a.orderRef2 and a.orderRef1 = h.project_id
left join plm_project_tool_applyHeader j on a.site = j.site and a.apply_no = j.apply_no
left join plm_project_tool_applyHeader j on a.site = j.site and a.apply_no = j.apply_no
left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '106002'
left join plm_request_header as prh on a.site = prh.site and prh.menu_id = '106002'
left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and prh.workflow_id = d.workflow_id and j.step_id = d.step_id
left join plm_request_node as d on a.site = d.site and prh.classification_no = d.classification_no and prh.workflow_id = d.workflow_id and j.step_id = d.step_id