INSERT INTO eirs (fecha,numero,viaje_id,consignatario_id,contenedor_id,estatus,condicion,movimiento,user_id)
(SELECT frd AS fecha, eir_in AS numero, viaje_in_id AS viaje_id, consignatario_id, contenedor_id, 'EMPTY' AS estatus,condicion_in AS condicion, 'gatein' AS movimiento, 1 AS user_id
FROM inventarios
ORDER BY id ASC)
UNION
(SELECT fdesp AS fecha, eir_out AS numero, viaje_out_id AS viaje_id, consignatario_id, contenedor_id, 'EMPTY' AS estatus,if(condicion_out IS NULL,'OPR',condicion_out) AS condicion, 'gateout' AS movimiento, 1 AS user_id
FROM inventarios
WHERE fdesp IS NOT NULL
ORDER BY id ASC)
ORDER BY fecha ASC 
