get -> select

This commit is contained in:
yoon 2025-02-17 14:28:40 +09:00
parent 56edd2bc41
commit ac5629c155
10 changed files with 80 additions and 25 deletions

View File

@ -298,7 +298,7 @@ public class BoardController {
*/
@GetMapping("/categories")
public ApiResponse<List<MapDto>> getCategories() {
List<MapDto> categories = commoncodService.getCategoryList();
List<MapDto> categories = commoncodService.selectCategoryList();
return ApiResponse.ok(categories);
}
}

View File

@ -54,8 +54,8 @@ public class ProjectController {
*/
@ParameterCheck
@GetMapping("/yearCategory")
public ApiResponse<List<MapDto>> getYearCategories() {
List<MapDto> yearCategory = commoncodservice.getYearCategories();
public ApiResponse<List<MapDto>> selectYearCategories() {
List<MapDto> yearCategory = commoncodservice.selectYearCategories();
return ApiResponse.ok(yearCategory);
}
@ -109,8 +109,22 @@ public class ProjectController {
*/
@ParameterCheck
@GetMapping("/members/{projctSeq}")
public ApiResponse<List<MapDto>> getProjectMembers(@PathVariable int projctSeq) {
public ApiResponse<List<MapDto>> selectProjectMembers(@PathVariable int projctSeq) {
return ApiResponse.ok(netprojctService.getProjectMembers(projctSeq));
}
/**
* 프로젝트 log 조회
*
* * @return ApiResponse<List<MapDto>>
*
*/
@ParameterCheck
@GetMapping("/log/{projctSeq}")
public ApiResponse<List<MapDto>> selectProjectLog(@PathVariable int projctSeq) {
return ApiResponse.ok(netprojctService.selectProjectLog(projctSeq));
}
}

View File

@ -73,7 +73,7 @@ public class worddictController {
@ParameterCheck
@GetMapping("getWordCategory")
public ApiResponse<List<MapDto>> getWordCategory() {
List<MapDto> WordCategoryList = commoncodservice.getWordCategory();
List<MapDto> WordCategoryList = commoncodservice.selectWordCategory();
return ApiResponse.ok(WordCategoryList);
}
/**

View File

@ -71,8 +71,8 @@ public class UserController {
*/
@ParameterCheck
@GetMapping("/color")
public ApiResponse<List<MapDto>> getColorList(String type) {
List<MapDto> ColorList = commoncodservice.getColorList(type);
public ApiResponse<List<MapDto>> selectColorList(String type) {
List<MapDto> ColorList = commoncodservice.selectColorList(type);
return ApiResponse.ok(ColorList);
}
@ -84,8 +84,8 @@ public class UserController {
*/
@ParameterCheck
@GetMapping("/mbti")
public ApiResponse<List<MapDto>> getMbtiList() {
List<MapDto> MbtiList = commoncodservice.getMbtiList();
public ApiResponse<List<MapDto>> selectMbtiList() {
List<MapDto> MbtiList = commoncodservice.selectMbtiList();
return ApiResponse.ok(MbtiList);
}
@ -97,8 +97,8 @@ public class UserController {
*/
@ParameterCheck
@GetMapping("/pwhint")
public ApiResponse<List<MapDto>> getPwhintList() {
List<MapDto> PwhintList = commoncodservice.getPwhintList();
public ApiResponse<List<MapDto>> selectPwhintList() {
List<MapDto> PwhintList = commoncodservice.selectPwhintList();
return ApiResponse.ok(PwhintList);
}

View File

@ -39,5 +39,4 @@ public interface NetmemberMapper {
int updatePassword(MapDto map);
List<MapDto> getallUserList();
}

View File

@ -32,4 +32,6 @@ public interface NetprojctMapper {
int updateProjectMember(MapDto map);
List<MapDto> selectProjectMembers(int projctSeq);
List<MapDto> selectProjectLog(int projctSeq);
}

View File

@ -87,6 +87,16 @@ public class NetprojctService {
public List<MapDto> getProjectMembers(int projctSeq) {
return netprojctMapper.selectProjectMembers(projctSeq);
}
/**
* 프로젝트 log 조회
*
* @param
* @return
*/
public List<MapDto> selectProjectLog(int projctSeq) {
return netprojctMapper.selectProjectLog(projctSeq);
}
}

View File

@ -28,7 +28,7 @@ public class commoncodService {
private final commoncodMapper commoncodmapper;
public List<MapDto> getWordCategory() {
public List<MapDto> selectWordCategory() {
return commoncodmapper.getWordCategory();
}
@ -36,23 +36,23 @@ public class commoncodService {
return commoncodmapper.insertCategory(map);
}
public List<MapDto> getColorList(String type) {
public List<MapDto> selectColorList(String type) {
return commoncodmapper.getColorList(type);
}
public List<MapDto> getMbtiList() {
public List<MapDto> selectMbtiList() {
return commoncodmapper.getMbtiList();
}
public List<MapDto> getYearCategories() {
public List<MapDto> selectYearCategories() {
return commoncodmapper.getYearCategories();
}
public List<MapDto> getPwhintList() {
public List<MapDto> selectPwhintList() {
return commoncodmapper.getPwhintList();
}
public List<MapDto> getCategoryList() {
public List<MapDto> selectCategoryList() {
return commoncodmapper.getCategories();
}
}

View File

@ -30,7 +30,7 @@
CMNCODLV1 = 600;
</insert>
<select id="getColorList" resultType="Map">
<select id="selectColorList" resultType="Map">
SELECT
CMNCODVAL
,CMNCODNAM
@ -48,7 +48,7 @@
</if>
</select>
<select id="getMbtiList" resultType="Map">
<select id="selectMbtiList" resultType="Map">
SELECT
CMNCODVAL
,CMNCODNAM
@ -60,7 +60,7 @@
CMNCODODR != 0
</select>
<select id="getPwhintList" resultType="Map">
<select id="selectPwhintList" resultType="Map">
SELECT
CMNCODVAL
,CMNCODNAM
@ -84,12 +84,24 @@
WHERE CMNCODVAL = #{color};
</update>
<update id="updateColorChange" parameterType="Map">
UPDATE commoncod
SET
<if test="type == 'YON'">
CMNCODYON = 0
</if>
<if test="type == 'YNP'">
CMNCODYNP = 0
</if>
WHERE CMNCODVAL = #{color};
</update>
<select id="getCategories" resultType="Map">
SELECT CMNCODVAL, CMNCODNAM FROM commoncod
WHERE CMNCODVAL BETWEEN 300101 AND 300103
</select>
<select id="getYearCategories" resultType="Map">
<select id="selectYearCategories" resultType="Map">
SELECT
CMNCODVAL
,CMNCODNAM

View File

@ -4,9 +4,13 @@
<!-- 프로젝트 목록 조회 -->
<select id="selectProject" parameterType="map" resultType="io.company.localhost.common.dto.MapDto">
SELECT *
FROM netprojct
ORDER BY PROJCTSEQ DESC
SELECT
p.*,
c .CMNCODNAM AS projctcolor
FROM netprojct p
LEFT JOIN commoncod c ON p.PROJCTCOL = c.CMNCODVAL
WHERE c.CMNCODYON = '1'
ORDER BY p.PROJCTSEQ DESC
</select>
<!-- 프로젝트 등록 -->
@ -63,5 +67,19 @@
WHERE pm.PROJCTSEQ = #{projctSeq}
</select>
<!-- 프로젝트 로그 조회 -->
<select id="selectProjectLog" parameterType="int" resultType="map">
SELECT
DATE_FORMAT(PROJCTCDT, '%Y-%m-%d %H:%i') as createDate,
PROJCTCMB as creator,
CASE
WHEN PROJCTUDT IS NOT NULL THEN DATE_FORMAT(PROJCTUDT, '%Y-%m-%d %H:%i')
ELSE NULL
END as updateDate,
PROJCTUMB as updater
FROM netprojct
WHERE PROJCTSEQ = #{projctSeq}
</select>
</mapper>