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