diff --git a/src/main/resources/sql/mapper/interfaces/emailRequest-mapper.xml b/src/main/resources/sql/mapper/interfaces/emailRequest-mapper.xml index 2e71394c..8f555723 100644 --- a/src/main/resources/sql/mapper/interfaces/emailRequest-mapper.xml +++ b/src/main/resources/sql/mapper/interfaces/emailRequest-mapper.xml @@ -68,7 +68,7 @@ SELECT CON_ORG , RECEV_BAR1D , RECEV_BAR2D - , RECEV_BILL_NUNBER + , RECEV_BILL_NUMBER , RECEV_DOC_CD1 , RECEV_DOC_CD2 , RECEV_DOC_CD3 @@ -136,8 +136,7 @@ SELECT CON_ORG FROM TB_EPOST_RCPT_REG A , TB_EPOST_RCPT_DTL B - , (SELECT @row_no := 0, @con_key := '', #{conOrg} CON_ORG) C - WHERE POST_PROC_STT = '01' + WHERE POST_PRCS_STTS_CD = '01' AND A.CON_KEY = B.CON_KEY ORDER BY A.CON_KEY, RGST_NMBR, RECEV_SEQ @@ -235,7 +234,7 @@ SELECT CON_ORG , REG_VAR_DATA4 , REG_VAR_DATA5 - , POST_PROC_STT + , POST_PRCS_STTS_CD , RCEPT_YMD , DEL_YN , REG_DT @@ -307,7 +306,7 @@ INSERT INTO TB_EPOST_RCPT_REG ( , REG_VAR_DATA3 , REG_VAR_DATA4 , REG_VAR_DATA5 - , POST_PROC_STT + , POST_PRCS_STTS_CD , RCEPT_YMD , DEL_YN , REG_DT @@ -434,7 +433,7 @@ UPDATE TB_EPOST_RCPT_REG SET /* 전자우편 배달 완료 처리(emailRequestMapper.updateRequestAsDelivered) */ UPDATE TB_EPOST_RCPT_REG SET POST_PROC_STT = #{status} - WHERE POST_PROC_STT = '27' + WHERE POST_PROC_STT = '27' AND DEL_YN = 'N' AND REG_DT < CONCAT(DATE_FORMAT(DATE_SUB(CURRENT_DATE, INTERVAL #{expiryDays} DAY), '%Y%m%d'), '000000')