updateColorYon map으로 변경

This commit is contained in:
yoon 2025-02-13 15:19:04 +09:00
parent 712ae8e9c2
commit 7c3f646b36
5 changed files with 37 additions and 15 deletions

View File

@ -71,8 +71,8 @@ public class UserController {
*/ */
@ParameterCheck @ParameterCheck
@GetMapping("/color") @GetMapping("/color")
public ApiResponse<List<MapDto>> getColorList() { public ApiResponse<List<MapDto>> getColorList(String type) {
List<MapDto> ColorList = commoncodservice.getColorList(); List<MapDto> ColorList = commoncodservice.getColorList(type);
return ApiResponse.ok(ColorList); return ApiResponse.ok(ColorList);
} }

View File

@ -27,13 +27,13 @@ public interface commoncodMapper {
Long insertCategory(MapDto map); Long insertCategory(MapDto map);
List<MapDto> getColorList(); List<MapDto> getColorList(String type);
List<MapDto> getMbtiList(); List<MapDto> getMbtiList();
List<MapDto> getPwhintList(); List<MapDto> getPwhintList();
int updateColorYon(String color); int updateColorYon(MapDto map);
List<MapDto> getYearCategories(); List<MapDto> getYearCategories();

View File

@ -1,7 +1,7 @@
/************************************************************ /************************************************************
* *
* @packageName : io.company.localhost.RegisterService * @packageName : io.company.localhost.NetmemberService
* @fileName : RegisterService.java * @fileName : NetmemberService.java
* @author : 박지윤 * @author : 박지윤
* @date : 25.01.17 * @date : 25.01.17
* @description : * @description :
@ -65,7 +65,13 @@ public class NetmemberService {
// 선택한 색상 코드 사용 처리 // 선택한 색상 코드 사용 처리
String color = map.getString("memberCol"); String color = map.getString("memberCol");
commoncodMapper.updateColorYon(color);
// 색상 코드를 MapDto로 감싸서 전달
MapDto colorMap = new MapDto();
colorMap.put("color", color);
colorMap.put("type", "YON");
commoncodMapper.updateColorYon(colorMap);
return result; return result;
} }

View File

@ -36,8 +36,8 @@ public class commoncodService {
return commoncodmapper.insertCategory(map); return commoncodmapper.insertCategory(map);
} }
public List<MapDto> getColorList() { public List<MapDto> getColorList(String type) {
return commoncodmapper.getColorList(); return commoncodmapper.getColorList(type);
} }
public List<MapDto> getMbtiList() { public List<MapDto> getMbtiList() {

View File

@ -40,8 +40,12 @@
CMNCODLV1 = 100 CMNCODLV1 = 100
AND AND
CMNCODODR != 0 CMNCODODR != 0
AND <if test="type == 'YON'">
CMNCODYON = 0 AND CMNCODYON = 0
</if>
<if test="type == 'YNP'">
AND CMNCODYNP = 0
</if>
</select> </select>
<select id="getMbtiList" resultType="Map"> <select id="getMbtiList" resultType="Map">
@ -68,9 +72,15 @@
CMNCODODR != 0 CMNCODODR != 0
</select> </select>
<update id="updateColorYon" parameterType="String"> <update id="updateColorYon" parameterType="Map">
UPDATE commoncod UPDATE commoncod
SET CMNCODYON = 1 SET
<if test="type == 'YON'">
CMNCODYON = 1
</if>
<if test="type == 'YNP'">
CMNCODYNP = 1
</if>
WHERE CMNCODVAL = #{color}; WHERE CMNCODVAL = #{color};
</update> </update>
@ -92,5 +102,11 @@
</select> </select>
<update id="updateColorYnp" parameterType="String">
UPDATE commoncod
SET CMNCODYNP = 1
WHERE CMNCODVAL = #{color};
</update>
</mapper> </mapper>