Commit d4f2d24b authored by wujipeng's avatar wujipeng
Browse files

优化

parent 79153234
......@@ -13,14 +13,12 @@ import com.ruzhoukj.sms.service.DingAttendanceService;
import com.taobao.api.ApiException;
import io.swagger.annotations.Api;
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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
......
......@@ -10,7 +10,7 @@
MIN(min.user_check_time) AS checkTimeOn,
MAX(max.offduty_max_time) AS checkTimeOff,
min.user_address as userAddress,
min.time_result as timeResult,
min.time_result as timeResult
FROM ding_attendance min
LEFT JOIN (SELECT user_id,
MAX(user_check_time) AS offduty_max_time
......@@ -18,9 +18,12 @@
WHERE user_check_time BETWEEN #{checkDateFrom} AND #{checkDateTo}
AND check_type = 'OffDuty'
GROUP BY user_id -- 按 user_id 分组
) max ON min.user_id = max.user_id
WHERE min.user_check_time BETWEEN #{checkDateFrom} AND #{checkDateTo}
) max
ON min.user_id = max.user_id
WHERE min.user_check_time BETWEEN #{checkDateFrom}
AND #{checkDateTo}
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>
</mapper>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment