Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
ops
Commits
d4f2d24b
Commit
d4f2d24b
authored
Feb 28, 2025
by
wujipeng
Browse files
优化
parent
79153234
Changes
2
Show whitespace changes
Inline
Side-by-side
src/main/java/com/ruzhoukj/sms/controller/DingAttendanceController.java
View file @
d4f2d24b
...
@@ -13,14 +13,12 @@ import com.ruzhoukj.sms.service.DingAttendanceService;
...
@@ -13,14 +13,12 @@ import com.ruzhoukj.sms.service.DingAttendanceService;
import
com.taobao.api.ApiException
;
import
com.taobao.api.ApiException
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.checkerframework.checker.nullness.qual.Nullable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
...
src/main/resources/com/ruzhoukj/sms/dao/DingAttendanceDao.xml
View file @
d4f2d24b
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
MIN(min.user_check_time) AS checkTimeOn,
MIN(min.user_check_time) AS checkTimeOn,
MAX(max.offduty_max_time) AS checkTimeOff,
MAX(max.offduty_max_time) AS checkTimeOff,
min.user_address as userAddress,
min.user_address as userAddress,
min.time_result as timeResult
,
min.time_result
as timeResult
FROM ding_attendance min
FROM ding_attendance min
LEFT JOIN (SELECT user_id,
LEFT JOIN (SELECT user_id,
MAX(user_check_time) AS offduty_max_time
MAX(user_check_time) AS offduty_max_time
...
@@ -18,9 +18,12 @@
...
@@ -18,9 +18,12 @@
WHERE user_check_time BETWEEN #{checkDateFrom} AND #{checkDateTo}
WHERE user_check_time BETWEEN #{checkDateFrom} AND #{checkDateTo}
AND check_type = 'OffDuty'
AND check_type = 'OffDuty'
GROUP BY user_id -- 按 user_id 分组
GROUP BY user_id -- 按 user_id 分组
) max ON min.user_id = max.user_id
) max
WHERE min.user_check_time BETWEEN #{checkDateFrom} AND #{checkDateTo}
ON min.user_id = max.user_id
WHERE min.user_check_time BETWEEN #{checkDateFrom}
AND #{checkDateTo}
AND min.check_type = 'OnDuty'
AND min.check_type = 'OnDuty'
GROUP BY min.id, min.name, min.user_id, min.user_address, min.time_result;
GROUP BY min.id, min.name, min.user_id, min.user_address, min.time_result, min.user_check_time
order by min.user_check_time
</select>
</select>
</mapper>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment