|
|
|
|
<?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="kr.xit.biz.ens.mapper.IEnsBatchMapper">
|
|
|
|
|
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<!-- ================================ accept =========================================== -->
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<select id="selectAcceptTgts" resultType="kr.xit.biz.ens.model.cmm.SndngMssageParam">
|
|
|
|
|
/** ens-mysql-mapper|selectAcceptTgts-통합 발송 접수 대상 조회|julim */
|
|
|
|
|
SELECT tcsm.elctrn_ntic_sndng_id AS unitySndngMastrId
|
|
|
|
|
, tcsm.nht_tmplat_id AS tmplatId
|
|
|
|
|
, tcsm.sndng_co
|
|
|
|
|
, tcsm.sndng_process_sttus
|
|
|
|
|
, tcsm.sndng_dt
|
|
|
|
|
, tetm.try1
|
|
|
|
|
, tetm.try2
|
|
|
|
|
, tetm.try3
|
|
|
|
|
, tetm.try2_minute
|
|
|
|
|
, tetm.try3_minute
|
|
|
|
|
FROM tb_elctrn_ntic_sndng tcsm
|
|
|
|
|
JOIN tb_ens_tmplat_manage tetm
|
|
|
|
|
ON tcsm.nht_tmplat_id = tetm.tmplat_id
|
|
|
|
|
WHERE tcsm.sndng_process_sttus = #{sndngProcessSttus}
|
|
|
|
|
AND tetm.signgu_code = #{signguCode}
|
|
|
|
|
AND tetm.ffnlg_code = #{ffnlgCode}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertUnitySndngMst">
|
|
|
|
|
/** ens-mysql-mapper|insertUnitySndngMst-통합발송마스터 생성|julim */
|
|
|
|
|
INSERT
|
|
|
|
|
INTO tb_ens_unity_sndng_mastr (
|
|
|
|
|
unity_sndng_mastr_id, /* 통합발송마스터 ID */
|
|
|
|
|
signgu_code, /* 시군구 코드 */
|
|
|
|
|
ffnlg_code, /* 과태료 코드 */
|
|
|
|
|
tmplat_id, /* 템플릿 Id */
|
|
|
|
|
sndng_ty_code, /* 발송유형 코드 */
|
|
|
|
|
sndng_co, /* 발송건수 */
|
|
|
|
|
sndng_process_sttus, /* 발송처리 상태 */
|
|
|
|
|
sndng_dt_1, /* 발송 일시 */
|
|
|
|
|
sndng_dt_2, /* 발송 일시2 */
|
|
|
|
|
sndng_dt_3, /* 발송 일시3 */
|
|
|
|
|
try1,
|
|
|
|
|
try2,
|
|
|
|
|
try3,
|
|
|
|
|
try_cnt,
|
|
|
|
|
clos_dt, /* 마감일시 */
|
|
|
|
|
regist_dt,
|
|
|
|
|
register
|
|
|
|
|
)
|
|
|
|
|
SELECT tcsm.elctrn_ntic_sndng_id /* 통합발송마스터 ID */
|
|
|
|
|
, tetm.signgu_code /* 시군구 코드 */
|
|
|
|
|
, tetm.ffnlg_code /* 과태료 코드 */
|
|
|
|
|
, tcsm.nht_tmplat_id /* 템플릿 Id */
|
|
|
|
|
, tetm.sndng_ty_code /* 발송유형 코드 */
|
|
|
|
|
, tcsm.sndng_co /* 발송건수 */
|
|
|
|
|
, 'accept-ok' /* 발송처리 상태 */
|
|
|
|
|
, tcsm.sndng_dt
|
|
|
|
|
, #{sndngDt2}
|
|
|
|
|
, #{sndngDt3}
|
|
|
|
|
, tetm.try1
|
|
|
|
|
, tetm.try2
|
|
|
|
|
, tetm.try3
|
|
|
|
|
, CASE WHEN IFNULL(tetm.try3, '') != ''
|
|
|
|
|
THEN 3
|
|
|
|
|
ELSE IF(IFNULL(tetm.try2, '') != '', 2, 1)
|
|
|
|
|
END /* try3 값이 있으면 3, try2 값이 있으면 2, try1 */
|
|
|
|
|
, clos_dt /* 마감일시 */
|
|
|
|
|
, now()
|
|
|
|
|
, 'batch'
|
|
|
|
|
FROM tb_elctrn_ntic_sndng tcsm
|
|
|
|
|
JOIN tb_ens_tmplat_manage tetm
|
|
|
|
|
ON tcsm.nht_tmplat_id = tetm.tmplat_id
|
|
|
|
|
WHERE tcsm.elctrn_ntic_sndng_id = #{unitySndngMastrId}
|
|
|
|
|
AND tcsm.sndng_process_sttus = #{sndngProcessSttus}
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<insert id="insertUnitySndngDtls">
|
|
|
|
|
/** ens-mysql-mapper|insertUnitySndngDtls-통합발송상세 생성|julim */
|
|
|
|
|
INSERT INTO tb_ens_unity_sndng_detail (
|
|
|
|
|
unity_sndng_detail_id, /* 통합발송상세 ID*/
|
|
|
|
|
unity_sndng_mastr_id, /* 통합발송마스터 ID */
|
|
|
|
|
signgu_code, /* 시군구 코드 */
|
|
|
|
|
ffnlg_code, /* 과태료 코드 */
|
|
|
|
|
main_code,
|
|
|
|
|
ihidnum, /* 주민번호 */
|
|
|
|
|
tmplt_msg_data, /* 템플릿메세지 데이타 */
|
|
|
|
|
mobile_page_cn, /* 모바일페이지내용 */
|
|
|
|
|
use_instt_idntfc_id, /* 이용기관식별Id*/
|
|
|
|
|
regist_dt,
|
|
|
|
|
register
|
|
|
|
|
)
|
|
|
|
|
SELECT tcsd.elctrn_ntic_sndng_detail_id /* 통합발송상세 ID*/
|
|
|
|
|
, tcsd.elctrn_ntic_sndng_id /* 통합발송마스터 ID */
|
|
|
|
|
, tetm.signgu_code /* 시군구 코드 */
|
|
|
|
|
, tetm.ffnlg_code /* 과태료 코드 */
|
|
|
|
|
, tcsd.main_code
|
|
|
|
|
, tcsd.ihidnum /* 주민번호 */
|
|
|
|
|
, tcsd.tmplt_msg_data /* 템플릿메세지 데이타 */
|
|
|
|
|
, tcsd.mobile_page_cn /* 모바일페이지내용 */
|
|
|
|
|
, tcsd.use_instt_idntfc_id /* 이용기관식별Id*/
|
|
|
|
|
, now()
|
|
|
|
|
, 'batch'
|
|
|
|
|
FROM tb_elctrn_ntic_sndng tcsm
|
|
|
|
|
JOIN tb_ens_tmplat_manage tetm
|
|
|
|
|
ON tcsm.nht_tmplat_id = tetm.tmplat_id
|
|
|
|
|
JOIN tb_elctrn_ntic_sndng_detail tcsd
|
|
|
|
|
ON tcsm.elctrn_ntic_sndng_id = tcsd.elctrn_ntic_sndng_id
|
|
|
|
|
WHERE tcsm.elctrn_ntic_sndng_id = #{unitySndngMastrId}
|
|
|
|
|
AND tcsm.sndng_process_sttus = #{sndngProcessSttus}
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateProcessSttusCntcSndngMst">
|
|
|
|
|
/** ens-mysql-mapper|updateProcessSttusCntcSndngMst-연계발송마스터 상태 변경|julim */
|
|
|
|
|
UPDATE tb_elctrn_ntic_sndng
|
|
|
|
|
SET sndng_process_sttus = #{newSndngProcessSttus}
|
|
|
|
|
, error_cn = #{errorCode}
|
|
|
|
|
, error_dtls = #{errorMssage}
|
|
|
|
|
, updt_dt = now()
|
|
|
|
|
, updusr = 'batch'
|
|
|
|
|
WHERE elctrn_ntic_sndng_id = #{unitySndngMastrId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<select id="selectCiByIhidnum" resultType="map">
|
|
|
|
|
/** ens-mysql-mapper|selectCiByIhidnum-주민번호로 ci 조회|julim */
|
|
|
|
|
SELECT teim.ihidnum_manage_id AS ihidnumManageId
|
|
|
|
|
, tecm.ci
|
|
|
|
|
FROM tb_ens_ihidnum_manage teim
|
|
|
|
|
LEFT JOIN tb_ens_ci_manage tecm
|
|
|
|
|
ON teim.ihidnum_manage_id = tecm.ihidnum_manage_id
|
|
|
|
|
WHERE teim.ihidnum = #{ihidnum}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertIhidnumManage" parameterType="map">
|
|
|
|
|
/** ens-mysql-mapper|insertIhidnumManage-주민번호로 관리 데이타 생성|julim */
|
|
|
|
|
<selectKey keyProperty="ihidnumManageId" resultType="string" order="BEFORE">
|
|
|
|
|
SELECT nextval(tb_ens_ihidnum_manage_seq)
|
|
|
|
|
</selectKey>
|
|
|
|
|
INSERT INTO tb_ens_ihidnum_manage (
|
|
|
|
|
ihidnum_manage_id,
|
|
|
|
|
ihidnum,
|
|
|
|
|
regist_dt,
|
|
|
|
|
register
|
|
|
|
|
) VALUES (
|
|
|
|
|
#{ihidnumManageId},
|
|
|
|
|
#{ihidnum},
|
|
|
|
|
now(),
|
|
|
|
|
'batch'
|
|
|
|
|
)
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<insert id="insertCiManage" parameterType="map">
|
|
|
|
|
/** ens-mysql-mapper|insertCiManage-CI 관리 데이타 생성|julim */
|
|
|
|
|
INSERT INTO tb_ens_ci_manage (
|
|
|
|
|
ihidnum_manage_id,
|
|
|
|
|
ci,
|
|
|
|
|
regist_dt,
|
|
|
|
|
register
|
|
|
|
|
) VALUES (
|
|
|
|
|
#{ihidnumManageId},
|
|
|
|
|
#{ci},
|
|
|
|
|
now(),
|
|
|
|
|
'batch'
|
|
|
|
|
)
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<!-- ================================ accept =========================================== -->
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<!-- ================================ make ============================================= -->
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<select id="selectMakeTgts" resultType="kr.xit.biz.ens.model.cmm.SndngMssageParam">
|
|
|
|
|
/** ens-mysql-mapper|selectMakeTgts-통합발송 생성 대상 조회|julim */
|
|
|
|
|
SELECT unity_sndng_mastr_id
|
|
|
|
|
, tmplat_id
|
|
|
|
|
, sndng_co
|
|
|
|
|
, try1
|
|
|
|
|
, try2
|
|
|
|
|
, try3
|
|
|
|
|
, try_cnt
|
|
|
|
|
, sndng_process_sttus
|
|
|
|
|
, signgu_code
|
|
|
|
|
, ffnlg_code
|
|
|
|
|
FROM tb_ens_unity_sndng_mastr
|
|
|
|
|
WHERE sndng_process_sttus = #{sndngProcessSttus}
|
|
|
|
|
AND signgu_code = #{signguCode}
|
|
|
|
|
AND ffnlg_code = #{ffnlgCode}
|
|
|
|
|
<if test="sndngProcessSttus == 'sending1'">
|
|
|
|
|
AND sndng_dt_2 < date_format(now(), '%Y%m%d%H%i%S')
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectKkopaySendOkTgts" resultType="int">
|
|
|
|
|
/** ens-mysql-mapper|selectKkopaySendOkTgts-카카오페이 2차 발송 대상 건수 조회|seojh */
|
|
|
|
|
SELECT count(1)
|
|
|
|
|
FROM tb_ens_sndng_mastr tesm
|
|
|
|
|
JOIN tb_ens_kakao_my_doc tekmd
|
|
|
|
|
ON tesm.sndng_mastr_id = tekmd.sndng_mastr_id
|
|
|
|
|
WHERE tesm.unity_sndng_mastr_id = #{unitySndngMastrId}
|
|
|
|
|
AND tesm.signgu_code = #{signguCode}
|
|
|
|
|
AND tesm.ffnlg_code = #{ffnlgCode}
|
|
|
|
|
AND (NOT (tekmd.doc_box_status = 'READ' AND tekmd.error_code IS NULL) OR (tekmd.doc_box_status IS NULL and tekmd.error_code IS NULL))
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectKkotalkSendOkTgts" resultType="int">
|
|
|
|
|
/** ens-mysql-mapper|selectKkotalkSendOkTgts-카카오톡 2차 발송 대상 건수 조회|seojh */
|
|
|
|
|
SELECT count(1)
|
|
|
|
|
FROM tb_ens_sndng_mastr tesm
|
|
|
|
|
JOIN tb_ens_kakao_d10 tekd
|
|
|
|
|
ON tesm.sndng_mastr_id = tekd.sndng_mastr_id
|
|
|
|
|
WHERE tesm.unity_sndng_mastr_id = #{unitySndngMastrId}
|
|
|
|
|
AND tesm.signgu_code = #{signguCode}
|
|
|
|
|
AND tesm.ffnlg_code = #{ffnlgCode}
|
|
|
|
|
AND (NOT (tekd.status = 'READ' AND tekd.error_code IS NULL) OR (tekd.status IS NULL and tekd.error_code IS NULL))
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertSndngMst">
|
|
|
|
|
/** ens-mysql-mapper|insertSndngMst-발송마스터 생성|julim */
|
|
|
|
|
<selectKey keyProperty="sndngMastrId" resultType="string" order="BEFORE">
|
|
|
|
|
SELECT concat(date_format(now(), '%Y%m%d'), LPAD(NEXTVAL(tb_ens_sndng_mastr_seq), 12, '0'))
|
|
|
|
|
FROM dual
|
|
|
|
|
</selectKey>
|
|
|
|
|
INSERT INTO tb_ens_sndng_mastr (
|
|
|
|
|
sndng_mastr_id, /* 발송마스터 ID*/
|
|
|
|
|
unity_sndng_mastr_id, /* 통합발송마스터 ID */
|
|
|
|
|
signgu_code, /* 시군구 코드 */
|
|
|
|
|
ffnlg_code, /* 과태료 코드 */
|
|
|
|
|
tmplat_id, /* 템플릿 Id */
|
|
|
|
|
sndng_ty_code, /* 발송유형 코드 */
|
|
|
|
|
sndng_se_code, /* 발송구분 코드 */
|
|
|
|
|
sndng_co, /* 발송건수 */
|
|
|
|
|
try_seq,
|
|
|
|
|
try_cnt,
|
|
|
|
|
sndng_process_sttus, /* 발송처리 상태 */
|
|
|
|
|
sndng_dt, /* 발송일시 */
|
|
|
|
|
clos_dt, /* 마감일시 */
|
|
|
|
|
regist_dt,
|
|
|
|
|
register
|
|
|
|
|
)
|
|
|
|
|
SELECT #{sndngMastrId}
|
|
|
|
|
, teusm.unity_sndng_mastr_id /* 통합발송마스터 ID */
|
|
|
|
|
, teusm.signgu_code /* 시군구 코드 */
|
|
|
|
|
, teusm.ffnlg_code /* 과태료 코드 */
|
|
|
|
|
, teusm.tmplat_id /* 템플릿 Id */
|
|
|
|
|
, teusm.sndng_ty_code /* 발송유형 코드 */
|
|
|
|
|
, #{sndngSeCode} /* 발송구분 코드 */
|
|
|
|
|
, #{sndngCo} /* 발송건수 */
|
|
|
|
|
, #{trySeq}
|
|
|
|
|
, teusm.try_cnt
|
|
|
|
|
, 'make-ok' /* 발송처리 상태 */
|
|
|
|
|
, CASE WHEN #{trySeq}=3 THEN teusm.sndng_dt_3
|
|
|
|
|
WHEN #{trySeq}=2 THEN teusm.sndng_dt_2
|
|
|
|
|
ELSE teusm.sndng_dt_1
|
|
|
|
|
END /* 1차, 2차, 3차에 따른 발송일시 */
|
|
|
|
|
, teusm.clos_dt /* 마감일시 */
|
|
|
|
|
, now()
|
|
|
|
|
, 'batch'
|
|
|
|
|
FROM tb_ens_unity_sndng_mastr teusm
|
|
|
|
|
WHERE teusm.unity_sndng_mastr_id = #{unitySndngMastrId}
|
|
|
|
|
AND teusm.sndng_process_sttus = #{sndngProcessSttus}
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<insert id="insertKakaopay">
|
|
|
|
|
/** ens-mysql-mapper|insertKakaopay-카카오내문서함 생성|julim */
|
|
|
|
|
INSERT
|
|
|
|
|
INTO tb_ens_kakao_my_doc (
|
|
|
|
|
sndng_detail_id, /* 발송상세ID */
|
|
|
|
|
unity_sndng_detail_id, /* 통합발송상세ID */
|
|
|
|
|
sndng_mastr_id, /* 발송마스터ID */
|
|
|
|
|
signgu_code, /* 시군구코드 */
|
|
|
|
|
ffnlg_code, /* 과태료코드 */
|
|
|
|
|
title, /* 제목 */
|
|
|
|
|
hash,
|
|
|
|
|
common_categories,
|
|
|
|
|
read_expired_at, /* 처리마감시간 */
|
|
|
|
|
recv_phone_number, /* 받는이 전화번호 */
|
|
|
|
|
recv_name, /* 받는이 이름 */
|
|
|
|
|
recv_birthday, /* 받는이 생년월일 */
|
|
|
|
|
recv_is_required_verify_name, /* 성명검증옵션 */
|
|
|
|
|
prop_link, /* 모바일페이지 URL */
|
|
|
|
|
prop_payload,
|
|
|
|
|
prop_message,
|
|
|
|
|
prop_cs_number, /* 고객센터 전화번호 */
|
|
|
|
|
prop_cs_name, /* 고객센터 명 */
|
|
|
|
|
external_document_uuid, /* 외부문서 식별번호 */
|
|
|
|
|
regist_dt,
|
|
|
|
|
register
|
|
|
|
|
)
|
|
|
|
|
SELECT LPAD(NEXTVAL(sndng_detail_id_seq), 20, '0')
|
|
|
|
|
, teusd.unity_sndng_detail_id
|
|
|
|
|
, #{sndngMastrId}
|
|
|
|
|
, teusm.signgu_code
|
|
|
|
|
, teusm.ffnlg_code
|
|
|
|
|
, CASE WHEN teusm.signgu_code='88328' THEN CONCAT(tetm.tmplat_sj, '(', teusd.use_instt_idntfc_id, ')')
|
|
|
|
|
ELSE tetm.tmplat_sj END
|
|
|
|
|
, SHA2(teusd.unity_sndng_detail_id, 256)
|
|
|
|
|
, '[NOTICE]'
|
|
|
|
|
, unix_timestamp(teusm.clos_dt)
|
|
|
|
|
, teusd.moblphon_no
|
|
|
|
|
, teusd.nm
|
|
|
|
|
, teusd.ihidnum
|
|
|
|
|
, 'false'
|
|
|
|
|
, tetm.redirect_url
|
|
|
|
|
, tetm.tmplat_sj
|
|
|
|
|
, CASE WHEN teusm.sndng_ty_code='PNI' THEN teusd.tmplt_msg_data
|
|
|
|
|
ELSE tetm.tmplat_cn END
|
|
|
|
|
, tetm.cstmr_cnter_tlphon_no
|
|
|
|
|
, '문의처'
|
|
|
|
|
, teusd.unity_sndng_detail_id
|
|
|
|
|
, now()
|
|
|
|
|
, 'batch'
|
|
|
|
|
FROM tb_ens_unity_sndng_mastr teusm
|
|
|
|
|
JOIN tb_ens_tmplat_manage tetm
|
|
|
|
|
ON teusm.tmplat_id = tetm.tmplat_id
|
|
|
|
|
JOIN tb_ens_unity_sndng_detail teusd
|
|
|
|
|
ON teusm.unity_sndng_mastr_id = teusd.unity_sndng_mastr_id
|
|
|
|
|
WHERE teusm.unity_sndng_mastr_id = #{unitySndngMastrId}
|
|
|
|
|
AND teusm.sndng_process_sttus = #{sndngProcessSttus}
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<insert id="insertKakaotalk">
|
|
|
|
|
/** ens-mysql-mapper|insertKakaotalk-카카오톡 D10_2 생성|julim */
|
|
|
|
|
INSERT INTO tb_ens_kakao_d10 (
|
|
|
|
|
sndng_detail_id, /* 발송상세ID */
|
|
|
|
|
unity_sndng_detail_id, /* 통합발송상세ID */
|
|
|
|
|
sndng_mastr_id, /* 발송마스터ID */
|
|
|
|
|
signgu_code, /* 시군구코드 */
|
|
|
|
|
ffnlg_code, /* 과태료코드 */
|
|
|
|
|
title, /* 제목 */
|
|
|
|
|
link,
|
|
|
|
|
hash,
|
|
|
|
|
guide, /* 메세지 */
|
|
|
|
|
payload,
|
|
|
|
|
read_expires_at, /* 최초 열람 만료 일시 */
|
|
|
|
|
review_expires_at, /* 재열람 만료 일시 */
|
|
|
|
|
ci, /* 받는이 ci */
|
|
|
|
|
phone_number, /* 수신인 전화번호 */
|
|
|
|
|
name, /* 수신인 이름 */
|
|
|
|
|
birthday, /* 수신인 생년월일 */
|
|
|
|
|
external_id, /* 문서 매핑 식별 ID */
|
|
|
|
|
regist_dt,
|
|
|
|
|
register
|
|
|
|
|
)
|
|
|
|
|
SELECT LPAD(NEXTVAL(sndng_detail_id_seq), 20, '0')
|
|
|
|
|
, teusd.unity_sndng_detail_id
|
|
|
|
|
, #{sndngMastrId}
|
|
|
|
|
, teusm.signgu_code
|
|
|
|
|
, teusm.ffnlg_code
|
|
|
|
|
, tetm.tmplat_sj
|
|
|
|
|
, tetm.redirect_url
|
|
|
|
|
, SHA2(teusd.unity_sndng_detail_id, 256)
|
|
|
|
|
, tetm.tmplat_cn
|
|
|
|
|
, ''
|
|
|
|
|
, DATE_FORMAT(teusm.clos_dt, '%Y-%m-%dT%H:%i:%s')
|
|
|
|
|
, DATE_FORMAT(DATE_ADD(teusm.clos_dt, INTERVAL 1 DAY), '%Y-%m-%dT%H:%i:%s')
|
|
|
|
|
, ''
|
|
|
|
|
, teusd.moblphon_no
|
|
|
|
|
, teusd.nm
|
|
|
|
|
, ''
|
|
|
|
|
, teusd.unity_sndng_detail_id
|
|
|
|
|
, now()
|
|
|
|
|
, 'batch'
|
|
|
|
|
FROM tb_ens_unity_sndng_mastr teusm
|
|
|
|
|
JOIN tb_ens_tmplat_manage tetm
|
|
|
|
|
ON teusm.tmplat_id = tetm.tmplat_id
|
|
|
|
|
JOIN tb_ens_unity_sndng_detail teusd
|
|
|
|
|
ON teusm.unity_sndng_mastr_id = teusd.unity_sndng_mastr_id
|
|
|
|
|
WHERE teusm.unity_sndng_mastr_id = #{unitySndngMastrId}
|
|
|
|
|
AND teusm.sndng_process_sttus = #{sndngProcessSttus}
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<insert id="insertKtBcMastr">
|
|
|
|
|
/** ens-mysql-mapper|insertKtBcMastr 공인 알림문자 마스타 데이터 생성|julim */
|
|
|
|
|
INSERT
|
|
|
|
|
INTO tb_ens_kt_bc_mastr (
|
|
|
|
|
sndng_mastr_id, /* 발송 마스터 id */
|
|
|
|
|
signgu_code, /* 시군구 코드 */
|
|
|
|
|
ffnlg_code, /* 과태료 코드 */
|
|
|
|
|
service_cd, /* 서비스 코드 */
|
|
|
|
|
service_key, /* 서비스 코드 인증키 */
|
|
|
|
|
msg_cd, /* 문서코드 */
|
|
|
|
|
msg_type, /* 발송 메시지 타입 */
|
|
|
|
|
make_dt, /* 발송 시작 일시 */
|
|
|
|
|
sndn_ex_time, /* 발송 마감 시간 */
|
|
|
|
|
ex_time, /* 열람 마감 시간 */
|
|
|
|
|
m_type, /* 문서 종류 */
|
|
|
|
|
opt_type, /* 메시지 발송 구분 */
|
|
|
|
|
mms_binary, /* MMS 바이너리 */
|
|
|
|
|
file_fmat, /* MMS 바이너리 파일 포맷 */
|
|
|
|
|
sndn_tot_cnt, /* 발송 요청 총 건 */
|
|
|
|
|
mktn_rcve_csyn, /* 마케팅 수신 동의 */
|
|
|
|
|
multi_mbl_prc_type, /* 다회선 사용자 처리 구분 */
|
|
|
|
|
test_sndn_yn, /* 테스트 발송여부 */
|
|
|
|
|
rcv_rfrl_yn, /* 수신 거부 해제 여부 */
|
|
|
|
|
regist_dt, /* 등록 일시 */
|
|
|
|
|
register /* 등록자 */
|
|
|
|
|
)
|
|
|
|
|
SELECT #{sndngMastrId}
|
|
|
|
|
, teusm.signgu_code
|
|
|
|
|
, teusm.ffnlg_code
|
|
|
|
|
, term.kt_service_code
|
|
|
|
|
, term.kt_prod_service_cerf_key
|
|
|
|
|
, teusm.tmplat_id
|
|
|
|
|
, '2' /* RCS/xMS (RCS :1, xMS: 2) */
|
|
|
|
|
, teusm.sndng_dt_1
|
|
|
|
|
, teusm.clos_dt
|
|
|
|
|
, teusm.clos_dt
|
|
|
|
|
, '4' /* 3: LMS 4: MMS 6: RCS*/
|
|
|
|
|
, '1' /* 1: default 3: 하이브리드 */
|
|
|
|
|
, tetm.mms_binary
|
|
|
|
|
, tetm.file_fmat
|
|
|
|
|
, teusm.sndng_co
|
|
|
|
|
, 'N'
|
|
|
|
|
, '2' /* 2 : 다회선 발송 제외(default) (NULL 일경우 동일취급) 3 : 다회선 중 임의 1회선 발송 */
|
|
|
|
|
, 'N'
|
|
|
|
|
, 'N'
|
|
|
|
|
, now()
|
|
|
|
|
, 'batch'
|
|
|
|
|
FROM tb_ens_unity_sndng_mastr teusm
|
|
|
|
|
JOIN tb_ens_tmplat_manage tetm
|
|
|
|
|
ON teusm.tmplat_id = tetm.tmplat_id
|
|
|
|
|
JOIN tb_ens_rlaybsnm_manage term
|
|
|
|
|
ON teusm.signgu_code = term.signgu_code AND teusm.ffnlg_code = term.ffnlg_code
|
|
|
|
|
WHERE teusm.unity_sndng_mastr_id = #{unitySndngMastrId}
|
|
|
|
|
AND teusm.sndng_process_sttus = #{sndngProcessSttus}
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<insert id="insertKtBcDetail">
|
|
|
|
|
/** ens-mysql-mapper|insertKtBcDetail 공인 알림문자 디테일 데이터 생성|julim */
|
|
|
|
|
INSERT INTO tb_ens_kt_bc_detail (
|
|
|
|
|
sndng_mastr_id, /* 발송 마스터 id */
|
|
|
|
|
sndng_detail_id, /* 발송 상세 id */
|
|
|
|
|
unity_sndng_detail_id, /* 통합 발송 상세 id */
|
|
|
|
|
src_key, /* 관리키 */
|
|
|
|
|
src_seq, /* 리스트 순번 */
|
|
|
|
|
ci, /* ci */
|
|
|
|
|
mms_dtl_cnts, /* MMS 상세 내용 */
|
|
|
|
|
mms_title, /* MMS 제목 */
|
|
|
|
|
url, /* 연결 URL */
|
|
|
|
|
doc_hash, /* 문서 해시 */
|
|
|
|
|
mdn, /* 개인 휴대 전화 번호 */
|
|
|
|
|
dist_info_crt_yn, /* 유통 정보 미생성 여부 */
|
|
|
|
|
info_cfrm_str, /* 안내문 확인하기 치환 문구 */
|
|
|
|
|
rcve_rf_str, /* 수신 거부 치환 문구 */
|
|
|
|
|
regist_dt, /* 등록 일시 */
|
|
|
|
|
register /* 등록자 */
|
|
|
|
|
)
|
|
|
|
|
SELECT #{sndngMastrId}
|
|
|
|
|
, LPAD(NEXTVAL(sndng_detail_id_seq), 20, '0')
|
|
|
|
|
, teusd.unity_sndng_detail_id
|
|
|
|
|
, teusd.unity_sndng_detail_id
|
|
|
|
|
, row_number() over ()
|
|
|
|
|
, tec.ci
|
|
|
|
|
, CASE WHEN teusm.signgu_code='88328'
|
|
|
|
|
THEN CONCAT('제목 : ', tetm.tmplat_sj, '(', teusd.use_instt_idntfc_id, ')\n'
|
|
|
|
|
, tetm.tmplat_cn, '\n - 열람기간 : ', substring(teusm.clos_dt, 1, 4), '년 ', substring(teusm.clos_dt, 5, 2), '월 ', substring(teusm.clos_dt, 7, 2), '일까지\n - 문의처 : ', tetm.cstmr_cnter_tlphon_no, '\n\n{#INFO_CFRM_STR}\n{#RCVE_RF_STR}')
|
|
|
|
|
ELSE CONCAT(tetm.tmplat_cn, '\n - 열람기간 : ', substring(teusm.clos_dt, 1, 4), '년 ', substring(teusm.clos_dt, 5, 2), '월 ', substring(teusm.clos_dt, 7, 2), '일까지\n - 문의처 : ', tetm.cstmr_cnter_tlphon_no, '\n\n{#INFO_CFRM_STR}\n{#RCVE_RF_STR}') END
|
|
|
|
|
, CASE WHEN teusm.signgu_code='88328' THEN CONCAT(tetm.tmplat_sj, '(', teusd.use_instt_idntfc_id, ')')
|
|
|
|
|
ELSE tetm.tmplat_sj END
|
|
|
|
|
, #{url}
|
|
|
|
|
, SHA2(teusd.unity_sndng_detail_id, 256)
|
|
|
|
|
, ''
|
|
|
|
|
, 'N'
|
|
|
|
|
, '○ 안내문 확인하기 :'
|
|
|
|
|
, '○ 수신거부 및 수신 휴대폰 지정하기 : '
|
|
|
|
|
, now()
|
|
|
|
|
, 'batch'
|
|
|
|
|
FROM tb_ens_unity_sndng_mastr teusm
|
|
|
|
|
JOIN tb_ens_tmplat_manage tetm
|
|
|
|
|
ON teusm.tmplat_id = tetm.tmplat_id
|
|
|
|
|
JOIN tb_ens_unity_sndng_detail teusd
|
|
|
|
|
ON teusm.unity_sndng_mastr_id = teusd.unity_sndng_mastr_id
|
|
|
|
|
JOIN tb_ens_rlaybsnm_manage term
|
|
|
|
|
ON teusm.signgu_code = term.signgu_code AND teusm.ffnlg_code = term.ffnlg_code
|
|
|
|
|
LEFT JOIN tb_ens_ci tec
|
|
|
|
|
ON teusd.unity_sndng_detail_id = tec.unity_sndng_detail_id
|
|
|
|
|
WHERE teusm.unity_sndng_mastr_id = #{unitySndngMastrId}
|
|
|
|
|
AND teusm.sndng_process_sttus = #{sndngProcessSttus}
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateProcessSttusUnitySndngMst">
|
|
|
|
|
/** ens-mysql-mapper|updateProcessSttusUntySndngMst-통합발송마스터 상태 변경|julim */
|
|
|
|
|
UPDATE tb_ens_unity_sndng_mastr
|
|
|
|
|
SET sndng_process_sttus = #{newSndngProcessSttus}
|
|
|
|
|
, error_code = #{errorCode}
|
|
|
|
|
, error_mssage = #{errorMssage}
|
|
|
|
|
, updt_dt = now()
|
|
|
|
|
, updusr = 'batch'
|
|
|
|
|
WHERE unity_sndng_mastr_id = #{unitySndngMastrId}
|
|
|
|
|
</update>
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<!-- ================================ make ============================================= -->
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<!-- ================================ close =========================================== -->
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<select id="selectCloseTgts" resultType="string">
|
|
|
|
|
/** ens-mysql-mapper|selectCloseTgts-종료 대상 조회|julim */
|
|
|
|
|
SELECT unity_sndng_mastr_id
|
|
|
|
|
FROM tb_ens_sndng_mastr
|
|
|
|
|
WHERE sndng_process_sttus IN ('send-ok', 'sending1', 'sending2')
|
|
|
|
|
AND signgu_code = #{signguCode}
|
|
|
|
|
AND ffnlg_code = #{ffnlgCode}
|
|
|
|
|
AND clos_dt < date_format(adddate(now(), -1), '%Y%m%d%H%i%S')
|
|
|
|
|
</select>
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<!-- ================================ close =========================================== -->
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<!-- ================================ send ============================================= -->
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<select id="selectSendBulkTgts" resultType="kr.xit.biz.ens.model.cmm.SndngMssageParam">
|
|
|
|
|
/** ens-mysql-mapper|selectSendBulkTgts-발송 대상 조회|julim */
|
|
|
|
|
SELECT tesm.sndng_mastr_id
|
|
|
|
|
, tesm.unity_sndng_mastr_id
|
|
|
|
|
, tesm.tmplat_id
|
|
|
|
|
, tesm.sndng_co
|
|
|
|
|
, tesm.try_seq
|
|
|
|
|
, tesm.sndng_process_sttus
|
|
|
|
|
, tesm.signgu_code
|
|
|
|
|
, tesm.ffnlg_code
|
|
|
|
|
, teusm.try1
|
|
|
|
|
, teusm.try2
|
|
|
|
|
, teusm.try3
|
|
|
|
|
, teusm.try_cnt
|
|
|
|
|
FROM tb_ens_sndng_mastr tesm
|
|
|
|
|
JOIN tb_ens_unity_sndng_mastr teusm
|
|
|
|
|
ON tesm.unity_sndng_mastr_id = teusm.unity_sndng_mastr_id
|
|
|
|
|
WHERE tesm.sndng_process_sttus = #{sndngProcessSttus}
|
|
|
|
|
AND tesm.signgu_code = #{signguCode}
|
|
|
|
|
AND tesm.ffnlg_code = #{ffnlgCode}
|
|
|
|
|
<if test="batchPeriod != null and batchPeriod != ''">
|
|
|
|
|
AND tesm.sndng_dt <= now()
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectKakaopaySendTgts" resultType="kr.xit.biz.ens.model.EnsDTO$SendKakaoTgt">
|
|
|
|
|
/** ens-mysql-mapper|selectKakaopaySendTgts-카카오 문서요청 대상 목록 조회|julim */
|
|
|
|
|
SELECT tesm.sndng_mastr_id /* 발송마스터 ID */
|
|
|
|
|
, tesm.unity_sndng_mastr_id /* 통합발송마스터 ID */
|
|
|
|
|
, tesm.signgu_code /* 시군구 코드 */
|
|
|
|
|
, tesm.ffnlg_code /* 과태료 코드 */
|
|
|
|
|
, tesm.tmplat_id /* 템플릿 Id */
|
|
|
|
|
, tesm.sndng_ty_code /* 발송유형 코드 */
|
|
|
|
|
, tesm.sndng_co /* 발송건수 */
|
|
|
|
|
, unix_timestamp(tesm.clos_dt) AS closDt /* 마감일시 */
|
|
|
|
|
, tekmd.sndng_detail_id /* 발송상세 ID */
|
|
|
|
|
, tekmd.unity_sndng_detail_id /* 통합발송상세 ID */
|
|
|
|
|
, tekmd.title /* 제목 */
|
|
|
|
|
, tekmd.hash
|
|
|
|
|
, tekmd.common_categories
|
|
|
|
|
, tekmd.recv_phone_number /* 받는이 전화번호 */
|
|
|
|
|
, tekmd.recv_name /* 받는이 이름 */
|
|
|
|
|
, tekmd.recv_birthday /* 받는이 생년월일 */
|
|
|
|
|
, tekmd.prop_link /* redirect url */
|
|
|
|
|
, tekmd.prop_payload
|
|
|
|
|
, tekmd.prop_message
|
|
|
|
|
, tekmd.prop_cs_name /* 콜센터 명 */
|
|
|
|
|
, tekmd.prop_cs_number /* 콜센터 전화번호 */
|
|
|
|
|
, tec.ci /* ci */
|
|
|
|
|
FROM tb_ens_sndng_mastr tesm
|
|
|
|
|
JOIN tb_ens_kakao_my_doc tekmd
|
|
|
|
|
ON tesm.sndng_mastr_id = tekmd.sndng_mastr_id
|
|
|
|
|
LEFT JOIN tb_ens_ci tec
|
|
|
|
|
ON tekmd.unity_sndng_detail_id = tec.unity_sndng_detail_id
|
|
|
|
|
WHERE tesm.sndng_mastr_id = #{sndngMastrId}
|
|
|
|
|
AND tesm.signgu_code = #{signguCode}
|
|
|
|
|
AND tesm.ffnlg_code = #{ffnlgCode}
|
|
|
|
|
ORDER BY tesm.unity_sndng_mastr_id
|
|
|
|
|
, tekmd.unity_sndng_detail_id
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectKakaotalkSendTgts" resultType="kr.xit.biz.ens.model.EnsDTO$SendKakaotalkTgt">
|
|
|
|
|
/** ens-oracle-mapper|selectKakaotalkSendTgts-카카오톡 문서요청 대상 목록 조회|jhseo */
|
|
|
|
|
SELECT tesm.sndng_mastr_id /* 발송마스터 ID */
|
|
|
|
|
, tesm.unity_sndng_mastr_id /* 통합발송마스터 ID */
|
|
|
|
|
, tesm.signgu_code /* 시군구 코드 */
|
|
|
|
|
, tesm.ffnlg_code /* 과태료 코드 */
|
|
|
|
|
, tesm.tmplat_id /* 템플릿 Id */
|
|
|
|
|
, tesm.sndng_ty_code /* 발송유형 코드 */
|
|
|
|
|
, tesm.sndng_co /* 발송건수 */
|
|
|
|
|
, tekmd.sndng_detail_id /* 발송상세 ID */
|
|
|
|
|
, tekmd.unity_sndng_detail_id /* 통합발송상세 ID */
|
|
|
|
|
, tekmd.title /* 제목 */
|
|
|
|
|
, tekmd.hash
|
|
|
|
|
, tekmd.phone_number /* 받는이 전화번호 */
|
|
|
|
|
, tekmd.name /* 받는이 이름 */
|
|
|
|
|
, tekmd.birthday /* 받는이 생년월일 */
|
|
|
|
|
, tekmd.link as contentlink /* redirect url */
|
|
|
|
|
, tekmd.payload
|
|
|
|
|
, tekmd.guide
|
|
|
|
|
, tekmd.read_expires_at /* 최초 열람 만료 일시 */
|
|
|
|
|
, tekmd.review_expires_at /* 재열람 만료 일시 */
|
|
|
|
|
, tec.ci
|
|
|
|
|
FROM tb_ens_sndng_mastr tesm
|
|
|
|
|
JOIN tb_ens_kakao_d10 tekmd
|
|
|
|
|
ON tesm.sndng_mastr_id = tekmd.sndng_mastr_id
|
|
|
|
|
LEFT JOIN tb_ens_ci tec
|
|
|
|
|
ON tekmd.unity_sndng_detail_id = tec.unity_sndng_detail_id
|
|
|
|
|
WHERE tesm.sndng_mastr_id = #{sndngMastrId}
|
|
|
|
|
AND tesm.signgu_code = #{signguCode}
|
|
|
|
|
AND tesm.ffnlg_code = #{ffnlgCode}
|
|
|
|
|
ORDER BY tesm.unity_sndng_mastr_id
|
|
|
|
|
, tekmd.unity_sndng_detail_id
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectKtBcMstTgtInfo" resultType="kr.xit.biz.ens.model.EnsKtBcDTO">
|
|
|
|
|
/** ens-mysql-mapper|selectKtBcMstTgtInfo-Kt 본문자 수신 대상 정보 조회|julim */
|
|
|
|
|
SELECT tesm.sndng_mastr_id /* 발송마스터 ID */
|
|
|
|
|
, tesm.unity_sndng_mastr_id /* 통합발송마스터 ID */
|
|
|
|
|
, tesm.signgu_code /* 시군구 코드 */
|
|
|
|
|
, tesm.ffnlg_code /* 과태료 코드 */
|
|
|
|
|
, tesm.tmplat_id /* 템플릿 Id */
|
|
|
|
|
, tesm.sndng_ty_code /* 발송유형 코드 */
|
|
|
|
|
, tesm.sndng_co /* 발송건수 */
|
|
|
|
|
, unix_timestamp(tesm.clos_dt) AS closDt /* 마감일시 */
|
|
|
|
|
, tekbm.sndng_mastr_id /* 발송마스터 ID */
|
|
|
|
|
, tekbm.service_cd
|
|
|
|
|
, tekbm.service_key
|
|
|
|
|
, tekbm.agency_id
|
|
|
|
|
, tekbm.dept_cd
|
|
|
|
|
, tekbm.msg_cd
|
|
|
|
|
, tekbm.msg_type
|
|
|
|
|
, tekbm.make_dt
|
|
|
|
|
, tekbm.sndn_ex_time
|
|
|
|
|
, tekbm.ex_time
|
|
|
|
|
, tekbm.snd_tel_no
|
|
|
|
|
, tekbm.m_type
|
|
|
|
|
, tekbm.brand_id
|
|
|
|
|
, tekbm.opt_type
|
|
|
|
|
, tekbm.tkn_rpmt_yn
|
|
|
|
|
, tekbm.rdng_rpmt_yn
|
|
|
|
|
, TO_BASE64(tekbm.mms_binary) AS mmsBinary
|
|
|
|
|
, tekbm.file_fmat
|
|
|
|
|
, tekbm.sndn_tot_cnt
|
|
|
|
|
, tekbm.mktn_rcve_csyn
|
|
|
|
|
, tekbm.snd_plfm_id
|
|
|
|
|
, tekbm.snd_npost
|
|
|
|
|
, tekbm.snd_date
|
|
|
|
|
, tekbm.multi_mbl_prc_type
|
|
|
|
|
, tekbm.test_sndn_yn
|
|
|
|
|
, tekbm.rcv_rfrl_yn
|
|
|
|
|
, tekbm.reopen_day /* ci */
|
|
|
|
|
FROM tb_ens_sndng_mastr tesm
|
|
|
|
|
JOIN tb_ens_kt_bc_mastr tekbm
|
|
|
|
|
ON tesm.sndng_mastr_id = tekbm.sndng_mastr_id
|
|
|
|
|
WHERE tesm.sndng_mastr_id = #{sndngMastrId}
|
|
|
|
|
AND tesm.signgu_code = #{signguCode}
|
|
|
|
|
AND tesm.ffnlg_code = #{ffnlgCode}
|
|
|
|
|
ORDER BY tesm.unity_sndng_mastr_id
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectKtBcSendTgts" resultType="kr.xit.biz.ens.model.kt.KtMmsSendDTO$KtMainSendReqData">
|
|
|
|
|
/** ens-mysql-mapper|selectKtBcSendTgts-Kt 본문자 수신 대상 목록 조회|julim */
|
|
|
|
|
SELECT tekbm.sndng_mastr_id /* 발송마스터 ID */
|
|
|
|
|
, tekbm.signgu_code /* 시군구 코드 */
|
|
|
|
|
, tekbm.ffnlg_code /* 과태료 코드 */
|
|
|
|
|
, tekbd.src_key
|
|
|
|
|
, tekbd.src_seq
|
|
|
|
|
, tekbd.ci
|
|
|
|
|
, tekbd.mms_dtl_cnts
|
|
|
|
|
, tekbd.mms_title
|
|
|
|
|
, tekbd.rcs_dtl_cnts
|
|
|
|
|
, tekbd.url
|
|
|
|
|
, tekbd.doc_hash
|
|
|
|
|
, tekbd.reqs_mms_binary
|
|
|
|
|
, tekbd.reqs_file_fmat
|
|
|
|
|
, tekbd.mdn
|
|
|
|
|
, tekbd.dist_info_crt_yn
|
|
|
|
|
, tekbd.info_cfrm_str
|
|
|
|
|
, tekbd.rcve_rf_str
|
|
|
|
|
, tekbd.result_cd
|
|
|
|
|
, tekbd.result_dt
|
|
|
|
|
, tekbd.error_msg
|
|
|
|
|
, tekbd.mms_sndg_rslt_sqno
|
|
|
|
|
, tekbd.prcs_dt
|
|
|
|
|
, tekbd.mbl_bzowr_dvcd
|
|
|
|
|
, tekbd.rl_mms_sndg_telno
|
|
|
|
|
, tekbd.mms_sndg_rslt_dvcd
|
|
|
|
|
, tekbd.mms_sndg_tmst
|
|
|
|
|
, tekbd.mms_rdg_tmst
|
|
|
|
|
FROM tb_ens_kt_bc_mastr tekbm
|
|
|
|
|
JOIN tb_ens_kt_bc_detail tekbd
|
|
|
|
|
ON tekbm.sndng_mastr_id = tekbd.sndng_mastr_id
|
|
|
|
|
WHERE tekbm.sndng_mastr_id = #{sndngMastrId}
|
|
|
|
|
AND tekbm.signgu_code = #{signguCode}
|
|
|
|
|
AND tekbm.ffnlg_code = #{ffnlgCode}
|
|
|
|
|
ORDER BY tekbd.sndng_detail_id
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectSndProcessStatus" resultType="kr.xit.biz.ens.model.cmm.SndngMssageParam">
|
|
|
|
|
/** ens-mysql-mapper|selectSndProcessStatus-발송상태정보조회|julim */
|
|
|
|
|
SELECT tesm.sndng_mastr_id
|
|
|
|
|
, tesm.unity_sndng_mastr_id
|
|
|
|
|
, teusm.try_cnt
|
|
|
|
|
, tesm.try_seq
|
|
|
|
|
, CASE WHEN tesm.try_cnt = 3 THEN IF(tesm.try_seq = 3, 'send-ok', concat('sending', tesm.try_seq))
|
|
|
|
|
WHEN tesm.try_cnt = 2 THEN IF(tesm.try_seq = 2, 'send-ok', concat('sending', tesm.try_seq))
|
|
|
|
|
ELSE 'send-ok'
|
|
|
|
|
END AS newSndngProcessSttus
|
|
|
|
|
FROM tb_ens_sndng_mastr tesm
|
|
|
|
|
JOIN tb_ens_unity_sndng_mastr teusm
|
|
|
|
|
ON tesm.unity_sndng_mastr_id = teusm.unity_sndng_mastr_id
|
|
|
|
|
WHERE tesm.sndng_mastr_id = #{sndngMastrId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<update id="updateKakaopaySendBulksResult">
|
|
|
|
|
/** ens-mysql-mapper|updateKakaopaySendBulksResult-카카오페이 문서요청 결과 반영|julim */
|
|
|
|
|
UPDATE tb_ens_kakao_my_doc
|
|
|
|
|
SET external_document_uuid = #{external_document_uuid}
|
|
|
|
|
, document_binder_uuid = #{document_binder_uuid}
|
|
|
|
|
, error_code = #{error_code}
|
|
|
|
|
, error_message = #{error_message}
|
|
|
|
|
, updt_dt = now()
|
|
|
|
|
, updusr = 'batch'
|
|
|
|
|
WHERE external_document_uuid = #{external_document_uuid}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="updateKakaotalkSendBulksResult">
|
|
|
|
|
/** ens-mysql-mapper|updateKakaotalkSendBulksResult-카카오톡 문서요청 결과 반영|jhseo */
|
|
|
|
|
UPDATE tb_ens_kakao_d10
|
|
|
|
|
SET external_id = #{externalId}
|
|
|
|
|
, envelope_id = #{envelopeId}
|
|
|
|
|
, error_code = #{errorCode}
|
|
|
|
|
, error_message = #{errorMessage}
|
|
|
|
|
, updt_dt = now()
|
|
|
|
|
, updusr = 'batch'
|
|
|
|
|
WHERE unity_sndng_detail_id = #{externalId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<insert id="insertKkopayMobilePageManage">
|
|
|
|
|
/** ens-mysql-mapper|insertKkopayMobilePageManage-카카오페이 모바일페이지관리 데이타 생성|julim */
|
|
|
|
|
INSERT INTO tb_ens_mobile_page_manage (
|
|
|
|
|
sndng_detail_id, /* 발송상세 ID*/
|
|
|
|
|
sndng_se_code, /* 발송 구분 코드 */
|
|
|
|
|
mobile_page_cn, /* 모바일 페이지 내용 */
|
|
|
|
|
regist_dt,
|
|
|
|
|
register
|
|
|
|
|
)
|
|
|
|
|
SELECT tekmd.sndng_detail_id
|
|
|
|
|
, 'KKO-MY-DOC'
|
|
|
|
|
, teusd.mobile_page_cn
|
|
|
|
|
, date_format(now(), '%Y%m%d%H%i%s')
|
|
|
|
|
, 'batch'
|
|
|
|
|
FROM tb_ens_kakao_my_doc tekmd
|
|
|
|
|
JOIN tb_ens_unity_sndng_detail teusd
|
|
|
|
|
ON tekmd.unity_sndng_detail_id = teusd.unity_sndng_detail_id
|
|
|
|
|
WHERE teusd.unity_sndng_detail_id = #{unitySndngDetailId}
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<insert id="insertKkotalkMobilePageManage">
|
|
|
|
|
/** ens-oracle-mapper|insertKkotalkMobilePageManage-카카오톡모바일페이지관리 데이타 생성|jhseo */
|
|
|
|
|
INSERT
|
|
|
|
|
INTO tb_ens_mobile_page_manage (
|
|
|
|
|
sndng_detail_id, /* 발송상세 ID*/
|
|
|
|
|
sndng_se_code, /* 발송 구분 코드 */
|
|
|
|
|
mobile_page_cn, /* 모바일 페이지 내용 */
|
|
|
|
|
regist_dt,
|
|
|
|
|
register
|
|
|
|
|
)
|
|
|
|
|
SELECT tekmd.sndng_detail_id
|
|
|
|
|
, 'KKO-NEW'
|
|
|
|
|
, teusd.mobile_page_cn
|
|
|
|
|
, date_format(now(), '%Y%m%d%H%i%s')
|
|
|
|
|
, 'batch'
|
|
|
|
|
FROM tb_ens_kakao_d10 tekmd
|
|
|
|
|
JOIN tb_ens_unity_sndng_detail teusd
|
|
|
|
|
ON tekmd.unity_sndng_detail_id = teusd.unity_sndng_detail_id
|
|
|
|
|
WHERE teusd.unity_sndng_detail_id = #{unitySndngDetailId}
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateProcessSttusSndngMst">
|
|
|
|
|
/** ens-mysql-mapper|updateProcessSttusSndngMst-발송마스터 상태 변경|julim */
|
|
|
|
|
UPDATE tb_ens_sndng_mastr
|
|
|
|
|
SET sndng_process_sttus = #{newSndngProcessSttus}
|
|
|
|
|
, error_code = #{errorCode}
|
|
|
|
|
, error_mssage = SUBSTR(#{errorMssage}, 1, 999)
|
|
|
|
|
, updt_dt = now()
|
|
|
|
|
, updusr = 'batch'
|
|
|
|
|
WHERE sndng_mastr_id = #{sndngMastrId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="updateProcessSttusBulkSndngMst">
|
|
|
|
|
/** ens-mysql-mapper|updateProcessSttusBulkSndngMst-발송마스터 상태 다건 변경|julim */
|
|
|
|
|
UPDATE tb_ens_sndng_mastr
|
|
|
|
|
SET sndng_process_sttus = #{newSndngProcessSttus}
|
|
|
|
|
, updt_dt = now()
|
|
|
|
|
, updusr = 'batch'
|
|
|
|
|
WHERE unity_sndng_mastr_id = #{unitySndngMastrId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="updateKtBcMst" parameterType="kr.xit.biz.ens.model.cmm.SndngMssageParam">
|
|
|
|
|
/** ens-kt-mysql-mapper|updateKtBcMst-kt 메세지 수신결과 마스터 반영|julim */
|
|
|
|
|
UPDATE tb_ens_kt_bc_mastr
|
|
|
|
|
SET result_cd = #{resultCd}
|
|
|
|
|
, result_dt = #{resultDt}
|
|
|
|
|
, error_msg = #{errorMssage}
|
|
|
|
|
, updt_dt = NOW()
|
|
|
|
|
, updusr = 'batch'
|
|
|
|
|
WHERE sndng_mastr_id = #{sndngMastrId}
|
|
|
|
|
AND signgu_code = #{signguCode}
|
|
|
|
|
AND ffnlg_code = #{ffnlgCode}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<insert id="insertKtMobilePageManage">
|
|
|
|
|
/** ens-mysql-mapper|insertKtMobilePageManage-모바일페이지관리 데이타 생성|julim */
|
|
|
|
|
INSERT
|
|
|
|
|
INTO tb_ens_mobile_page_manage (
|
|
|
|
|
sndng_detail_id, /* 발송상세 ID*/
|
|
|
|
|
sndng_se_code, /* 발송 구분 코드 */
|
|
|
|
|
mobile_page_cn, /* 모바일 페이지 내용 */
|
|
|
|
|
regist_dt,
|
|
|
|
|
register
|
|
|
|
|
)
|
|
|
|
|
SELECT tekbd.sndng_detail_id
|
|
|
|
|
, 'KT-BC'
|
|
|
|
|
, teusd.mobile_page_cn
|
|
|
|
|
, date_format(now(), '%Y%m%d%H%i%s')
|
|
|
|
|
, 'batch'
|
|
|
|
|
FROM tb_ens_kt_bc_detail tekbd
|
|
|
|
|
JOIN tb_ens_unity_sndng_detail teusd
|
|
|
|
|
ON tekbd.unity_sndng_detail_id = teusd.unity_sndng_detail_id
|
|
|
|
|
WHERE teusd.unity_sndng_detail_id = #{unitySndngDetailId}
|
|
|
|
|
</insert>
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<!-- ================================ send ============================================= -->
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<!-- ================================ status ============================================= -->
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<select id="selectStatusBulkTgts" resultType="kr.xit.biz.ens.model.cmm.SndngMssageParam">
|
|
|
|
|
/** ens-mysql-mapper|selectStatusBulkTgts-상태 요청 대상 조회|julim */
|
|
|
|
|
SELECT tesm.sndng_mastr_id
|
|
|
|
|
, tesm.unity_sndng_mastr_id
|
|
|
|
|
, tesm.tmplat_id
|
|
|
|
|
, tesm.sndng_co
|
|
|
|
|
, tesm.try_seq
|
|
|
|
|
, tesm.sndng_process_sttus
|
|
|
|
|
, teusm.try1
|
|
|
|
|
, teusm.try2
|
|
|
|
|
, teusm.try3
|
|
|
|
|
, teusm.try_cnt
|
|
|
|
|
FROM tb_ens_sndng_mastr tesm
|
|
|
|
|
JOIN tb_ens_unity_sndng_mastr teusm
|
|
|
|
|
ON tesm.unity_sndng_mastr_id = teusm.unity_sndng_mastr_id
|
|
|
|
|
WHERE tesm.sndng_process_sttus IN ('send-ok', 'sending1', 'sending2')
|
|
|
|
|
AND tesm.signgu_code = #{signguCode}
|
|
|
|
|
AND tesm.ffnlg_code = #{ffnlgCode}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectKakaopayStatusTgts" resultType="string">
|
|
|
|
|
/** ens-mysql-mapper|selectKakaopayStatusTgts-카카오페이 문서 상태 조회 대상 목록 조회|julim */
|
|
|
|
|
SELECT tekmd.document_binder_uuid
|
|
|
|
|
FROM tb_ens_sndng_mastr tesm
|
|
|
|
|
JOIN tb_ens_kakao_my_doc tekmd
|
|
|
|
|
ON tesm.sndng_mastr_id = tekmd.sndng_mastr_id
|
|
|
|
|
WHERE tesm.sndng_process_sttus IN ('send-ok', 'sending1', 'sending2')
|
|
|
|
|
AND tesm.unity_sndng_mastr_id = #{unitySndngMastrId}
|
|
|
|
|
AND IFNULL(tekmd.document_binder_uuid, '') != ''
|
|
|
|
|
AND tesm.signgu_code = #{signguCode}
|
|
|
|
|
AND tesm.ffnlg_code = #{ffnlgCode}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectKakaotalkStatusTgts" resultType="string">
|
|
|
|
|
/** ens-mysql-mapper|selectKakaotalkStatusTgts-카카오톡 전자고지 상태 조회 대상 목록 조회|julim */
|
|
|
|
|
SELECT tekd.envelope_id
|
|
|
|
|
FROM tb_ens_sndng_mastr tesm
|
|
|
|
|
JOIN tb_ens_kakao_d10 tekd
|
|
|
|
|
ON tesm.sndng_mastr_id = tekd.sndng_mastr_id
|
|
|
|
|
WHERE tesm.sndng_process_sttus IN ('send-ok', 'sending1', 'sending2')
|
|
|
|
|
AND tesm.unity_sndng_mastr_id = #{unitySndngMastrId}
|
|
|
|
|
AND IFNULL(tekd.envelope_id, '') != ''
|
|
|
|
|
AND tesm.signgu_code = #{signguCode}
|
|
|
|
|
AND tesm.ffnlg_code = #{ffnlgCode}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<update id="updateKakaopayStatusInfo">
|
|
|
|
|
/** ens-mysql-mapper|updateKakaopayStatusInfo-카카오페이 문서 상태 조회 결과 반영|julim */
|
|
|
|
|
UPDATE tb_ens_kakao_my_doc
|
|
|
|
|
SET doc_box_status = #{status_data.doc_box_status} /* 진행상태 */
|
|
|
|
|
, doc_box_sent_at = #{status_data.doc_box_sent_at} /* 송신시간 */
|
|
|
|
|
, doc_box_received_at = #{status_data.doc_box_received_at} /* 수신시간 */
|
|
|
|
|
, doc_box_read_at = #{status_data.doc_box_read_at} /* 최초열람시간 */
|
|
|
|
|
, authenticated_at = #{status_data.authenticated_at} /* 최초열람인증시간 */
|
|
|
|
|
, token_used_at = #{status_data.token_used_at} /* 최초OTT 검증시간 */
|
|
|
|
|
, user_notified_at = #{status_data.user_notified_at} /* 알림톡 수신시간 */
|
|
|
|
|
, error_code = #{error_code} /* 에러 코드 */
|
|
|
|
|
, error_message = #{error_message} /* 에러 메시지 */
|
|
|
|
|
, updt_dt = now()
|
|
|
|
|
, updusr = 'batch'
|
|
|
|
|
WHERE unity_sndng_detail_id = (SELECT tekmd.unity_sndng_detail_id
|
|
|
|
|
FROM tb_ens_kakao_my_doc tekmd
|
|
|
|
|
WHERE tekmd.document_binder_uuid = #{document_binder_uuid})
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="updateKakaotalkStatusInfo">
|
|
|
|
|
/** ens-mysql-mapper|updateKakaotalkStatusInfo-카카오톡 문서 상태 조회 결과 반영|jhseo */
|
|
|
|
|
UPDATE tb_ens_kakao_d10
|
|
|
|
|
SET status = #{status} /* 진행상태 */
|
|
|
|
|
, sent_at = #{sentAt} /* 문서 송신 일시 */
|
|
|
|
|
, received_at = #{receivedAt} /* 문서 수신 일시 */
|
|
|
|
|
, read_at = #{readAt} /* 문서 열람 일시 */
|
|
|
|
|
, read_expires_at = #{readExpiredAt} /* 문서 열람 만료 일시 */
|
|
|
|
|
, authenticated_at = #{authenticatedAt} /* 문서 열람 인증 일시 */
|
|
|
|
|
, ott_verified_at = #{ottVerifiedAt} /* 토큰 검증 일시 */
|
|
|
|
|
, is_notification_unavailable = #{isNotificationUnavailable} /* 사용자의 알림톡 수신 가능 여부 */
|
|
|
|
|
, user_notified_at = #{userNotifiedAt} /* 사용자의 알림톡 수신 일시 */
|
|
|
|
|
, distribution_received_at = #{distributionReceivedAt} /* 유통정보의 수신 시각 */
|
|
|
|
|
, error_code = #{errorCode} /* 에러 코드 */
|
|
|
|
|
, error_message = #{errorMessage} /* 에러 메시지 */
|
|
|
|
|
, updt_dt = now()
|
|
|
|
|
, updusr = 'batch'
|
|
|
|
|
WHERE unity_sndng_detail_id = (SELECT tekmd.unity_sndng_detail_id
|
|
|
|
|
FROM tb_ens_kakao_d10 tekmd
|
|
|
|
|
WHERE tekmd.envelope_id = #{envelopeId})
|
|
|
|
|
</update>
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<!-- ================================ status ============================================= -->
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<!-- ================================ result ============================================= -->
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<insert id="insertCntcSndngResult">
|
|
|
|
|
/** ens-mysql-mapper|insertCntcSndngResult-연계발송결과반영|julim */
|
|
|
|
|
INSERT
|
|
|
|
|
INTO tb_elctrn_ntic_sndng_result (
|
|
|
|
|
elctrn_ntic_sndng_detail_id, /* 통합 발송 상세 ID*/
|
|
|
|
|
sndng_result_code,
|
|
|
|
|
requst_dt, /* 송신(요청) 일시 */
|
|
|
|
|
inqire_dt, /* 수신(조회) 일시 */
|
|
|
|
|
readng_dt, /* 최초열람일시 */
|
|
|
|
|
error_cn, /* 에러내용 */
|
|
|
|
|
regist_dt
|
|
|
|
|
) SELECT unity_sndng_detail_id/* 통합 발송 상세 ID*/
|
|
|
|
|
, CASE WHEN #{sndngResultSttus} IN ('RECEIVED', 'EXPIRED') THEN '1'
|
|
|
|
|
WHEN #{sndngResultSttus} IN ('READ') THEN '2'
|
|
|
|
|
WHEN #{sndngResultSttus} IS NULL THEN NULL
|
|
|
|
|
ELSE '3' END
|
|
|
|
|
, DATE_FORMAT(#{requstDt}, '%Y%m%d%H%i%s') /* 송신(요청) 일시 */
|
|
|
|
|
, DATE_FORMAT(#{inqireDt}, '%Y%m%d%H%i%s') /* 수신(조회) 일시 */
|
|
|
|
|
, DATE_FORMAT(#{readngDt}, '%Y%m%d%H%i%s') /* 최초열람일시 */
|
|
|
|
|
, SUBSTR(#{errorCn}, 1, 999) /* 에러내용 */
|
|
|
|
|
, now()
|
|
|
|
|
FROM tb_ens_unity_sndng_detail
|
|
|
|
|
WHERE unity_sndng_detail_id = #{unitySndngDetailId}
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateCntcSndngResultByKkopay">
|
|
|
|
|
/** ens-mysql-mapper|updateCntcSndngResultByKkopay-카카오페이 연계발송결과반영|julim */
|
|
|
|
|
UPDATE tb_elctrn_ntic_sndng_result
|
|
|
|
|
SET sndng_result_code = CASE WHEN #{sndngResultSttus} IN ('RECEIVED', 'EXPIRED') THEN '1'
|
|
|
|
|
WHEN #{sndngResultSttus} IN ('READ') THEN '2'
|
|
|
|
|
WHEN #{sndngResultSttus} IS NULL THEN NULL
|
|
|
|
|
ELSE '3' END
|
|
|
|
|
, requst_dt = from_unixtime(#{requstDt}, '%Y%m%d%H%i%s') /* 송신(요청) 일시 */
|
|
|
|
|
, inqire_dt = from_unixtime(#{inqireDt}, '%Y%m%d%H%i%s') /* 수신(조회) 일시 */
|
|
|
|
|
, readng_dt = from_unixtime(#{readngDt}, '%Y%m%d%H%i%s') /* 최초열람일시 */
|
|
|
|
|
, error_cn = #{errorCn}
|
|
|
|
|
, last_updt_dt = now()
|
|
|
|
|
WHERE elctrn_ntic_sndng_detail_id = (SELECT tensd.elctrn_ntic_sndng_detail_id
|
|
|
|
|
FROM tb_ens_kakao_my_doc tekmd
|
|
|
|
|
JOIN tb_elctrn_ntic_sndng_detail tensd
|
|
|
|
|
ON tekmd.external_document_uuid = tensd.external_document_uuid
|
|
|
|
|
WHERE tekmd.document_binder_uuid = #{docKeyId})
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<update id="updateCntcSndngResultByKkotalk">
|
|
|
|
|
/** ens-mysql-mapper|updateCntcSndngResultByKkotalk-카카오톡 연계발송결과반영|jhseo */
|
|
|
|
|
UPDATE tb_elctrn_ntic_sndng_result
|
|
|
|
|
SET sndng_result_code = CASE WHEN #{sndngResultSttus} IN ('RECEIVED', 'EXPIRED') THEN '1'
|
|
|
|
|
WHEN #{sndngResultSttus} IN ('READ') THEN '2'
|
|
|
|
|
WHEN #{sndngResultSttus} IS NULL THEN NULL
|
|
|
|
|
ELSE '3' END
|
|
|
|
|
, requst_dt = DATE_FORMAT(#{requstDt}, '%Y%m%d%H%i%s') /* 송신(요청) 일시 */
|
|
|
|
|
, inqire_dt = DATE_FORMAT(#{inqireDt}, '%Y%m%d%H%i%s') /* 수신(조회) 일시 */
|
|
|
|
|
, readng_dt = DATE_FORMAT(#{readngDt}, '%Y%m%d%H%i%s') /* 최초열람일시 */
|
|
|
|
|
, error_cn = #{errorCn}
|
|
|
|
|
, last_updt_dt = now()
|
|
|
|
|
WHERE elctrn_ntic_sndng_detail_id = (SELECT tekd.unity_sndng_detail_id
|
|
|
|
|
FROM tb_ens_kakao_d10 tekd
|
|
|
|
|
WHERE tekd.envelope_id = #{docKeyId})
|
|
|
|
|
</update>
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<!-- ================================ result ============================================= -->
|
|
|
|
|
<!-- =================================================================================== -->
|
|
|
|
|
<select id="selectTmplat" resultType="kr.xit.biz.ens.model.cmm.TmplatManage">
|
|
|
|
|
/** ens-mysql-mapper|selectTmplat-템플릿정보조회|julim */
|
|
|
|
|
SELECT tmplat_id /* 템플릿 아이디 */
|
|
|
|
|
, signgu_code /* 시군구 코드 */
|
|
|
|
|
, ffnlg_code /* 과태료 코드 */
|
|
|
|
|
, sndng_ty_code /* 발송유형 코드 */
|
|
|
|
|
, tmplat_nm /* 템플릿 명 */
|
|
|
|
|
, tmplat_sj /* 템플릿 제목 */
|
|
|
|
|
, tmplat_cn /* 템플릿 내용 */
|
|
|
|
|
, cstmr_cnter_tlphon_no /* 고객센터 전화번호 */
|
|
|
|
|
, redirect_url
|
|
|
|
|
, try1
|
|
|
|
|
, try2
|
|
|
|
|
, try3
|
|
|
|
|
, try2_minute
|
|
|
|
|
, try3_minute
|
|
|
|
|
, use_at
|
|
|
|
|
FROM tb_ens_tmplat_manage
|
|
|
|
|
WHERE tmplat_id = #{tmplatId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectAcceptValidation" resultType="kr.xit.biz.ens.model.EnsDTO$SndngValidation">
|
|
|
|
|
/** ens-mysql-mapper|selectAcceptVali-Validate용|seojh */
|
|
|
|
|
SELECT term.ffnlg_code
|
|
|
|
|
, term.signgu_code
|
|
|
|
|
, tetm.tmplat_id
|
|
|
|
|
, tcsm.sndng_ty_code
|
|
|
|
|
, tcsm.sndng_co
|
|
|
|
|
, tcsm.sndng_dt
|
|
|
|
|
, tcsm.clos_dt
|
|
|
|
|
, tcsd.elctrn_ntic_sndng_detail_id AS unitySndngDetailId
|
|
|
|
|
, tcsd.main_code
|
|
|
|
|
, NVL(tcsd.ffnlg_code, '11') AS ffnlg_code_de
|
|
|
|
|
, tcsd.signgu_code AS signgu_code_de
|
|
|
|
|
, ECL_DECRYPT(tcsd.ihidnum) AS ihidnum
|
|
|
|
|
, tcsd.ihidnum AS encIhidnum
|
|
|
|
|
, tcsd.mobile_page_cn
|
|
|
|
|
, tetm.try1
|
|
|
|
|
, tetm.try2
|
|
|
|
|
, tetm.try3
|
|
|
|
|
, 1 AS try_seq
|
|
|
|
|
, tec.ci
|
|
|
|
|
FROM tb_elctrn_ntic_sndng tcsm
|
|
|
|
|
JOIN tb_elctrn_ntic_sndng_detail tcsd
|
|
|
|
|
ON tcsm.elctrn_ntic_sndng_id = tcsd.elctrn_ntic_sndng_id
|
|
|
|
|
LEFT JOIN tb_ens_ci tec
|
|
|
|
|
ON tcsd.elctrn_ntic_sndng_detail_id = tec.unity_sndng_detail_id
|
|
|
|
|
JOIN tb_ens_tmplat_manage tetm
|
|
|
|
|
ON tcsm.nht_tmplat_id = tetm.tmplat_id
|
|
|
|
|
JOIN tb_ens_rlaybsnm_manage term
|
|
|
|
|
ON (tcsm.signgu_code = term.signgu_code
|
|
|
|
|
AND NVL(tcsm.ffnlg_code, '11') = term.ffnlg_code)
|
|
|
|
|
WHERE tcsm.elctrn_ntic_sndng_id = #{unitySndngMastrId}
|
|
|
|
|
AND tcsm.sndng_process_sttus = #{sndngProcessSttus}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertCi">
|
|
|
|
|
/** ens-mysql-mapper|insertCi-CI자료 생성|limju */
|
|
|
|
|
INSERT INTO tb_ens_ci (
|
|
|
|
|
unity_sndng_detail_id,
|
|
|
|
|
ci,
|
|
|
|
|
result_cd,
|
|
|
|
|
message,
|
|
|
|
|
regist_dt,
|
|
|
|
|
register
|
|
|
|
|
) VALUES (
|
|
|
|
|
#{unitySndngDetailId}
|
|
|
|
|
, NVL(#{ci1}, #{ci2})
|
|
|
|
|
, #{resultCd}
|
|
|
|
|
, #{message}
|
|
|
|
|
, now()
|
|
|
|
|
, #{register}
|
|
|
|
|
)
|
|
|
|
|
</insert>
|
|
|
|
|
</mapper>
|