SELECT p.id, p.obras, p.luz, p.consulta_compañia, p.llaves, p.vacaciones, p.otro_momento, p.fe_reprogramacion,
       CASE
           WHEN p.obras = 1 THEN (
               SELECT mr.orign_id FROM motivo_reprogramaciones mr WHERE mr.id = 2
           )
           WHEN p.luz = 0 THEN (
               SELECT mr.orign_id FROM motivo_reprogramaciones mr WHERE mr.id = 3
           )
           WHEN p.consulta_compañia = 1 THEN (
               SELECT mr.orign_id FROM motivo_reprogramaciones mr WHERE mr.id = 7
           )
           WHEN p.llaves = 0 THEN (
               SELECT mr.orign_id FROM motivo_reprogramaciones mr WHERE mr.id = 5
           )
           WHEN p.vacaciones = 1 THEN (
               SELECT mr.orign_id FROM motivo_reprogramaciones mr WHERE mr.id = 8
           )
           WHEN p.otro_momento = 1 THEN (
               SELECT mr.orign_id FROM motivo_reprogramaciones mr WHERE mr.id = 1
           )
           ELSE NULL
           END AS id_orign_reprogramacion
FROM preventas p
WHERE 1