SELECT * FROM
(
  SELECT wos.production_lot__work_ph AS wos_production_lot__work_ph, wpa.start_employee_id AS wpa_start_employee_id, wpa.production_lot AS wpa_production_lot, wpa.work_phase_est_id AS wpa_work_phase_est_id, wpa.type_ AS wpa_type_ FROM work_order_schedule AS wos

  FULL OUTER JOIN work_phase_actual AS wpa
  ON wos.production_lot = wpa.production_lot
  AND wos.work_phase = wpa.work_phase_est_id

  WHERE wos.production_lot__work_ph like '15044%'
  OR wpa.production_lot like '15044%'
) AS result
WHERE (wpa_type_ LIKE '%' OR wpa_type_ IS NULL)
AND (wpa_start_employee_id LIKE '%' OR wpa_start_employee_id IS NULL)
ORDER BY wos_production_lot__work_ph, wpa_start_employee_id
