<?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="cokr.xit.fims.cmmn.dao.LinkMapper">

<insert id="insertElectronicNoticeSndngMaster" parameterType="map">
/* 전자고지 발송 마스터 정보 등록(linkMapper.insertElectronicNoticeSndngMaster) */
<selectKey resultType="string" keyProperty="unitySndngMastrId" keyColumn="NEW_ID" order="BEFORE">
	<include refid="numbering.keyByYear">
		<property name="TABLE_NAME" value="TB_CNTC_SNDNG_MASTR" />
		<property name="TABLE_KEY" value="UNITY_SNDNG_MASTR_ID" />
		<property name="pad" value="20" />
	</include>
</selectKey>
INSERT 
  INTO TB_CNTC_SNDNG_MASTR (
       UNITY_SNDNG_MASTR_ID
     , SIGNGU_CODE
     , FFNLG_CODE
     , TMPLAT_ID
     , SNDNG_TY_CODE
     , SNDNG_CO
     , SNDNG_PROCESS_STTUS
     , SNDNG_DT
     , CLOS_DT
     , ERROR_CODE
     , ERROR_MSSAGE
     , REGIST_DT
     , REGISTER
     , UPDT_DT
     , UPDUSR
  ) VALUES (
       #{unitySndngMastrId}
     , #{signguCode}
     , #{ffnlgCode}
     , #{tmplatId}
     , 'ENS'
     , #{sndngCo}
     , 'accept'
     , #{sndngDt}
     , #{closDt}
     , #{errorCode}
     , #{errorMssage}
     , <include refid="utility.now" />
     , #{register}
     , <include refid="utility.now" />
     , #{updusr}
  )
</insert>

<insert id="insertElectronicNoticeSndngDetail" parameterType="map">
/* 전자고지 발송 디테일 정보 등록(linkMapper.insertElectronicNoticeSndngDetail) */
<selectKey resultType="string" keyProperty="unitySndngDetailId" keyColumn="NEW_ID" order="BEFORE">
	<include refid="numbering.keyByYear">
		<property name="TABLE_NAME" value="TB_CNTC_SNDNG_DETAIL" />
		<property name="TABLE_KEY" value="UNITY_SNDNG_DETAIL_ID" />
		<property name="pad" value="20" />
	</include>
</selectKey>
INSERT 
  INTO TB_CNTC_SNDNG_DETAIL (
       UNITY_SNDNG_DETAIL_ID
     , UNITY_SNDNG_MASTR_ID
     , SIGNGU_CODE
     , FFNLG_CODE
     , MAIN_CODE
     , VHCLE_NO
     , IHIDNUM
     , MOBLPHON_NO
     , NM
     , ADRES
     , DETAIL_ADRES
     , ZIP
     , TMPLT_MSG_DATA
     , MOBILE_PAGE_CN
     , USE_INSTT_IDNTFC_ID
     , EXTERNAL_DOCUMENT_UUID
     , REGIST_DT
     , REGISTER
     , UPDT_DT
     , UPDUSR
  ) VALUES (
       #{unitySndngDetailId}
     , #{unitySndngMastrId}
     , #{signguCode}
     , #{ffnlgCode}
     , #{mainCode}
     , #{vhcleNo}
     , #{ihidnum}
     , #{moblphonNo}
     , #{nm}
     , #{adres}
     , #{detailAdres}
     , #{zip}
     , #{tmpltMsgData}
     , #{mobilePageCn}
     , #{useInsttIdntfcId}
     , #{externalDocumentUuid}
     , <include refid="utility.now" />
     , #{register}
     , <include refid="utility.now" />
     , #{updusr}
  )
</insert>

</mapper>