|
@@ -58,11 +58,9 @@
|
|
|
</update>
|
|
|
<insert id="saveCheckReport">
|
|
|
insert into sap_check_report(userId,groupName,name,checkinDay,checkinDate,checkinException,checkoffDate,checkoffException,
|
|
|
- checkoutDate1,checkoutDate2,leaveCreatedTime,leaveStartDate,leaveEndDate,leaveDay,leaveComment,bukaDay,result)
|
|
|
- select a.userId,c.groupName,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, m.`day` as bukaDay, '正常' as result
|
|
|
+ checkoutDate1,checkoutDate2,leaveCreatedTime,leaveStartDate,leaveEndDate,leaveDay,leaveComment)
|
|
|
+ select a.userId,c.groupName,a.`name`,b.checkinDay,c.checkinDate,c.exceptionType,d.checkinDate,d.exceptionType,
|
|
|
+ e.checkinDate,g.checkinDate,f.createdDateTime,f.startDate,f.endDate,f.deductionQuantity,f.`comment`
|
|
|
from wx_user a join sap_checkdate b on a.delFlag=0
|
|
|
and b.checkinDay >= #{startDay} and b.checkinDay <= #{endDay}
|
|
|
LEFT JOIN sap_checkin c on a.userId = c.userId and b.checkinDay = c.checkinDay
|
|
@@ -71,9 +69,8 @@
|
|
|
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 or a.sapUserId = f.userId) and b.checkinDay >= f.startDate
|
|
|
and b.checkinDay <= f.endDate and f.approvalStatus = 'APPROVED' and f.delFlag=0
|
|
|
- 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;
|
|
|
+ order by a.userId ASC, b.checkinDay asc
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateWorkTime">
|