liupeng 4 роки тому
батько
коміт
ee2220d432

+ 11 - 4
code/sapparent/sapservice/src/main/java/org/fouram/mapper/SapCheckMapper.xml

@@ -126,7 +126,7 @@
 		update sap_check_report
 		set realCheckinDate = (
 			case when checkinException not like '%未打卡' and checkinDate is not null then checkinDate
-				 when checkoutDate1 is not null and checkoutDate1 %lt; concat(checkinDay,' 13:00:00') then checkoutDate1
+				 when checkoutDate1 is not null and checkoutDate1 < concat(checkinDay,' 13:00:00') then checkoutDate1
 				 else ''
 			end
 		)
@@ -149,12 +149,12 @@
 		update sap_check_report
 		set realResultRemark = concat((
 			case when realCheckinDate = '' then '上班未打卡,' 
-				 when realCheckinDate > concat(checkinDay,' 0', workTime, ':00') then '迟到,'
+				 when realCheckinDate != '' and left(realCheckinDate, 16) > concat(checkinDay,' 0', workTime) then '迟到,'
 				 else ''
 			end
 		),(
 			case when realCheckoffDate = '' then '下班未打卡' 
-				 when realCheckoffDate %lt; concat(checkinDay,' ', offWorkTime, ':00') then '早退'
+				 when realCheckoffDate != '' and left(realCheckoffDate, 16) < concat(checkinDay,' 0', offWorkTime) then '早退'
 				 else ''
 			end
 		))
@@ -163,7 +163,14 @@
 	
 	<update id="updateRealResult">
 		update sap_check_report
-		set realResult = (case when length(realResultRemark) = 0 or leaveDay >= 1 then '正常' else '异常' end)
+		set realResult = (
+			case when length(realResultRemark) = 0 or leaveDay >= 1 
+					or (leaveDay = 0.5 and (
+							(realCheckinDate != '' and left(realCheckinDate, 16) &lt;= concat(checkinDay,' 0', workTime))
+							or
+							(realCheckoffDate != '' and left(realCheckoffDate, 16) >= concat(checkinDay,' 0', offWorkTime))
+					)) then '正常' else '异常' 
+			end)
 		where realResult is null
 	</update>