sql+=" and beLateMins+graveBeLateMins+leaveEarlyMins+graveLeaveEarlyMins+absenteeismMins+forgotCheckMins+nvl(forgotBeginWorkCheckMins,0)>0 ";
sql+=" and beLateMins+graveBeLateMins+leaveEarlyMins+graveLeaveEarlyMins+absenteeismMins+forgotCheckMins+nvl(forgotBeginWorkCheckMins,0)>0 ";
@ -1176,8 +1177,8 @@ public class KQReportBiz extends BaseBean {
}
}
sql=" select resourceid, durationrule, changetype,sum(duration) as val from hrmresource a, "+KqSplitFlowTypeEnum.PROCESSCHANGE.getTablename()+" b "+
sql=" select resourceid, durationrule, changetype,sum(duration) as val from hrmresource a, "+KqSplitFlowTypeEnum.PROCESSCHANGE.getTablename()+" b "+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' "+sqlWhere+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' "+sqlWhere+
" group by resourceid, durationrule,changetype ";
" group by resourceid, durationrule,changetype ";
rs.execute(sql);
rs.execute(sql);
while(rs.next()){
while(rs.next()){
Stringresourceid=rs.getString("resourceid");
Stringresourceid=rs.getString("resourceid");
@ -1277,8 +1278,8 @@ public class KQReportBiz extends BaseBean {
}
}
sql=" select resourceid, newleavetype, durationrule, sum(duration) as val,belongdate from hrmresource a, "+KqSplitFlowTypeEnum.LEAVE.getTablename()+" b "+
sql=" select resourceid, newleavetype, durationrule, sum(duration) as val,belongdate from hrmresource a, "+KqSplitFlowTypeEnum.LEAVE.getTablename()+" b "+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' "+sqlWhere+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' "+sqlWhere+
" group by resourceid, newleavetype, durationrule,belongdate ";
" group by resourceid, newleavetype, durationrule,belongdate ";
rs.execute(sql);
rs.execute(sql);
while(rs.next()){
while(rs.next()){
Stringresourceid=rs.getString("resourceid");
Stringresourceid=rs.getString("resourceid");
@ -1369,8 +1370,8 @@ public class KQReportBiz extends BaseBean {
}
}
sql=" select resourceid, newleavetype, durationrule, sum(duration) as val,belongdate from hrmresource a, "+KqSplitFlowTypeEnum.LEAVEBACK.getTablename()+" b "+
sql=" select resourceid, newleavetype, durationrule, sum(duration) as val,belongdate from hrmresource a, "+KqSplitFlowTypeEnum.LEAVEBACK.getTablename()+" b "+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' "+sqlWhere+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' "+sqlWhere+
" group by resourceid, newleavetype, durationrule,belongdate ";
" group by resourceid, newleavetype, durationrule,belongdate ";
rs.execute(sql);
rs.execute(sql);
while(rs.next()){
while(rs.next()){
Stringresourceid=rs.getString("resourceid");
Stringresourceid=rs.getString("resourceid");
@ -1464,9 +1465,9 @@ public class KQReportBiz extends BaseBean {
StringvalueField="";
StringvalueField="";
sql=" select resourceid,changeType, sum(cast(duration_min as decimal(18,4))) as val,paidLeaveEnable "+
sql=" select resourceid,changeType, sum(cast(duration_min as decimal(18,4))) as val,paidLeaveEnable "+
" from hrmresource a, kq_flow_overtime b "+
" from hrmresource a, kq_flow_overtime b "+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' "+sqlWhere+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' "+sqlWhere+
" group by resourceid,changeType,paidLeaveEnable ";
" group by resourceid,changeType,paidLeaveEnable ";
rs.execute(sql);
rs.execute(sql);
kqLog.info("getFlowOverTimeDataNew:sql:"+sql);
kqLog.info("getFlowOverTimeDataNew:sql:"+sql);
while(rs.next()){
while(rs.next()){
@ -1675,9 +1676,9 @@ public class KQReportBiz extends BaseBean {
}
}
sql=" select resourceid,changeType,belongdate,paidLeaveEnable, sum(cast(duration_min as decimal(18,4))) as val "+
sql=" select resourceid,changeType,belongdate,paidLeaveEnable, sum(cast(duration_min as decimal(18,4))) as val "+
" from hrmresource a, kq_flow_overtime b "+
" from hrmresource a, kq_flow_overtime b "+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' "+sqlWhere+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' "+sqlWhere+
" group by resourceid,changeType,paidLeaveEnable,belongdate ";
" group by resourceid,changeType,paidLeaveEnable,belongdate ";
rs.execute(sql);
rs.execute(sql);
while(rs.next()){
while(rs.next()){
Stringresourceid=rs.getString("resourceid");
Stringresourceid=rs.getString("resourceid");
@ -1822,13 +1823,15 @@ public class KQReportBiz extends BaseBean {
StringbackFields=" (select sum(zma.workdays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='"+fromDate+"' and zma.kqdate <='"+toDate+"' and (DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) AND zma.kqdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND zma.groupid = groupId)) as saturdayworkdays,"+
StringbackFields=" (select sum(zma.workdays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='"+fromDate+"' and zma.kqdate <='"+toDate+"' and (DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) AND zma.kqdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND zma.groupid = groupId)) as saturdayworkdays,"+
" (select count(0) from kq_shiftschedule where resourceid = a.id and kqdate >='"+fromDate+"' and kqdate <='"+toDate+"' and serialid=" +supportSerId+" )as supportTotal," +
" (select count(0) from kq_shiftschedule where resourceid = a.id and kqdate >='"+fromDate+"' and kqdate <='"+toDate+"' and serialid in (" +supportSerId+") )as supportTotal," +
" (select sum(zma.attendancedays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='"+fromDate+"' and zma.kqdate <='"+toDate+"' and (DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) AND zma.kqdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND zma.groupid = groupId)) as saturdayattendancedays,"+
" (select sum(zma.attendancedays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='"+fromDate+"' and zma.kqdate <='"+toDate+"' and (DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) AND zma.kqdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND zma.groupid = groupId)) as saturdayattendancedays,"+
" (select sum(zma.workdays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='"+fromDate+"' and zma.kqdate <='"+toDate+"' and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayworkdays,"+
" (select sum(zma.workdays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='"+fromDate+"' and zma.kqdate <='"+toDate+"' and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayworkdays,"+
" (select sum(zma.attendancedays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='"+fromDate+"' and zma.kqdate <='"+toDate+"' and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayattendancedays,"+
" (select sum(zma.attendancedays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='"+fromDate+"' and zma.kqdate <='"+toDate+"' and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayattendancedays,"+
StringbackFields=" (select sum(zma.workdays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='"+fromDate+"' and zma.kqdate <='"+toDate+"' and (DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) AND zma.kqdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND zma.groupid = groupId)) as saturdayworkdays,"+
StringbackFields=" (select sum(zma.workdays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='"+fromDate+"' and zma.kqdate <='"+toDate+"' and (DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) AND zma.kqdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND zma.groupid = groupId)) as saturdayworkdays,"+
" (select count(0) from kq_shiftschedule where resourceid = a.id and kqdate >='"+fromDate+"' and kqdate <='"+toDate+"' and serialid=" +supportSerId+" )as supportTotal," +
" (select count(0) from kq_shiftschedule where resourceid = a.id and kqdate >='"+fromDate+"' and kqdate <='"+toDate+"' and serialid in (" +supportSerId+") )as supportTotal," +
" (select sum(zma.attendancedays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='"+fromDate+"' and zma.kqdate <='"+toDate+"' and (DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) AND zma.kqdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND zma.groupid = groupId)) as saturdayattendancedays,"+
" (select sum(zma.attendancedays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='"+fromDate+"' and zma.kqdate <='"+toDate+"' and (DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) AND zma.kqdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND zma.groupid = groupId)) as saturdayattendancedays,"+
" (select sum(zma.workdays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='"+fromDate+"' and zma.kqdate <='"+toDate+"' and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayworkdays,"+
" (select sum(zma.workdays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='"+fromDate+"' and zma.kqdate <='"+toDate+"' and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayworkdays,"+
" (select sum(zma.attendancedays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='"+fromDate+"' and zma.kqdate <='"+toDate+"' and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayattendancedays,"+
" (select sum(zma.attendancedays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='"+fromDate+"' and zma.kqdate <='"+toDate+"' and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayattendancedays,"+