<?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.i2sema.v2.friendtalk.plus.message.dao.FriendtalkPlusMessageDao">

	<insert id="insertFriendtalkPlusMcd">
	INSERT INTO frn_pls_mcd (
		noti_id,
		noti_group_id,
		custom_key,
		t_seq,
		mber_no,
		org_id,
		data_extension_obj,
		mt_refkey,
		reserve_yn,
		date_client_req,
		message_type,
		recipient_num,
		send_yn,
		failback_yn
		) VALUES (
		#{notiId},
		#{notiGroupId},
		#{customKey},
		#{seq},
		#{mberNo},
		#{orgId},
		#{dataExtensionsObj},
		#{mtRefkey},
		#{reserveYn},
		#{dateClientReq},
		#{messageType},
		#{recipientNum},
		#{sendYn},
		#{failbackYn}
		)
	</insert>

	<insert id="upsertTdataDetail">
		INSERT INTO frn_pls_tdata_detail (
			yyyy_mm_dd,
			t_seq,
			all_cnt
		) VALUES (
		  #{today},
		  #{tSeq},
		  1
	 ) ON DUPLICATE KEY UPDATE all_cnt = all_cnt + 1, finish_send_date = #{updateDate}

	</insert>

</mapper>
