|
@@ -57,17 +57,18 @@
|
|
|
</update>
|
|
|
<insert id="saveCheckReport">
|
|
|
insert into sap_check_report(userId,groupName,workTime,offWorkTime,name,checkinDay,checkinDate,checkinException,checkoffDate,checkoffException,
|
|
|
- checkoutDate1,checkoutDate2,leaveCreatedTime,leaveStartDate,leaveEndDate,leaveDay,leaveComment,result)
|
|
|
+ checkoutDate1,checkoutDate2,leaveCreatedTime,leaveStartDate,leaveEndDate,leaveDay,leaveComment,bukaDay,result)
|
|
|
select a.userId,c.groupName,'9:30','18:30',a.`name`,b.checkinDay, c.checkinDate as checkinDate,c.exceptionType as checkinException,
|
|
|
d.checkinDate as checkoffDate,d.exceptionType as checkoffException,e.checkinDate as checkoutDate1,g.checkinDate as checkoutDate2,
|
|
|
f.createdDateTime as leaveCreatedTime, f.startDate as leaveStartDate,
|
|
|
- f.endDate as leaveEndDate,f.deductionQuantity as leaveDay,f.`comment` as leaveComment, '正常' as result
|
|
|
+ f.endDate as leaveEndDate,f.deductionQuantity as leaveDay,f.`comment` as leaveComment, m.`day` as bukaDay, '正常' as result
|
|
|
from sap_check_user a join sap_checkdate b on b.weekday = 1
|
|
|
LEFT JOIN sap_checkin c on a.userId = c.userId and b.checkinDay = c.checkinDay
|
|
|
LEFT JOIN sap_checkoff d on a.userId = d.userId and b.checkinDay = d.checkinDay
|
|
|
LEFT JOIN sap_checkout_start e on a.userId = e.userId and b.checkinDay = e.checkinDay
|
|
|
LEFT JOIN sap_checkout_end g on a.userId = g.userId and b.checkinDay = g.checkinDay
|
|
|
LEFT JOIN sap_employee_time f on a.userId = f.userId and b.checkinDay = f.startDate and f.approvalStatus = 'APPROVED'
|
|
|
+ LEFT JOIN sap_approval_info m on a.userId = m.userId and b.checkinDay = m.`day`
|
|
|
where EXISTS (SELECT 1 from sap_checkin_option o where a.userId = o.userId)
|
|
|
order by a.userId ASC, b.checkinDay asc;
|
|
|
</insert>
|