<?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="com.bsmlab.dfx.agent.listener.dto.ListenerMapper">
	<select id="selectReceiveMessageCountByPk" parameterType="com.bsmlab.dfx.agent.listener.dto.ReceiveMessageDto" resultType="int">
		SELECT COUNT(*) AS COUNTER
		FROM TB_RECEIVE_MESSAGE
		WHERE SENDER_HOST_ID = #{senderHostId}
			AND MESSAGE_UUID = #{messageUuid}
	</select>
	<insert id="insertReceiveMessage" parameterType="com.bsmlab.dfx.agent.listener.dto.ReceiveMessageDto">
		INSERT INTO TB_RECEIVE_MESSAGE (
			SENDER_HOST_ID, SENDER_TIMESTAMP, MESSAGE_UUID, MESSAGE_TYPE, RECEIVED_TIMESTAMP, RECIPIENT_HOST_ID, RECIPIENT_DROP_BOX, DATA, PROCESS_STATUS
		)
		VALUES (
			#{senderHostId}, #{senderTimestamp}, #{messageUuid}, #{messageType}, #{receivedTimestamp}, #{recipientHostId}, #{recipientDropBox}, #{data: CLOB}, #{processStatus}
		);
	</insert>
</mapper>
