<c:when test="${not empty userVO.id}">
${userVO.name} 님 환영합니다
<span id="user-logout-button">로그아웃</span>
<span id="user-info-form"><i class="fas fa-user fa-2x"></i></span>
</c:when>
alter table user add USER_DEL boolean DEFAULT '0';
private boolean userDel; // userVO에 추가
<select id="getUserVO" parameterType="String" resultType="UserVO">
SELECT user_seq as userSeq
, id
, password
, name
, user_del as userDel
FROM user
WHERE id = #{id}
AND user_del != 1
</select>
<update id="updateUserDelFlag" parameterType="Long">
UPDATE user
SET user_del = 1
WHERE user_seq = #{userSeq}
</update>
@Override
public ResultMap updateUserDelFlag(final Long userSeq, HttpSession session) throws Exception {
int result = dao.updateUserDelFlag(userSeq);
if(0 == result) {
throw new LogicException("609", "알 수 없는 에러로 회원탈퇴에 실패했습니다");
}
session.invalidate();
ResultMap resultMap = new ResultMap();
resultMap.setStatus("200");
resultMap.setMsg("");
return resultMap;
}
alter table board add BOARD_DEL boolean DEFAULT '0';
private boolean boardDel; // boardVO에 추가
<!-- 게시물 삭제 시 플래그 수정 -->
<delete id="updateBoardDelFlag" parameterType="Long">
UPDATE board
SET board_del = 1
WHERE board_seq = #{boardSeq}
</delete>
<!-- 검색 조건 수정 -->
<sql id="searchBoard">
<choose>
<when test="searchType != null and searchValue != null">
<choose>
<when test='searchType == "T"'>
WHERE (TITLE LIKE CONCAT('%',#{searchValue},'%')
AND BOARD_DEL = 0)
</when>
<when test='searchType == "C"'>
WHERE (CONTENTS LIKE CONCAT('%',#{searchValue},'%')
AND BOARD_DEL = 0)
</when>
<when test='searchType == "W"'>
WHERE (WRITER LIKE CONCAT('%',#{searchValue},'%')
AND BOARD_DEL = 0)
</when>
<when test='searchType == "A"'>
WHERE (TITLE LIKE CONCAT('%',#{searchValue},'%') OR CONTENTS LIKE CONCAT('%',#{searchValue},'%'))
AND BOARD_DEL = 0
</when>
<otherwise>
WHERE BOARD_DEL = 0
</otherwise>
</choose>
</when>
<otherwise>
WHERE BOARD_DEL = 0
</otherwise>
</choose>
</sql>
public int updateBoardDelFlag(Long boardSeq) {
return update("board.updateBoardDelFlag", boardSeq);
}