sql+=" and beLateMins+graveBeLateMins+leaveEarlyMins+graveLeaveEarlyMins+absenteeismMins+forgotCheckMins+nvl(forgotBeginWorkCheckMins,0)>0 ";
sql+=" and beLateMins+graveBeLateMins+leaveEarlyMins+graveLeaveEarlyMins+absenteeismMins+forgotCheckMins+nvl(forgotBeginWorkCheckMins,0)>0 ";
@ -381,7 +381,9 @@ public class KQReportBiz extends BaseBean {
}
}
sql=" select resourceid, newleavetype, durationrule, sum(duration) as val from hrmresource a, "+KqSplitFlowTypeEnum.LEAVEBACK.getTablename()+" b "+
sql=" select resourceid, newleavetype, durationrule, sum(duration) as val from hrmresource a, "+KqSplitFlowTypeEnum.LEAVEBACK.getTablename()+" b "+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' and (DATEPART(dw, belongdate) = 7 or DATEPART(dw, belongdate) = 1) and belongdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND groupid = groupId) "+sqlWhere+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' and (DATEPART(dw, belongdate) = 7 or DATEPART(dw, belongdate) = 1) "+
"and belongdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND groupid = "+
"(select top 1 groupid from kq_shiftschedule where resourceid = b.resourceid and serialid = b.serialid and kqdate = b.belongdate)) "+sqlWhere+
" group by resourceid, newleavetype, durationrule ";
" group by resourceid, newleavetype, durationrule ";
rs.execute(sql);
rs.execute(sql);
while(rs.next()){
while(rs.next()){
@ -473,7 +475,10 @@ public class KQReportBiz extends BaseBean {
}
}
sql=" select resourceid, newleavetype, durationrule, sum(duration) as val from hrmresource a, "+KqSplitFlowTypeEnum.LEAVE.getTablename()+" b "+
sql=" select resourceid, newleavetype, durationrule, sum(duration) as val from hrmresource a, "+KqSplitFlowTypeEnum.LEAVE.getTablename()+" b "+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' and (DATEPART(dw, belongdate) = 7 or DATEPART(dw, belongdate) = 1) and belongdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND groupid = groupId) "+sqlWhere+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' and "+
"(DATEPART(dw, belongdate) = 7 or DATEPART(dw, belongdate) = 1) and belongdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 "+
"AND groupid = (select top 1 groupid from kq_shiftschedule where resourceid = b.resourceid "+
" and serialid = b.serialid and kqdate = b.belongdate)) "+sqlWhere+
" group by resourceid, newleavetype, durationrule ";
" group by resourceid, newleavetype, durationrule ";
rs.execute(sql);
rs.execute(sql);
while(rs.next()){
while(rs.next()){
@ -567,7 +572,9 @@ 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+"' and (DATEPART(dw, belongdate) = 7 or DATEPART(dw, belongdate) = 1) and belongdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND groupid = groupId) "+sqlWhere+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' and (DATEPART(dw, belongdate) = 7 or DATEPART(dw, belongdate) = 1) "+
"and belongdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND groupid = "+
"(select top 1 groupid from kq_shiftschedule where resourceid = b.resourceid and serialid = b.serialid and kqdate = b.belongdate)) "+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()){
@ -659,7 +666,9 @@ 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+"' and (DATEPART(dw, belongdate) = 7 or DATEPART(dw, belongdate) = 1) and belongdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND groupid = groupId) "+sqlWhere+
" where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' and (DATEPART(dw, belongdate) = 7 or DATEPART(dw, belongdate) = 1) "+
"and belongdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND groupid = "+
"(select top 1 groupid from kq_shiftschedule where resourceid = b.resourceid and serialid = b.serialid and kqdate = b.belongdate)) "+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()){
@ -1170,8 +1179,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");
@ -1271,8 +1280,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");
@ -1363,8 +1372,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");
@ -1458,9 +1467,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()){
@ -1669,9 +1678,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");
@ -1816,10 +1825,10 @@ public class KQReportBiz extends BaseBean {