Closed GoogleCodeExporter closed 8 years ago
Original comment by juanga...@gmail.com
on 31 May 2011 at 1:11
select FechaCorrespondiente as FECHA, emp.NroEmpleado as NroFuncionario, CAST(
concat_ws(' ', emp.Apellido, emp.Nombre) as CHAR) as FUNCIONARIO,
'ESCALAFON',CAST(if(hge.Descanso=0,concat(NumeroCliente,'-',
NumeroServicio),'Descanso') as CHAR) as OBSERVACION from Empleados emp,
horasgeneradasescalafon hge where hge.FechaCorrespondiente='FECHASOLA' and
hge.NroEmpleado=emp.NroEmpleado
UNION DISTINCT
select 'FECHASOLA' as FECHA, emp.NroEmpleado as NroFuncionario, CAST(
concat_ws(' ', emp.Apellido, emp.Nombre) as CHAR) as FUNCIONARIO, 'HISTORIAL
FUNCIONARIO', CAST(concat(ehe.FechaInicio,' a ',ehe.FechaFin,': ',
ehe.Descripcion) as CHAR) as OBSERVACION from Empleados emp,
EventosHistorialEmpleado ehe, TiposEventoHistorial teh where
ehe.IdEmpleado=emp.NroEmpleado and ehe.IdTipoEvento = teh.IdTipoEventoHistorial
and ( ehe.FechaInicio <= 'FECHASOLA' and ehe.FechaFin >= 'FECHASOLA')
UNION DISTINCT
select FechaCorresponde as FECHA, emp.NroEmpleado as NroFuncionario, CAST(
concat_ws(' ', emp.Apellido, emp.Nombre) as CHAR) as FUNCIONARIO, 'MOTIVO
CAMBIO DIARIO', CAST(mcd.Observaciones as CHAR) as OBSERVACION from Empleados
emp, motivoscambiosdiarios mcd where mcd.FechaCorresponde='FECHASOLA' and
mcd.NroEmpleado=emp.NroEmpleado
ORDER BY 1,2,3,4
Original comment by juanga...@gmail.com
on 31 May 2011 at 1:51
INSERT INTO CONSULTASEMPLEADOS VALUES (0,"ACTIVIDAD DE TODOS LOS FUNCIONARIOS
EN UN DIA","Devuelve la actividad de todos los funcionarios en un dia
dado.","SELECT CAST(FechaCorrespondiente as CHAR) as FECHA, emp.NroEmpleado as
NroFuncionario, CAST( concat_ws(' ', emp.Apellido, emp.Nombre) as CHAR) as
FUNCIONARIO, 'ESCALAFON',CAST(if(hge.Descanso=0,concat(NumeroCliente,'-',
NumeroServicio),'Descanso') as CHAR) as OBSERVACION FROM Empleados emp,
horasgeneradasescalafon hge WHERE hge.FechaCorrespondiente='FECHASOLA' AND
hge.NroEmpleado=emp.NroEmpleado UNION DISTINCT SELECT CAST('FECHASOLA' as CHAR)
as FECHA, emp.NroEmpleado as NroFuncionario, CAST( concat_ws(' ', emp.Apellido,
emp.Nombre) as CHAR) as FUNCIONARIO, 'HISTORIAL FUNCIONARIO',
CAST(concat(ehe.FechaInicio,' a ',ehe.FechaFin,': ', ehe.Descripcion) as CHAR)
as OBSERVACION FROM Empleados emp, EventosHistorialEmpleado ehe,
TiposEventoHistorial teh WHERE ehe.IdEmpleado=emp.NroEmpleado AND
ehe.IdTipoEvento = teh.IdTipoEventoHistorial AND ( ehe.FechaInicio <=
'FECHASOLA' AND ehe.FechaFin >= 'FECHASOLA') UNION DISTINCT SELECT
CAST(FechaCorresponde as CHAR) as FECHA, emp.NroEmpleado as NroFuncionario,
CAST( concat_ws(' ', emp.Apellido, emp.Nombre) as CHAR) as FUNCIONARIO, 'MOTIVO
CAMBIO DIARIO', CAST(mcd.Observaciones as CHAR) as OBSERVACION FROM Empleados
emp, motivoscambiosdiarios mcd WHERE mcd.FechaCorresponde='FECHASOLA' AND
mcd.NroEmpleado=emp.NroEmpleado ORDER BY 1,2,3",1);
Original comment by juanga...@gmail.com
on 31 May 2011 at 3:30
Original comment by juanga...@gmail.com
on 31 May 2011 at 3:30
Original issue reported on code.google.com by
juanga...@gmail.com
on 21 May 2011 at 2:28