imboard
Version:
Most convenient platform for webpage development.
62 lines (58 loc) • 2.48 kB
text/xml
<mapper namespace="boardAuth">
<resultMap type="BoardAuthVo" id="boardAuthResult">
<result column="BOARD_ID" property="boardId" />
<result column="VIEW_LIST_LEVEL" property="viewListLevel" />
<result column="VIEW_DETAIL_LEVEL" property="viewDetailLevel" />
<result column="WRITE_LEVEL" property="writeLevel"/>
<result column="WRITE_COMMENT_LEVEL" property="writeLevel"/>
</resultMap>
<select id="getBoardAuth" parameterType="string" resultMap="boardAuthResult">
SELECT
BOARD_ID,
VIEW_LIST_LEVEL,
VIEW_DETAIL_LEVEL,
WRITE_LEVEL,
WRITE_COMMENT_LEVEL
FROM
IMB_BOARD_AUTH
WHERE
BOARD_ID = #{boardId}
</select>
<insert id="insertBoardAuth" parameterType="BoardAuthVo">
INSERT IMB_BOARD_AUTH
(
BOARD_ID
<if test="#{viewListLevel}">, VIEW_LIST_LEVEL</if>
<if test="#{viewDetailLevel">, VIEW_DETAIL_LEVEL</if>
<if test="#{writeLevel}">, WRITE_LEVEL</if>
<if test="#{writeCommentLevel}">, WRITE_COMMENT_LEVEL</if>
)
VALUES
(
#{boardId}
<if test="#{viewListLevel}">, #{viewListLevel}</if>
<if test="#{viewDetailLevel">, #{viewDetailLevel}</if>
<if test="#{writeLevel}">, #{writeLevel}</if>
<if test="#{writeCommentLevel}">, #{writeCommentLevel}</if>
)
</insert>
<update id="updateBoardAuth" parameterType="BoardAuthVo">
UPDATE
IMB_BOARD_AUTH
SET
VIEW_LIST_LEVEL = <choose><when test="#{viewListLevel}">#{viewListLevel}</when><otherwise>NULL</otherwise></choose>,
WRITE_LEVEL = <choose><when test="#{writeLevel}">#{writeLevel}</when><otherwise>NULL</otherwise></choose>,
VIEW_DETAIL_LEVEL = <choose><when test="#{viewDetailLevel}">#{viewDetailLevel}</when><otherwise>NULL</otherwise></choose>,
WRITE_COMMENT_LEVEL = <choose><when test="#{writeCommentLevel}">#{writeCommentLevel}</when><otherwise>NULL</otherwise></choose>
WHERE
BOARD_ID = #{boardId}
</update>
<delete id="deleteBoardAuth" parameterType="string">
DELETE FROM
IMB_BOARD_AUTH
WHERE
BOARD_ID = #{boardId}
</delete>
</mapper>