.
This commit is contained in:
parent
87f425bed2
commit
c721da3d6f
@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.PathVariable;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import io.company.localhost.common.annotation.Member;
|
||||
@ -119,9 +120,9 @@ public class VacationController {
|
||||
@Member
|
||||
@ParameterCheck
|
||||
@GetMapping("/history")
|
||||
public ApiResponse<Map<String, List<MapDto>>> selectUserVacationHistory() {
|
||||
public ApiResponse<Map<String, List<MapDto>>> selectUserVacationHistory(@RequestParam("year") int year) {
|
||||
Long userId = AuthUtil.getUser().getId();
|
||||
return ApiResponse.ok(localVacaService.selectUserVacationHistory(userId));
|
||||
return ApiResponse.ok(localVacaService.selectUserVacationHistory(userId, year));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -16,9 +16,9 @@ public interface localvacaMapper {
|
||||
|
||||
List<MapDto> selectVacations(@Param("year") int year, @Param("month") int month);
|
||||
|
||||
List<MapDto> selectUsedVacations(@Param("userId") Long userId);
|
||||
List<MapDto> selectUsedVacations(@Param("userId") Long userId, @Param("year") int year);
|
||||
|
||||
List<MapDto> selectReceivedVacations(@Param("userId") Long userId);
|
||||
List<MapDto> selectReceivedVacations(@Param("userId") Long userId, @Param("year") int year);
|
||||
|
||||
List<MapDto> selectEmployeeRemainingVacation();
|
||||
|
||||
|
||||
@ -158,9 +158,9 @@ public class localvacaService {
|
||||
/**
|
||||
* 내 연차 사용 내역 조회 (사용한 연차 & 받은 연차)
|
||||
*/
|
||||
public Map<String, List<MapDto>> selectUserVacationHistory(Long userId) {
|
||||
List<MapDto> usedVacations = localvacaMapper.selectUsedVacations(userId);
|
||||
List<MapDto> receivedVacations = localvacaMapper.selectReceivedVacations(userId);
|
||||
public Map<String, List<MapDto>> selectUserVacationHistory(Long userId, int year) {
|
||||
List<MapDto> usedVacations = localvacaMapper.selectUsedVacations(userId,year);
|
||||
List<MapDto> receivedVacations = localvacaMapper.selectReceivedVacations(userId,year);
|
||||
|
||||
Map<String, List<MapDto>> history = new HashMap<>();
|
||||
history.put("usedVacations", usedVacations);
|
||||
|
||||
@ -75,6 +75,7 @@
|
||||
b.LOCBRDTYP AS type,
|
||||
b.LOCBRDCNT AS cnt,
|
||||
m.MEMBERNAM AS author
|
||||
m.MEMBERSEQ AS authorId
|
||||
FROM localbord b
|
||||
LEFT JOIN netmember m ON b.MEMBERSEQ = m.MEMBERSEQ
|
||||
WHERE b.LOCBRDSEQ = #{boardId}
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
END) AS used_quota
|
||||
FROM localvaca
|
||||
WHERE MEMBERSEQ = #{userId}
|
||||
AND YEAR(LOCVACUDT) = #{year}
|
||||
AND DATE_FORMAT(LOCVACUDT, '%Y') = DATE_FORMAT(CURDATE(), '%Y')
|
||||
GROUP BY LOCVACUDT, LOCVACTYP, LOCVACRMM
|
||||
ORDER BY LOCVACUDT DESC
|
||||
@ -42,6 +43,7 @@
|
||||
SELECT LOCVACUDT AS date, LOCVACTYP AS type, MEMBERSEQ AS senderId
|
||||
FROM localvaca
|
||||
WHERE LOCVACRMM = #{userId}
|
||||
AND YEAR(LOCVACUDT) = #{year}
|
||||
AND DATE_FORMAT(LOCVACUDT, '%Y') = DATE_FORMAT(CURDATE(), '%Y')
|
||||
GROUP BY LOCVACUDT, LOCVACTYP, MEMBERSEQ
|
||||
ORDER BY LOCVACUDT DESC
|
||||
|
||||
Loading…
Reference in New Issue
Block a user