Closed GoogleCodeExporter closed 8 years ago
Consulta que resuelve el pedido:
select FechaCorrespondiente as Fecha, CAST( concat_ws(',',emp.NroEmpleado,
emp.Apellido, emp.Nombre) as CHAR) as empleado,
CAST(if(hge.Descanso=0,concat(NumeroCliente,'-', NumeroServicio),'Descanso') as
CHAR) as observacion from horasgeneradasescalafon hge, empleados emp where
hge.FechaCorrespondiente between 'FECHADESDE' and 'FECHAHASTA' and
hge.NroEmpleado=NROEMPLEADO and hge.NroEmpleado=emp.NroEmpleado UNION select
FechaInicio as Fecha, CAST(concat_ws(' ',emp.NroEmpleado, emp.Apellido,
emp.Nombre) as CHAR) as empleado, CAST(concat(ehe.FechaInicio,' a
',ehe.FechaFin,': ', ehe.Descripcion) as CHAR) as observacion from
EventosHistorialEmpleado ehe, Empleados emp, TiposEventoHistorial teh where
ehe.IdEmpleado=emp.NroEmpleado and ehe.IdTipoEvento = teh.IdTipoEventoHistorial
and ( ehe.FechaInicio <= 'FECHAHASTA' and ehe.FechaFin >= 'FECHADESDE') and
IdEmpleado=NROEMPLEADO UNION select FechaCorresponde as Fecha, CAST(concat_ws('
',emp.NroEmpleado, emp.Apellido, emp.Nombre) as CHAR) as empleado,
CAST(mcd.Observaciones as CHAR) as observacion from motivoscambiosdiarios mcd,
empleados emp where mcd.FechaCorresponde between 'FECHADESDE' and 'FECHAHASTA'
and mcd.NroEmpleado=NROEMPLEADO and mcd.NroEmpleado=emp.NroEmpleado ORDER BY 1
1:30 hs
Original comment by juanga...@gmail.com
on 30 May 2011 at 5:30
Se agrega control de que no haya ningun funcionario Activo no Asignado.
Para esto se crea la operacion int
obtenerCantidadFuncionariosActivosSinAsignar(DateTime Fecha) en
ControladorDatos.
Ademas, se cambia la consultaclientes de ID 7, Personal Activo sin asignar para
una fecha dada.
Se agrega el he.TipoDia != 1, ya que sino cuenta los tipos EnOtroServicio como
un dia de labor.
Original comment by juanga...@gmail.com
on 30 May 2011 at 10:55
INSERT INTO CONSULTASEMPLEADOS VALUES (0,"ACTIVIDAD DE UN FUNCIONARIO EN
DIAS","Devuelve la actividad del funcionario en todos los dias dentro del rango
dado.","select FechaCorrespondiente as Fecha, CAST(
concat_ws(',',emp.NroEmpleado, emp.Apellido, emp.Nombre) as CHAR) as empleado,
'ESCALAFON',CAST(if(hge.Descanso=0,concat(NumeroCliente,'-',
NumeroServicio),'Descanso') as CHAR) as observacion from
horasgeneradasescalafon hge, empleados emp where hge.FechaCorrespondiente
between 'FECHADESDE' and 'FECHAHASTA' and hge.NroEmpleado=NROEMPLEADO and
hge.NroEmpleado=emp.NroEmpleado UNION select FechaInicio as Fecha,
CAST(concat_ws(' ',emp.NroEmpleado, emp.Apellido, emp.Nombre) as CHAR) as
empleado,'HISTORIAL FUNCIONARIO', CAST(concat(ehe.FechaInicio,' a
',ehe.FechaFin,': ', ehe.Descripcion) as CHAR) as observacion from
EventosHistorialEmpleado ehe, Empleados emp, TiposEventoHistorial teh where
ehe.IdEmpleado=emp.NroEmpleado and ehe.IdTipoEvento = teh.IdTipoEventoHistorial
and ( ehe.FechaInicio <= 'FECHAHASTA' and ehe.FechaFin >= 'FECHADESDE') and
IdEmpleado=NROEMPLEADO UNION select FechaCorresponde as Fecha, CAST(concat_ws('
',emp.NroEmpleado, emp.Apellido, emp.Nombre) as CHAR) as empleado,'MOTIVO
CAMBIO DIARIO', CAST(mcd.Observaciones as CHAR) as observacion from
motivoscambiosdiarios mcd, empleados emp where mcd.FechaCorresponde between
'FECHADESDE' and 'FECHAHASTA' and mcd.NroEmpleado=NROEMPLEADO and
mcd.NroEmpleado=emp.NroEmpleado ORDER BY 1",1);
Original comment by juanga...@gmail.com
on 30 May 2011 at 11:23
Original issue reported on code.google.com by
juanga...@gmail.com
on 21 May 2011 at 2:17