StringsqlMode="insert into uf_jbtz (jbr,gjsc,bcfs,jbxz,sqr,szbm,sjh,zzdksj,zwdkrq,ly,gh,bm,zw,jblx,ksrq,jsrq,sqsy,kssj,jssj,gzrq,FORMMODEID,MODEDATACREATER,MODEDATACREATERTYPE,MODEDATACREATEDATE,MODEDATACREATETIME) \n"+
StringsqlMode="insert into uf_jbtz (jbr,gjsc,bcfs,jbxz,sqr,szbm,sjh,zzdksj,zwdkrq,ly,gh,bm,zw,jblx,ksrq,jsrq,sqsy,kssj,jssj,gzrq,FORMMODEID,MODEDATACREATER,MODEDATACREATERTYPE,MODEDATACREATEDATE,MODEDATACREATETIME) \n"+
@ -3250,7 +3471,7 @@ public class KQOverTimeRuleCalBiz {
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 {
@ -196,7 +192,7 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
" (select zma.attendancedays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate 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 zma.attendancedays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate 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 zma.workdays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate 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 zma.workdays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate 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 zma.attendancedays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate 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 zma.attendancedays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate 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,"+
" a.id,a.lastname,a.subcompanyid1 as subcompanyid,a.departmentid, a.workcode,b.jobtitle,a.dsporder," +
" a.id,a.lastname,a.subcompanyid1 as subcompanyid,a.departmentid, a.workcode,b.jobtitle,a.dsporder,a.companystartdate," +
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,"+
" a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1 as subcompanyid,a.departmentid,a.jobtitle," +
" a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1 as subcompanyid,a.departmentid,a.jobtitle,a.companystartdate," +
" sum(b.workdays) as workdays,sum(b.workMins) as workMins,sum(b.attendancedays) as attendancedays,"+
" sum(b.workdays) as workdays,sum(b.workMins) as workMins,sum(b.attendancedays) as attendancedays,"+
" sum(b.attendanceMins) as attendanceMins,sum(b.beLate) as beLate,sum(b.beLateMins) as beLateMins, "+
" sum(b.attendanceMins) as attendanceMins,sum(b.beLate) as beLate,sum(b.beLateMins) as beLateMins, "+
" sum(b.graveBeLate) as graveBeLate, sum(b.graveBeLateMins) as graveBeLateMins,sum(b.leaveEearly) as leaveEearly,"+
" sum(b.graveBeLate) as graveBeLate, sum(b.graveBeLateMins) as graveBeLateMins,sum(b.leaveEearly) as leaveEearly,"+
@ -228,7 +229,7 @@ public class ExportExcelCmd extends AbstractCommonCommand<Map<String, Object>> {
"where a.id= b.resourceid and c.id=b.serialid and (c.rest_shift is null or c.rest_shift=0) "+
"where a.id= b.resourceid and c.id=b.serialid and (c.rest_shift is null or c.rest_shift=0) "+
"and b.kqdate >='"+fromDate+"' and b.kqdate <='"+toDate+"'";
"and b.kqdate >='"+fromDate+"' and b.kqdate <='"+toDate+"'";
StringsqlWhere=rightSql;
StringsqlWhere=rightSql;
StringgroupBy=" group by a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1,a.departmentid,a.jobtitle ";
StringgroupBy=" group by a.id,a.lastname,a.workcode,a.dsporder,a.companystartdate,b.resourceid,a.subcompanyid1,a.departmentid,a.jobtitle ";
if(subCompanyId.length()>0){
if(subCompanyId.length()>0){
sqlWhere+=" and a.subcompanyid1 in("+subCompanyId+") ";
sqlWhere+=" and a.subcompanyid1 in("+subCompanyId+") ";
}
}
@ -291,6 +292,14 @@ public class ExportExcelCmd extends AbstractCommonCommand<Map<String, Object>> {
@ -156,7 +156,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
" (select zma.attendancedays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate 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 zma.attendancedays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate 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 zma.workdays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate 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 zma.workdays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate 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 zma.attendancedays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate 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 zma.attendancedays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate 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,"+
" a.id,a.lastname,a.subcompanyid1 as subcompanyid,a.departmentid, a.workcode,b.jobtitle,a.dsporder," +
" a.id,a.lastname,a.subcompanyid1 as subcompanyid,a.departmentid, a.workcode,b.jobtitle,a.dsporder,a.companystartdate," +
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,"+
"a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1 as subcompanyid,a.departmentid,a.jobtitle," +
"a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1 as subcompanyid,a.departmentid,a.jobtitle,a.companystartdate," +
" sum(b.workdays) as workdays,sum(b.workMins) as workMins,sum(b.attendancedays) as attendancedays,"+
" sum(b.workdays) as workdays,sum(b.workMins) as workMins,sum(b.attendancedays) as attendancedays,"+
" sum(b.attendanceMins) as attendanceMins,sum(b.beLate) as beLate,sum(b.beLateMins) as beLateMins, "+
" sum(b.attendanceMins) as attendanceMins,sum(b.beLate) as beLate,sum(b.beLateMins) as beLateMins, "+
" sum(b.graveBeLate) as graveBeLate, sum(b.graveBeLateMins) as graveBeLateMins,sum(b.leaveEearly) as leaveEearly,"+
" sum(b.graveBeLate) as graveBeLate, sum(b.graveBeLateMins) as graveBeLateMins,sum(b.leaveEearly) as leaveEearly,"+
@ -207,7 +210,7 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
"where a.id= b.resourceid and c.id=b.serialid and (c.rest_shift is null or c.rest_shift=0) "+
"where a.id= b.resourceid and c.id=b.serialid and (c.rest_shift is null or c.rest_shift=0) "+
"and b.kqdate >='"+fromDate+"' and b.kqdate <='"+toDate+"'";
"and b.kqdate >='"+fromDate+"' and b.kqdate <='"+toDate+"'";
StringsqlWhere=rightSql;
StringsqlWhere=rightSql;
StringgroupBy=" group by a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1,a.departmentid,a.jobtitle ";
StringgroupBy=" group by a.id,a.lastname,a.workcode,a.dsporder,a.companystartdate,b.resourceid,a.subcompanyid1,a.departmentid,a.jobtitle ";
if(subCompanyId.length()>0){
if(subCompanyId.length()>0){
sqlWhere+=" and a.subcompanyid1 in("+subCompanyId+") ";
sqlWhere+=" and a.subcompanyid1 in("+subCompanyId+") ";
}
}
@ -438,10 +441,10 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
Stringsql="insert into kq_flow_split_evection (requestid,resourceid,fromdate,fromtime,todate,totime,duration,durationrule,belongdate,newleavetype,subcompanyid,departmentid,workflowid,tablenamedb) "
Stringsql="insert into kq_flow_split_evection (requestid,resourceid,fromdate,fromtime,todate,totime,duration,durationrule,belongdate,newleavetype,subcompanyid,departmentid,workflowid,tablenamedb) "