260723_01_ENH: p_child_sn 배열로 프로젝트 정보 조회 기능 추가

This commit is contained in:
2026-07-23 11:59:12 +09:00
parent 3867dbd4a4
commit 018d0f2e90
4 changed files with 46 additions and 0 deletions

View File

@@ -39,4 +39,15 @@ public class ProjectController {
) {
return projectService.getProjectTop10(getProjectTop10RequestDto);
}
@Operation(
summary = "프로젝트 조회",
description = "p_child_sn 조건으로 프로젝트를 조회합니다."
)
@PostMapping("search/all/with-p-child-sn")
public List<GetProjectTop10ResponseDto> getProjectWithPChildSn(
@RequestBody List<String> pChildSnList
) {
return projectService.getProjectWithPChildSn(pChildSnList);
}
}

View File

@@ -17,4 +17,8 @@ public interface ProjectMapper {
List<ProjectBasicInfoEntity> selectProjectTop10OnlyKeyword(
@Param("keyword") String keyword
);
List<ProjectBasicInfoEntity> selectProjectWithPChildSn(
@Param("pChildSn") List<String> pChildSn
);
}

View File

@@ -33,4 +33,12 @@ public class ProjectService {
.map(GetProjectTop10ResponseDto::from)
.toList();
}
public List<GetProjectTop10ResponseDto> getProjectWithPChildSn(List<String> pChildSnList) {
List<ProjectBasicInfoEntity> entityList = projectMapper.selectProjectWithPChildSn(pChildSnList);
return entityList.stream()
.map(GetProjectTop10ResponseDto::from)
.toList();
}
}

View File

@@ -55,4 +55,27 @@
ORDER BY p_input_dt DESC
</select>
<select id="selectProjectWithPChildSn" resultType="com.kri.intranet.extension.entity.project.ProjectBasicInfoEntity">
SELECT
p_child_sn AS pChildSn
, CASE WHEN p_intention IS NOT NULL
THEN p_subject + ' <![CDATA[<' + p_intention + '>]]>'
ELSE p_subject
END AS pTitle
, ISNULL(d.Code,'') AS pRschTeam
, ISNULL(d.T_Name,'') AS pRschTeamName
FROM project2.dbo.V_PROJECT_METHOD pm WITH (NOLOCK)
LEFT JOIN project2.dbo.v_Department d
ON pm.p_rsch_dept = d.before_t_cd1
OR pm.p_rsch_dept = d.T_CODE
WHERE 1 = 1
<if test="pChildSn != null and pChildSn.size() > 0">
AND p_child_sn IN
<foreach collection="pChildSn" item="sn" open="(" separator="," close=")">
#{sn}
</foreach>
</if>
ORDER BY p_child_sn DESC
</select>
</mapper>