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 {
@ -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) "