<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper   PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="">
	
	<select id="selectList" parameterType="" resultType="">
		SELECT CHAT_ID, USER_ID, ROOM_ID, CHAT_CONT, UN_USER, REG_DAY, DEL_DAY, REC_ST FROM CT_MSG
		WEHRE CHAT_ID = #{chatId}
	</select>

	<insert id="doInsert">
		insert into CT_MSG(CHAT_ID, USER_ID, ROOM_ID, CHAT_CONT, UN_USER, REG_DT, DEL_DAY, REC_ST)
		values(#{chatId}, #{userId}, #{roomId}, #{chatCont}, #{unUser}, #{regDt}, #{delDay}, #{recSt})
	</insert>

	<update id="doUpdate">
		update CT_MSG
		set
		CHAT_ID = #{chatId},  <!--채팅ID-->
		USER_ID = #{userId},  <!--유저ID-->
		ROOM_ID = #{roomId},  <!--채팅방ID-->
		CHAT_CONT = #{chatCont},  <!--채닝내용-->
		UN_USER = #{unUser},  <!--미확인사용자수-->
		REG_DT = #{regDt},  <!--등록일시-->
		DEL_DAY = #{delDay},  <!--삭제일시-->
		REC_ST = #{recSt}  <!--레코드상태-->
		where CHAT_ID = #{chatId}
	</update>

	<delete id="doDelete">
		delete from CT_MSG
		where CHAT_ID = #{chatId}
	</delete>
</mapper>
