|
楼主 |
发表于 2013-12-12 09:18:10
|
显示全部楼层
Caused by: com.justep.model.exception.ModelException: 执行ksql:insert into HR_CR_CheckCollect1 cc(cc,cc.fMasterID,cc.fCode, cc.fDEPTID,cc.fDEPTNAME,cc.fFID,cc.fPEOPLEID,cc.fPEOPLENAME,cc.fDAY1,cc.fDAY2, cc.fDAY3,cc.fDAY4,cc.fDAY5,cc.fDAY6,cc.fDAY7,cc.fDAY8,cc.fDAY9,cc.fDAY10,cc.fDAY11,cc.fDAY12, cc.fDAY13,cc.fDAY14,cc.fDAY15,cc.fDAY16,cc.fDAY17,cc.fDAY18,cc.fDAY19,cc.fDAY20,cc.fDAY21, cc.fDAY22,cc.fDAY23,cc.fDAY24,cc.fDAY25,cc.fDAY26,cc.fDAY27,cc.fDAY28,cc.fDAY29,cc.fDAY30, cc.fDAY31,cc.fDayShift,cc.fAbsenceLate,cc.fAbsenceEarly,cc.fDayOffYear,cc.fAbsencePrivate,cc.fAbsenceSick,cc.fDayOffNormal,cc.fDayOffShutdown,cc.fDayOffHomeLeave,cc.fDayOffWedding,cc.fDayOffMaternity,cc.fDayOffFuneral,cc.fDayOffTravel,cc.fDayOffTraining,cc.fAbsenceNeglect,cc.fDayOffInjury,cc.fDayOffConvalescent,cc.fFactDuty,cc.fPresentDuty,cc.fOverTimeWorkDay,cc.fOverTimeTurn,cc.fOverTimeHoliday,cc.fWaitPosition,cc.version) (select guid() as GUID, 'DDC09295B7F54FFA8FE5EDE182067751' as fMasterID, max(y.fEmployeeCode) as fEmployeeCode, max(y.fDeptID) as fDeptID, max(y.fDeptName) as fDeptName, max(y.fFID) as fFID, max(y.fEmployeeID) as fEmployeeID, max(y.fName) as fName, sum(case when y.fDay='01' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay1, sum(case when y.fDay='02' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay2, sum(case when y.fDay='03' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay3, sum(case when y.fDay='04' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay4, sum(case when y.fDay='05' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay5, sum(case when y.fDay='06' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay6, sum(case when y.fDay='07' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay7, sum(case when y.fDay='08' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay8, sum(case when y.fDay='09' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay9, sum(case when y.fDay='10' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay10, sum(case when y.fDay='11' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay11, sum(case when y.fDay='12' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay12, sum(case when y.fDay='13' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay13, sum(case when y.fDay='14' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay14, sum(case when y.fDay='15' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay15, sum(case when y.fDay='16' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay16, sum(case when y.fDay='17' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay17, sum(case when y.fDay='18' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay18, sum(case when y.fDay='19' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay19, sum(case when y.fDay='20' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay20, sum(case when y.fDay='21' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay21, sum(case when y.fDay='22' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay22, sum(case when y.fDay='23' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay23, sum(case when y.fDay='24' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay24, sum(case when y.fDay='25' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay25, sum(case when y.fDay='26' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay26, sum(case when y.fDay='27' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay27, sum(case when y.fDay='28' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay28, sum(case when y.fDay='29' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay29, sum(case when y.fDay='30' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay30, sum(case when y.fDay='31' and fMonth='08' and (y.fCheckItemName = '出勤') then fCheckItemValue else 0 end) as fDay31, round(sum(case when y.fCheckItemName ='出勤' then y.fCheckItemValue/8 else 0 end),1) as fDayShift, round(sum(case when y.fCheckItemName = '迟到' then y.fCheckItemValue/8 else 0 end),1) as fAbsenceLate, round(sum(case when y.fCheckItemName = '早退' then y.fCheckItemValue/8 else 0 end),1) as fAbsenceEarly, round(sum(case when y.fCheckItemName = '年休假' then y.fCheckItemValue/8 else 0 end),1) as fDayOffYear, round(sum(case when y.fCheckItemName = '事假' then y.fCheckItemValue/8 else 0 end),1) as fAbsencePrivate, round(sum(case when y.fCheckItemName = '病假' then y.fCheckItemValue/8 else 0 end),1) as fAbsenceSick, round(sum(case when y.fCheckItemName = '正常休假' then y.fCheckItemValue/8 else 0 end),1) as fDayOffNormal, round(sum(case when y.fCheckItemName = '停工休假' then y.fCheckItemValue/8 else 0 end),1) as fDayOffShutdown, round(sum(case when y.fCheckItemName = '探亲假' then y.fCheckItemValue/8 else 0 end),1) as fDayOffHomeLeave, round(sum(case when y.fCheckItemName = '婚假' then y.fCheckItemValue/8 else 0 end),1) as fDayOffWedding, round(sum(case when y.fCheckItemName = '产假' then y.fCheckItemValue/8 else 0 end),1) as fDayOffMaternity, round(sum(case when y.fCheckItemName = '丧假' then y.fCheckItemValue/8 else 0 end),1) as fDayOffFuneral, round(sum(case when y.fCheckItemName = '公派出差' then y.fCheckItemValue/8 else 0 end),1) as fDayOffTravel, round(sum(case when y.fCheckItemName = '培训学习(一个月以内)' then y.fCheckItemValue/8 else 0 end),1) as fDayOffTraining, round(sum(case when y.fCheckItemName = '旷工' then y.fCheckItemValue/8 else 0 end),1) as fAbsenceNeglect, round(sum(case when y.fCheckItemName = '工伤休养' then y.fCheckItemValue/8 else 0 end),1) as fDayOffInjury, round(sum(case when y.fCheckItemName = '疗养' then y.fCheckItemValue/8 else 0 end),1) as fDayOffConvalescent, round(sum(case when y.fCheckItemName = '实出勤' then y.fCheckItemValue/8 else 0 end),1) as fFactDuty, round(sum(case when y.fCheckItemName = '全勤' then y.fCheckItemValue/8 else 0 end),1) as fPresentDuty, round(sum(case when y.fCheckItemName = '工作日加班' then y.fCheckItemValue/8 else 0 end),1) as fOverTimeWorkDay, round(sum(case when y.fCheckItemName = '周末加班' then y.fCheckItemValue/8 else 0 end),1) as fOverTimeTurn, round(sum(case when y.fCheckItemName = '法定节假日加班' then y.fCheckItemValue/8 else 0 end),1) as fOverTimeHoliday, round(sum(case when y.fCheckItemName = '待岗' then y.fCheckItemValue/8 else 0 end),1) as fWaitPosition, 0 as version from (select getDay(c.fDATE) as fDay, getMonth(c.fDATE) as fMonth, e.fCode as fEmployeeCode, e as fEmployeeID, e.fName as fName, e.fDeptID as fDeptID, e.fDeptName as fDeptName, pa.fFID as fFID, c.fCHECKITEMNAME as fCheckItemName, c.fCHECKITEMVALUE as fCheckItemValue from HR_EP_Employee e optional join HR_CR_EVERYDAYCHECK1 c on e = c.fEMPLOYEEID and (( getYear(c.fDATE) = 2013 and getMonth(c.fDATE) = 8 and getDay(c.fDATE) >=1 and getDay(c.fDATE) <=31) and c.fMASTERID in (select ec from HR_CR_EVERYDAYCHECK ec where ec.fBizState = 'bsFinished')) join (select o as fID, o.fFID AS fFID from HR_OG_Org o join (select distinct concat(fFID , '%') as fFID from HR_OG_Org oo where oo = '9D1CCD558D2743F0A25AB2FF3DCD9C36') p on o.fFID like p.fFID) pa on e.fDeptID = pa.fID ) y group by y.fEmployeeID)时出错!
|
|