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
@GetMapping("/color")
public ApiResponse<List<MapDto>> getColorList() {
List<MapDto> ColorList = commoncodservice.getColorList();
public ApiResponse<List<MapDto>> getColorList(String type) {
List<MapDto> ColorList = commoncodservice.getColorList(type);
return ApiResponse.ok(ColorList);
}

View File

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

View File

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

View File

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

View File

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