프로젝트 년도 불러오기

This commit is contained in:
yoon 2025-02-11 09:55:19 +09:00
parent bb886bf0cf
commit 0779f6a2c8
4 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,51 @@
/************************************************************
*
* @packageName : io.company.localhost.controller.api
* @fileName : ProjectListController.java
* @author : 박지윤
* @date : 25.02.10
* @description : 프로젝트 목록
*
* ===========================================================
* DATE AUTHOR NOTE
* -----------------------------------------------------------
* 25.02.10 박지윤 최초 생성
*
*************************************************************/
package io.company.localhost.controller.api;
import java.util.List;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.company.localhost.common.annotation.ParameterCheck;
import io.company.localhost.common.dto.ApiResponse;
import io.company.localhost.common.dto.MapDto;
import io.company.localhost.service.commoncodService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@RestController
@RequestMapping("/api/project")
@RequiredArgsConstructor
@Slf4j
public class ProjectListController {
private final commoncodService commoncodservice;
/**
* 프로젝트 년도 조회
*
* @return ApiResponse<List<MapDto>>
*
*/
@ParameterCheck
@GetMapping("/yearCategory")
public ApiResponse<List<MapDto>> getYearCategories() {
List<MapDto> yearCategory = commoncodservice.getYearCategories();
return ApiResponse.ok(yearCategory);
}
}

View File

@ -35,5 +35,7 @@ public interface commoncodMapper {
int updateColorYon(String color); int updateColorYon(String color);
List<MapDto> getYearCategories();
List<MapDto> getCategories(); List<MapDto> getCategories();
} }

View File

@ -44,9 +44,14 @@ public class commoncodService {
return commoncodmapper.getMbtiList(); return commoncodmapper.getMbtiList();
} }
public List<MapDto> getYearCategories() {
return commoncodmapper.getYearCategories();
}
public List<MapDto> getPwhintList() { public List<MapDto> getPwhintList() {
return commoncodmapper.getPwhintList(); return commoncodmapper.getPwhintList();
} }
public List<MapDto> getCategoryList() { public List<MapDto> getCategoryList() {
return commoncodmapper.getCategories(); return commoncodmapper.getCategories();
} }

View File

@ -79,5 +79,18 @@
WHERE CMNCODVAL BETWEEN 300101 AND 300103 WHERE CMNCODVAL BETWEEN 300101 AND 300103
</select> </select>
<select id="getYearCategories" resultType="Map">
SELECT
CMNCODVAL
,CMNCODNAM
FROM
commoncod
WHERE
CMNCODLV1 = 900
AND
CMNCODODR != 0
</select>
</mapper> </mapper>