최초 커밋

master
mjkhan21 1 year ago
commit ad380d2b7d

@ -0,0 +1,95 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>cokr.xit.interfaces</groupId>
<artifactId>xit-epost</artifactId>
<version>23.04.01-SNAPSHOT</version>
<packaging>jar</packaging>
<name>xit-epost</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>mvn2s</id>
<url>https://repo1.maven.org/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>egovframe</id>
<url>http://maven.egovframe.kr:8080/maven/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>egovframe2</id>
<url>http://www.egovframe.go.kr/maven/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>maven-public</id>
<url>https://nas.xit.co.kr:8888//repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>cokr.xit.interfaces</groupId>
<artifactId>xit-filejob</artifactId>
<version>23.04.01-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<directory>${basedir}/target</directory>
<finalName>${artifactId}-${version}</finalName>
<resources>
<resource><directory>${basedir}/src/main/resources</directory></resource>
</resources>
<testResources>
<testResource><directory>${basedir}/src/test/resources</directory></testResource>
<testResource><directory>${basedir}/src/main/resources</directory></testResource>
</testResources>
</build>
<!-- Nexus deploy -->
<distributionManagement>
<snapshotRepository>
<id>maven-snapshot</id>
<url>https://nas.xit.co.kr:8888/repository/maven-snapshots/</url>
</snapshotRepository>
<repository>
<id>maven-release</id>
<url>https://nas.xit.co.kr:8888/repository/maven-releases/</url>
</repository>
</distributionManagement>
<!-- Nexus deploy -->
</project>

@ -0,0 +1,143 @@
package cokr.xit.interfaces.epost;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import cokr.xit.foundation.Assert;
import lombok.Getter;
import lombok.Setter;
/**
*
* @author mjkhan
*/
@Getter
@Setter
public class DeliveryResult extends EmailResult {
/** 결과 유형 */
public static final String TYPE = "deliv_";
/**
* ID
*/
private String dlvrRsltId;
/**
*
*/
private String conKey;
/**
*
*/
private String outsiduserid;
/**
*
*/
private String reletcdata;
/**
*
*/
private String regino;
/**
*
*/
private String delivymd;
/**
*
*/
private String delivhhmi;
/**
*
*/
private String delivrsltcd;
/**
*
*/
private String nondelivreasncd;
/**
*
*/
private String nondelivreasncdnm;
/**
*
*/
private String subrecprsnnm;
/**
*
*/
private String relrecprsncd;
/**
*
*/
private String relrecprsncdnm;
public DeliveryResult parse(String str) {
String[] content = str.split("\\|", -1);
List<Consumer<String>> setters = Arrays.asList(
this::setOutsiduserid
, this::setReletcdata
, this::setRegino
, this::setDelivymd
, this::setDelivhhmi
, this::setDelivrsltcd
, this::setNondelivreasncd
, this::setNondelivreasncdnm
, this::setSubrecprsnnm
, this::setRelrecprsncd
, this::setRelrecprsncdnm
);
if (setters.size() > content.length)
throw new RuntimeException(String.format("Parsed data has %d fields.", content.length));
for (int i = 0; i < setters.size(); ++i) {
Consumer<String> setter = setters.get(i);
String val = content[i];
setter.accept(val);
}
return this;
}
/** 처리 유형 (로그) */
private static final String PROC_TYPE = "5";
@Override
public EmailResultLog toLog() {
EmailResultLog log = new EmailResultLog();
log.setProcType(PROC_TYPE);
log.setConKey(reletcdata);
log.setRgstNmbr(regino);
return log;
}
public static Map<String, List<DeliveryResult>> byStatus(List<DeliveryResult> results) {
if (Assert.isEmpty(results)) return Collections.emptyMap();
HashMap<String, List<DeliveryResult>> byStatus = new HashMap<>();
results.stream()
.collect(Collectors.groupingBy(DeliveryResult::getReletcdata))
.forEach((conKey, list) -> {
DeliveryResult result = list.get(0);
byStatus.computeIfAbsent(EmailRequest.IN_TRANSIT, key -> new ArrayList<>()).add(result);
});
return byStatus;
}
}

@ -0,0 +1,273 @@
package cokr.xit.interfaces.epost;
import cokr.xit.foundation.AbstractEntity;
import cokr.xit.foundation.data.DataObject;
import lombok.Getter;
import lombok.Setter;
/**
*
* @author mjkhan
*/
@Getter
@Setter
public class EmailRequest extends AbstractEntity {
/** 발송 대기 */
public static final String TO_SEND = "01";
/** 발송 취소 */
public static final String SEND_CANCELLED = "02";
/** 발송 */
public static final String SENT = "03";
/** 접수 대상 */
public static final String VALID = "10";
/** 제작 불가(정합성 결과) */
public static final String INVALID = "12";
/** 접수 */
public static final String REGISTERED = "15";
/** 제작 완료 */
public static final String PRODUCED = "20";
/** 제작 불가(제작 결과) */
public static final String PROD_FAILED = "22";
/** 미배달 */
public static final String UNDELIVERED = "25";
/** 배달 중 */
public static final String IN_TRANSIT = "27";
/** 배달 완료 */
public static final String DELIVERED = "30";
/**
*
*/
private String conKey;
/**
*
*/
private String rceptId;
/**
*
*/
private String dataCd;
/**
*
*/
private String divKb;
/**
*
*/
private String dfpayyn;
/**
*
*/
private String rcptKb;
/**
*
*/
private String sealCd;
/**
*
*/
private String wordKb;
/**
*
*/
private Integer mailCnt;
/**
*
*/
private Integer recevCnt;
/**
*
*/
private String envCd;
/**
*
*/
private String colorYn;
/**
*
*/
private String mmYn;
/**
*
*/
private String flexCd;
/**
*
*/
private Integer dmCnt;
/**
*
*/
private String sbFg;
/**
*
*/
private String apvlNb;
/**
*
*/
private String sendDate;
/**
*
*/
private String sendTime;
/**
*
*/
private String relorsectCd;
/**
*
*/
private String recevSenderOrgCode;
/**
*
*/
private String recevSenderNm;
/**
*
*/
private String recevSenderZipcode;
/**
*
*/
private String recevSenderAddr;
/**
*
*/
private String recevSenderDetailaddr;
/**
*
*/
private String recevSenderDepartTel;
/**
*
*/
private String recevSenderDepartNm;
/**
*
*/
private String recevDivCd;
/**
*
*/
private String recevPrintDt;
/**
*
*/
private String recevPrintYear;
/**
*
*/
private String recevPrintMonth;
/**
*
*/
private String recevPrintDay;
/**
*
*/
private String recevSenderFax;
/**
*
*/
private String recevSerderStaff;
/**
*
*/
private String recevSenderEmail;
/**
* ID
*/
private String sndngId;
/**
*
*/
private String jobCd;
/**
* 1
*/
private String regVarData1;
/**
* 2
*/
private String regVarData2;
/**
* 3
*/
private String regVarData3;
/**
* 4
*/
private String regVarData4;
/**
* 5
*/
private String regVarData5;
/**
*
*/
private String postProcStt;
/**
*
*/
private String rceptYmd;
/**
*
*/
private String delYn;
/** 처리 유형 (로그) */
private static final String PROC_TYPE = "1";
public static EmailResultLog toLog(DataObject info) {
EmailResultLog log = new EmailResultLog();
log.setProcType(PROC_TYPE);
log.setConKey(info.string("CON_KEY"));
log.setRgstNmbr(info.string("RGST_NMBR"));
return log;
}
}

@ -0,0 +1,343 @@
package cokr.xit.interfaces.epost;
import cokr.xit.foundation.AbstractEntity;
import lombok.Getter;
import lombok.Setter;
/**
*
* @author mjkhan
*/
@Getter
@Setter
public class EmailRequestDetail extends AbstractEntity {
/**
*
*/
private String conKey;
/**
*
*/
private String rgstNmbr;
/**
*
*/
private String recevSeq;
/**
*
*/
private String recevCode;
/**
*
*/
private String recevBar1d;
/**
*
*/
private String recevBar2d;
/**
*
*/
private String recevBillNunber;
/**
* 1
*/
private String recevDocCd1;
/**
* 2
*/
private String recevDocCd2;
/**
* 3
*/
private String recevDocCd3;
/**
* 4
*/
private String recevDocCd4;
/**
* 5
*/
private String recevDocCd5;
/**
* 1
*/
private String recevSubj1;
/**
* 2
*/
private String recevSubj2;
/**
* 3
*/
private String recevSubj3;
/**
*
*/
private String recevViolateDt;
/**
*
*/
private String recevViolateDong;
/**
*
*/
private String recevViolatePlace;
/**
*
*/
private String recevLaws;
/**
* 1
*/
private String recevPayNumber1;
/**
* 2
*/
private String recevPayNumber2;
/**
* OCR0
*/
private String recevOcr0;
/**
* OCR1
*/
private String recevOcr1;
/**
* OCR2
*/
private String recevOcr2;
/**
*
*/
private String recevOnlinePayNumber;
/**
*
*/
private String recevFinePrice;
/**
*
*/
private String recevPayPrice;
/**
*
*/
private String recevPayDt;
/**
*
*/
private String recevPayInDate;
/**
*
*/
private String recevPayInPrice;
/**
*
*/
private String recevPayInAddPrice;
/**
*
*/
private String recevPayInDefaultPrice;
/**
*
*/
private String recevPayOutDate;
/**
*
*/
private String recevPayOutPrice;
/**
*
*/
private String recevPayOutAddPrice;
/**
*
*/
private String recevPayOutDefaultPrice;
/**
*
*/
private String recevCarNumber;
/**
*
*/
private String recevCarOwnerZipcode;
/**
*
*/
private String recevCarOwnerAddr;
/**
*
*/
private String recevCarOwnerDetailaddr;
/**
*
*/
private String recevCarOwnerNm;
/**
*
*/
private String recevCarOwnerSsn;
/**
*
*/
private String recevEvidenceNumber;
/**
*
*/
private String recevPhotoCnt;
/**
* 1
*/
private String recevPhotoFilename1;
/**
* 2
*/
private String recevPhotoFilename2;
/**
* 3
*/
private String recevPhotoFilename3;
/**
* 4
*/
private String recevPhotoFilename4;
/**
* 2
*/
private String vractno2;
/**
* 3
*/
private String vractno3;
/**
* 4
*/
private String vractno4;
/**
* 5
*/
private String vractno5;
/**
* 6
*/
private String vractno6;
/**
* 7
*/
private String vractno7;
/**
* 8
*/
private String vractno8;
/**
* 9
*/
private String vractno9;
/**
* 10
*/
private String vractno10;
/**
* 11
*/
private String vractno11;
/**
* 1
*/
private String dtlVarData1;
/**
* 2
*/
private String dtlVarData2;
/**
* 3
*/
private String dtlVarData3;
/**
* 4
*/
private String dtlVarData4;
/**
* 5
*/
private String dtlVarData5;
/**
* ID
*/
private String dlvrRsltId;
/**
*
*/
private String makeRsltCd;
/**
*
*/
private String vractno;
}

@ -0,0 +1,68 @@
package cokr.xit.interfaces.epost;
import cokr.xit.foundation.component.QueryRequest;
/**
*
* <p> :
*
* <pre>
* ============ ============
* 2023-07-03 mjkhan
* ================================
* </pre>
*/
public class EmailRequestQuery extends QueryRequest {
private static final long serialVersionUID = 1L;
private String[] conKeys;
private String[] rgstNmbrs;
private String fromRegDate;
private String toRegDate;
private String[] statusList;
public String[] getConKeys() {
return ifEmpty(conKeys, () -> null);
}
public EmailRequestQuery setConKeys(String... conKeys) {
this.conKeys = conKeys;
return this;
}
public String[] getRgstNmbrs() {
return ifEmpty(rgstNmbrs, () -> null);
}
public EmailRequestQuery setRgstNmbrs(String... rgstNmbrs) {
this.rgstNmbrs = rgstNmbrs;
return this;
}
public String getFromRegDate() {
return fromRegDate;
}
public EmailRequestQuery setFromRegDate(String fromRegDate) {
this.fromRegDate = fromRegDate;
return this;
}
public String getToRegDate() {
return toRegDate;
}
public EmailRequestQuery setToRegDate(String toRegDate) {
this.toRegDate = toRegDate;
return this;
}
public String[] getStatusList() {
return ifEmpty(statusList, () -> null);
}
public EmailRequestQuery setStatusList(String... statusList) {
this.statusList = statusList;
return this;
}
}

@ -0,0 +1,36 @@
package cokr.xit.interfaces.epost;
import cokr.xit.foundation.AbstractEntity;
/**
* @author mjkhan
*/
public abstract class EmailResult extends AbstractEntity {
/** 결과 정보 등록 여부 */
private boolean saved;
/** .
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean isSaved() {
return saved;
}
/** .
* @param saved
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public void setSaved(boolean saved) {
this.saved = saved;
}
/** .
* @return
*/
public abstract EmailResultLog toLog();
}

@ -0,0 +1,48 @@
package cokr.xit.interfaces.epost;
import cokr.xit.foundation.AbstractEntity;
import lombok.Getter;
import lombok.Setter;
/**
*
* @author mjkhan
*/
@Getter
@Setter
public class EmailResultLog extends AbstractEntity {
/**
* ID
*/
private String procId;
/**
*
*/
private long procSeq;
/**
*
*/
private String procType;
/**
* ID
*/
private String resultId;
/**
*
*/
private String conKey;
/**
*
*/
private String rgstNmbr;
/**
*
*/
private String procStt;
}

@ -0,0 +1,107 @@
package cokr.xit.interfaces.epost;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import cokr.xit.foundation.Assert;
import lombok.Getter;
import lombok.Setter;
/**
*
* @author mjkhan
*/
@Getter
@Setter
public class ProductionResult extends EmailResult {
/** 결과 유형 */
public static final String TYPE = "prt_";
/**
*
*/
private String conKey;
/**
*
*/
private String rgstNmbr;
/**
*
*/
private String reletcdata;
/**
*
*/
private String dataCd;
/**
*
*/
private Integer mailCnt;
public ProductionResult parse(String str) {
String[] content = str.split("\\|", -1);
List<Consumer<String>> setters = Arrays.asList(
this::setRgstNmbr
, this::setConKey
, this::setReletcdata
, this::setDataCd
, this::parseTotpostPrc
);
if (setters.size() > content.length)
throw new RuntimeException(String.format("Parsed data has %d fields.", content.length));
for (int i = 0; i < setters.size(); ++i) {
Consumer<String> setter = setters.get(i);
String val = content[i];
setter.accept(val);
}
return this;
}
private void parseTotpostPrc(String str) {
String val = Assert.ifEmpty(str, "0");
setMailCnt(Integer.valueOf(val));
}
/** 처리 유형 (로그) */
private static final String PROC_TYPE = "4";
@Override
public EmailResultLog toLog() {
EmailResultLog log = new EmailResultLog();
log.setProcType(PROC_TYPE);
log.setConKey(conKey);
log.setRgstNmbr(rgstNmbr);
return log;
}
public static Map<String, List<ProductionResult>> byStatus(List<ProductionResult> results) {
if (Assert.isEmpty(results)) return Collections.emptyMap();
HashMap<String, List<ProductionResult>> byStatus = new HashMap<>();
results.stream()
.collect(Collectors.groupingBy(ProductionResult::getReletcdata))
.forEach((conKey, list) -> {
// 하나라도 제작된 것이 있으면 제작 완료
boolean produced = list.stream().filter(result -> "20".equals(result.getDataCd())).count() > 0;
String status = produced ? EmailRequest.PRODUCED : EmailRequest.PROD_FAILED;
ProductionResult result = list.get(0);
List<ProductionResult> tmp = byStatus.computeIfAbsent(status, key -> new ArrayList<>());
tmp.add(result);
});
return byStatus;
}
}

@ -0,0 +1,154 @@
package cokr.xit.interfaces.epost;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import cokr.xit.foundation.Assert;
import lombok.Getter;
import lombok.Setter;
/**
* @author mjkhan
*/
@Getter
@Setter
public class ReceptionResult extends EmailResult {
/** 결과 유형 */
public static final String TYPE = "check_";
/**
* ID
*/
private String rcptnRsltId;
/**
*
*/
private String outsiduserid;
/**
*
*/
private String initTime;
/**
*
*/
private String recvFilename;
/**
*
*/
private String reldivkey;
/**
*
*/
private Integer recprsnseq;
/**
*
*/
private String regino;
/**
*
*/
private String attachfilenm;
/**
* 1
*/
private String junghap1;
/**
* 2
*/
private String junghap2;
/**
* 3
*/
private String junghap3;
/**
*
*/
private String code;
/**
*
*/
private String msg;
public ReceptionResult parse(String str) {
String[] content = str.split("\\|", -1);
List<Consumer<String>> setters = Arrays.asList(
this::setOutsiduserid
, this::setInitTime
, this::setRecvFilename
, this::setReldivkey
, this::parseRecprsnseq
, this::setRegino
, this::setAttachfilenm
, this::setJunghap1
, this::setJunghap2
, this::setJunghap3
, this::setCode
, this::setMsg
);
if (setters.size() > content.length)
throw new RuntimeException(String.format("Parsed data has %d fields.", content.length));
for (int i = 0; i < setters.size(); ++i) {
Consumer<String> setter = setters.get(i);
String val = content[i];
setter.accept(val);
}
return this;
}
private void parseRecprsnseq(String str) {
String val = Assert.ifEmpty(str, "0");
setRecprsnseq(Integer.valueOf(val));
}
/** 처리 유형 (로그) */
private static final String PROC_TYPE = "2";
@Override
public EmailResultLog toLog() {
EmailResultLog log = new EmailResultLog();
log.setProcType(PROC_TYPE);
log.setResultId(rcptnRsltId);
log.setConKey(reldivkey);
log.setRgstNmbr(regino);
return log;
}
public static Map<String, List<ReceptionResult>> byStatus(List<ReceptionResult> results) {
if (Assert.isEmpty(results)) return Collections.emptyMap();
HashMap<String, List<ReceptionResult>> byStatus = new HashMap<>();
results.stream()
.collect(Collectors.groupingBy(ReceptionResult::getReldivkey))
.forEach((conKey, list) -> {
// 하나라도 오류면 제작불가
boolean invalid = list.stream().filter(result -> !"200".equals(result.getCode())).count() > 0;
ReceptionResult result = list.get(0);
String status = invalid ? EmailRequest.INVALID : EmailRequest.VALID;
List<ReceptionResult> tmp = byStatus.computeIfAbsent(status, key -> new ArrayList<>());
tmp.add(result);
});
return byStatus;
}
}

@ -0,0 +1,145 @@
package cokr.xit.interfaces.epost;
import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;
import cokr.xit.foundation.Assert;
import lombok.Getter;
import lombok.Setter;
/**
*
* @author mjkhan
*/
@Getter
@Setter
public class RegistrationResult extends EmailResult {
/** 결과 유형 */
public static final String TYPE = "recv_";
/**
* ID
*/
private String rcptRsltId;
/**
*
*/
private String conOrg;
/**
*
*/
private String relorsectCd;
/**
*
*/
private String reletcdata;
/**
*
*/
private String extriRegymd;
/**
*
*/
private String rceptYmd;
/**
*
*/
private String rceptId;
/**
*
*/
private String divKb;
/**
*
*/
private Integer rceptCnt;
/**
*
*/
private Integer rceptAmt;
/**
*
*/
private Integer usefeeAmt;
/**
*
*/
private Integer totpostPrc;
/**
*
*/
private String jobCd;
public RegistrationResult parse(String str) {
String[] content = str.split("\\|", -1);
List<Consumer<String>> setters = Arrays.asList(
this::setConOrg
, this::setRelorsectCd
, this::setReletcdata
, this::setExtriRegymd
, this::setRceptYmd
, this::setRceptId
, this::setDivKb
, this::parseRceptCnt
, this::parseRceptAmt
, this::parseUsefeeAmt
, this::parseTotpostPrc
);
if (setters.size() > content.length)
throw new RuntimeException(String.format("Parsed data has %d fields.", content.length));
for (int i = 0; i < setters.size(); ++i) {
Consumer<String> setter = setters.get(i);
String val = content[i];
setter.accept(val);
}
return this;
}
private void parseRceptCnt(String str) {
String val = Assert.ifEmpty(str, "0");
setRceptCnt(Integer.valueOf(val));
}
private void parseRceptAmt(String str) {
String val = Assert.ifEmpty(str, "0");
setRceptAmt(Integer.valueOf(val));
}
private void parseUsefeeAmt(String str) {
String val = Assert.ifEmpty(str, "0");
setUsefeeAmt(Integer.valueOf(val));
}
private void parseTotpostPrc(String str) {
String val = Assert.ifEmpty(str, "0");
setTotpostPrc(Integer.valueOf(val));
}
/** 처리 유형 (로그) */
private static final String PROC_TYPE = "3";
@Override
public EmailResultLog toLog() {
EmailResultLog log = new EmailResultLog();
log.setProcType(PROC_TYPE);
log.setResultId(rcptRsltId);
log.setConKey(reletcdata);
return log;
}
}

@ -0,0 +1,342 @@
package cokr.xit.interfaces.epost.dao;
import java.util.List;
import java.util.Map;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.foundation.util.ListSupport;
import cokr.xit.interfaces.epost.EmailRequest;
import cokr.xit.interfaces.epost.EmailRequestDetail;
import cokr.xit.interfaces.epost.EmailRequestQuery;
import cokr.xit.interfaces.epost.EmailResult;
/** DAO
*
* <p> :
*
* <pre>
* ============ ============
* 2023-07-03 mjkhan
* ================================
* </pre>
*/
@Mapper("emailRequestMapper")
public interface EmailRequestMapper extends AbstractMapper {
/** .
* @param params
* <ul><li>"conOrg" - </li>
* </ul>
* @return
*/
List<DataObject> selectSendingRequestList(Map<String, Object> params);
/** .
* @param conOrg
* @return
*/
default List<DataObject> selectSendingRequestList(String conOrg) {
return selectSendingRequestList(params().set("conOrg", conOrg));
}
/** .<br />
* @param req
* @return
*/
List<DataObject> selectRequestList(EmailRequestQuery req);
/** conKey .<br />
* @param conKey
* @return
*/
default DataObject selectRequestInfo(String conKey) {
List<DataObject> list = selectRequestList(new EmailRequestQuery().setConKeys(conKey));
return !list.isEmpty() ? list.get(0) : null;
}
/** .
* @param req
* @return
*/
List<EmailRequest> selectRequests(EmailRequestQuery req);
/** .
* @param req
* @return
*/
default List<EmailRequest> selectRequests(String... conKeys) {
return selectRequests(new EmailRequestQuery().setConKeys(conKeys));
}
/** .
* @param params
* <ul><li>"emailRequest" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
int insertRequest(Map<String, Object> params);
/** .
* @param request
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
default boolean insert(EmailRequest request) {
return request != null
&& insertRequest(params().set("emailRequest", request)) == 1;
}
/** .
* @param params
* <ul><li>"emailRequest" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
int updateRequest(Map<String, Object> params);
/** .
* @param request
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
default boolean update(EmailRequest request) {
return request != null
&& updateRequest(params().set("emailRequest", request)) == 1;
}
/** .
* @param params
* <ul><li>"resultType" - </li>
* <li>"results" - </li>
* <li>"maxStatus" - </li>
* <li>"status" - </li>
* <li>"conKeys" - conKey</li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
int updateRequestStatus(Map<String, Object> params);
/** .
* @param maxStatus
* @param status
* @param conKeys
* @param workSize
* @return
*/
default <T extends EmailResult> int updateRequestStatus(String resultType, Iterable<T> results, String maxStatus, String status, int workSize) {
List<T> list = ListSupport.asList(results);
if (list.isEmpty()) return 0;
ListSupport<T> listSupport = new ListSupport<T>()
.setWorkSize(workSize)
.setIterable(list.stream().filter(EmailResult::isSaved).toList());
DataObject params = params()
.set("resultType", resultType)
.set("maxStatus", maxStatus)
.set("status", status);
int affected = 0;
for (List<T> objs: listSupport.split()) {
affected += updateRequestStatus(
params.set("results", objs)
);
}
return affected;
}
/** .
* @param maxStatus
* @param status
* @param conKeys
* @param workSize
* @return
*/
default int updateRequestStatus(String maxStatus, String status, Iterable<String> conKeys, int workSize) {
ListSupport<String> listSupport = new ListSupport<String>()
.setWorkSize(workSize)
.setIterable(conKeys);
DataObject params = params()
.set("status", status)
.set("maxStatus", maxStatus);
int affected = 0;
for (List<String> keys: listSupport.split()) {
affected += updateRequestStatus(
params.set("conKeys", keys)
);
}
return affected;
}
/** .
* @param status
* @param conKeys
* @return
*/
default int updateRequestStatus(String status, Iterable<String> conKeys, int workSize) {
return updateRequestStatus(status, status, conKeys, workSize);
}
/** .
* @param params
* <ul><li>expiryDays - </li>
* <li>status - </li>
* </ul>
* @return
*/
int updateRequestAsDelivered(Map<String, Object> params);
/** .
* @param expiryDays -
* @param status -
* @return
*/
default int updateRequestAsDelivered(int expiryDays, String status) {
DataObject params = params()
.set("expiryDays", expiryDays)
.set("status", status);
return updateRequestAsDelivered(params);
}
/** .
* @param params
* <ul><li>"conKeys" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
int deleteRequest(Map<String, Object> params);
/** .
* @param conKeys
* @return
*/
default int deleteRequest(String... conKeys) {
return deleteRequest(params().set("conKeys", conKeys));
}
/** .<br />
* @param req
* @return
*/
List<DataObject> selectRequestDetailList(EmailRequestQuery req);
/** .<br />
* @param conKey
* @param rgstNmbr
* @return
*/
default DataObject selectRequestDetailInfo(String conKey, String rgstNmbr) {
List<DataObject> list = selectRequestDetailList(new EmailRequestQuery().setConKeys(conKey).setRgstNmbrs(rgstNmbr));
return !list.isEmpty() ? list.get(0) : null;
}
/** .
* @param req
* @return
*/
List<EmailRequestDetail> selectRequestDetails(EmailRequestQuery req);
/** .
* @param conKey
* @return
*/
default List<EmailRequestDetail> selectRequestDetails(String conKey) {
return selectRequestDetails(new EmailRequestQuery().setConKeys(conKey));
}
/** .
* @param conKey
* @param rgstNmbr
* @return
*/
default EmailRequestDetail selectRequestDetail(String conKey, String rgstNmbr) {
List<EmailRequestDetail> list = selectRequestDetails(new EmailRequestQuery().setConKeys(conKey).setRgstNmbrs(rgstNmbr));
return !list.isEmpty() ? list.get(0) : null;
}
/** .
* @param params
* <ul><li>"emailRequestDetail" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
int insertRequestDetail(Map<String, Object> params);
/** .
* @param requestDetail
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
default boolean insert(EmailRequestDetail requestDetail) {
return requestDetail != null
&& insertRequestDetail(params().set("emailRequestDetail", requestDetail)) == 1;
}
/** .
* @param params
* <ul><li>"emailRequestDetail" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
int updateRequestDetail(Map<String, Object> params);
/** .
* @param requestDetail
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
default boolean update(EmailRequestDetail requestDetail) {
return requestDetail != null
&& updateRequestDetail(params().set("emailRequestDetail", requestDetail)) == 1;
}
/** .
* @param params
* @return
*/
int updateRequestDetailStatus(Map<String, Object> params);
/** .
* @param resultType
* @param results
* @param workSize
* @return
*/
default <T extends EmailResult> int updateRequestDetailStatus(String resultType, List<T> results, int workSize) {
int affected = 0;
ListSupport<T> listSupport = new ListSupport<T>()
.setWorkSize(workSize)
.setIterable(results);
DataObject params = params().set("resultType", resultType);
for (List<T> list: listSupport.split()) {
params.set("results", list);
affected += updateRequestDetailStatus(params);
}
return affected;
}
}

@ -0,0 +1,224 @@
package cokr.xit.interfaces.epost.dao;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.foundation.util.ListSupport;
import cokr.xit.interfaces.epost.DeliveryResult;
import cokr.xit.interfaces.epost.EmailResult;
import cokr.xit.interfaces.epost.EmailResultLog;
import cokr.xit.interfaces.epost.ProductionResult;
import cokr.xit.interfaces.epost.ReceptionResult;
import cokr.xit.interfaces.epost.RegistrationResult;
/** DAO
*
* <p> :
*
* <pre>
* ============ ============
* 2023-07-03 mjkhan
* ================================
* </pre>
*/
@Mapper("emailResultMapper")
public interface EmailResultMapper extends AbstractMapper {
/** .
* @param result
* @return
*/
int insertReceptionResult(ReceptionResult result);
private <T extends EmailResult> int insertEmailResults(Iterable<T> results, Function<T, Integer> insert) {
int affected = 0;
for (T result: results) {
int saved = insert.apply(result);
result.setSaved(saved > 0);
affected += saved;
}
return affected;
}
/** .
* @param results
* @return
*/
default int insertReceptionResults(Iterable<ReceptionResult> results) {
return insertEmailResults(results, this::insertReceptionResult);
}
/** .
* @param result
* @return
*/
int insertRegistrationResult(RegistrationResult result);
/** .
* @param results
* @return
*/
default int insertRegistrationResults(Iterable<RegistrationResult> results) {
return insertEmailResults(results, this::insertRegistrationResult);
}
/** (jobCd) .
* @param params
* <ul><li>"conKeys" - </li>
* </ul>
* @return
*/
int updateRegistrationResult(Map<String, Object> params);
/** (jobCd) .
* @param conKeys -
* @param workSize
* @return
*/
default int updateRegistrationResult(List<RegistrationResult> results, int workSize) {
List<String> conKeys = results.stream()
.filter(RegistrationResult::isSaved)
.map(RegistrationResult::getReletcdata)
.toList();
ListSupport<String> listSupport = new ListSupport<String>()
.setWorkSize(workSize)
.setIterable(conKeys);
int affected = 0;
Map<String, Object> params = params();
for (List<String> keys: listSupport.split()) {
params.put("conKeys", keys);
affected += updateRegistrationResult(params);
}
return affected;
}
/** .
* @param result
* @return
*/
int insertProductionResult(ProductionResult result);
/** .
* @param results
* @return
*/
default int insertProductionResults(Iterable<ProductionResult> results) {
return insertEmailResults(results, this::insertProductionResult);
}
/** .
* @param result
* @return
*/
int insertDeliveryResult(DeliveryResult result);
/** .
* @param results
* @return
*/
default int insertDeliveryResults(Iterable<DeliveryResult> results) {
return insertEmailResults(results, this::insertDeliveryResult);
}
/** .
* @param params
* <ul><li>procID - </li>
* <li>fetchSize - </li>
* </ul>
* @return
*/
List<DataObject> selectResultLogs(Map<String, Object> params);
/** .
* @param procID
* @param fetchSize
* @return
*/
default List<DataObject> selectResultLogs(String procID, int fetchSize) {
DataObject params = params()
.set("procID", procID)
.set("pageNum", 1)
.set("fetchSize", fetchSize)
.set("orderBy", "PROC_SEQ");
return selectResultLogs(params);
}
/** .
* @param params
* <ul><li>"logs" - </li>
* </ul>
* @return
*/
int insertResultLogs(Map<String, Object> params);
/** .
* @param logs
* @param workSize
* @return
*/
default String insertResultLogs(List<EmailResultLog> logs, int workSize) {
List<EmailResultLog> list = ListSupport.asList(logs);
if (list.isEmpty()) return null;
ListSupport<EmailResultLog> listSupport = new ListSupport<EmailResultLog>()
.setWorkSize(workSize)
.setIterable(logs);
String procID = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
for (int i = 0; i < logs.size(); ++i) {
EmailResultLog log = logs.get(i);
log.setProcId(procID);
log.setProcSeq(i + 1);
}
DataObject params = params();
for (List<EmailResultLog> objs: listSupport.split()) {
params.set("logs", objs);
insertResultLogs(params);
}
return procID;
}
/** .
* @param params
* <ul><li>"logs" - </li>
* </ul>
* @return
*/
int updateResultLogStatus(Map<String, Object> params);
/** .
* @param logs
* @param workSize
* @return
*/
default int updateResultLogStatus(List<DataObject> logs, int workSize) {
ListSupport<DataObject> listSupport = new ListSupport<DataObject>()
.setWorkSize(workSize)
.setIterable(logs);
DataObject params = params();
int affected = 0;
for (List<DataObject> objs: listSupport.split()) {
params.set("logs", objs);
affected += updateResultLogStatus(params);
}
return affected;
}
}

@ -0,0 +1,3 @@
/** DAO
*/
package cokr.xit.interfaces.epost.dao;

@ -0,0 +1,17 @@
/** .
* <p>
* <ul><li> - </li>
* <li> - /</li>
* </ul>
* .
* <p> <a href="{@docRoot}/doc-files/xit-smg.sql" target="_blank"> </a> .
* <ul><li> - TB_ESB_INTERFACE</li>
* <li> - TB_ESB_INTERFACE_FILE</li>
* <li> - TB_FILE</li>
* </ul>
* / .
* <ul><li> / - TB_ESB_INTERFACE_TRSM</li>
* </ul>
* 'conf/file-job.conf' .
*/
package cokr.xit.interfaces.epost;

@ -0,0 +1,116 @@
package cokr.xit.interfaces.epost.service;
import java.util.List;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.interfaces.epost.EmailRequest;
import cokr.xit.interfaces.epost.EmailRequestDetail;
import cokr.xit.interfaces.epost.EmailRequestQuery;
/** .
*
* <p> :
*
* <pre>
* ============ ============
* 2023-07-03 mjkhan
* ================================
* </pre>
*/
public interface EmailRequestService {
/** .
*/
void sendRequests();
/** .
* @param req
* @return
*/
List<DataObject> getRequestList(EmailRequestQuery req);
/** conKey .
* @param conKey
* @return
*/
DataObject getRequestInfo(String conKey);
/** conKeys .
* @param conKeys
* @return
*/
List<EmailRequest> getRequests(String... conKeys);
/** .
* @param request
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
boolean create(EmailRequest request);
/** .
* @param request
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
boolean update(EmailRequest request);
/** .<br />
* file-job.conf epost-send-request/expiryDays .
* @return
*/
void updateRequestAsDelivered();
/** .
* @param conKeys
* @return
*/
int removeRequest(String... conKeys);
/** .
* @param req
* @return
*/
List<DataObject> getRequestDetailList(EmailRequestQuery req);
/** .<br />
* @param conKey
* @param rgstNmbr
* @return
*/
DataObject getRequestDetailInfo(String conKey, String rgstNmbr);
/** .
* @param conKey
* @return
*/
List<EmailRequestDetail> getRequestDetails(String conKey);
/** .
* @param conKey
* @param rgstNmbr
* @return
*/
EmailRequestDetail getRequestDetail(String conKey, String rgstNmbr);
/** .
* @param requestDetail
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
boolean create(EmailRequestDetail requestDetail);
/** .
* @param requestDetail
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
boolean update(EmailRequestDetail requestDetail);
}

@ -0,0 +1,41 @@
package cokr.xit.interfaces.epost.service;
import java.util.List;
import cokr.xit.foundation.data.DataObject;
/** .
*
* <p> :
*
* <pre>
* ============ ============
* 2023-07-03 mjkhan
* ================================
* </pre>
*/
public interface EmailResultService {
/** .
*/
void receiveReceptionResults();
/** .
*/
void receiveRegistrationResults();
/** .
*/
void receiveProductionResults();
/** .
*/
void receiveDeliveryResults();
/** , , , .
*/
void receiveResults();
List<DataObject> getResultLogs(String procID, int fetchSize);
int updateResultLogStatus(List<DataObject> logs);
}

@ -0,0 +1,248 @@
package cokr.xit.interfaces.epost.service.bean;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import cokr.xit.base.file.ZIP;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.interfaces.epost.EmailRequest;
import cokr.xit.interfaces.epost.EmailRequestDetail;
import cokr.xit.interfaces.epost.EmailRequestQuery;
import cokr.xit.interfaces.epost.dao.EmailRequestMapper;
import cokr.xit.interfaces.filejob.service.bean.FileJobBean;
/** Bean
*
* <p> :
*
* <pre>
* ============ ============
* 2023-07-03 mjkhan
* ================================
* </pre>
*/
@Component("emailRequestBean")
public class EmailRequestBean extends FileJobBean {
/** 전자우편 신청 정보 DAO */
@Resource(name = "emailRequestMapper")
private EmailRequestMapper requestMapper;
@Override
public String jobName() {
return "epost-send-request";
}
private int workSize() {
return toInt(ifEmpty(config("workSize"), "100"));
}
/** .
* @return
*/
public void sendRequests() {
List<DataObject> reqList = requestMapper.selectSendingRequestList(config("conOrg"));
if (reqList.isEmpty()) return;
String sendWorkingDir = sendWorkingDir(),
zipFilename = config("zipFilename"),
txtFilename = config("txtFilename");
mkdirs(sendWorkingDir);
ZIP zip = new ZIP();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS");
ArrayList<Path> paths = new ArrayList<>();
Map<String, List<DataObject>> byConKey = reqList.stream().collect(Collectors.groupingBy(row -> row.string("CON_KEY")));
byConKey.forEach((conKey, list) -> {
Path path = compressAttachments(zip, Paths.get(sendWorkingDir, zipFilename.replace("{conKey}", conKey)), list);
paths.add(path);
path = writeData(Paths.get(sendWorkingDir, txtFilename.replace("{yyyyMMddHHmmssSSS}", dateFormat.format(new Date()))), list);
paths.add(path);
});
move(
paths.stream().filter(path -> path != null).toList(),
sendDir()
);
requestMapper.updateRequestStatus(EmailRequest.SENT, byConKey.keySet(), workSize());
}
private Path compressAttachments(ZIP zip, Path zipPath, List<DataObject> list) {
List<String> paths = getAttachmentPaths(list);
if (paths.isEmpty()) return null;
zip.compress(zipPath.toString(), paths);
list.forEach(row -> row.put("ATTACH_NM", row.string("CON_KEY") + ".zip"));
return zipPath;
}
private List<String> getAttachmentPaths(List<DataObject> list) {
if (isEmpty(list)) return Collections.emptyList();
String attachmentDir = config("attachmentDir");
return list.stream()
.flatMap(row -> row.entrySet().stream()
.filter(entry -> entry.getKey().startsWith("RECEV_PHOTO_FILENAME") && !isEmpty(entry.getValue()))
.map(entry -> Paths.get(attachmentDir, (String)entry.getValue()).toString())
)
.toList();
}
private Path writeData(Path txtPath, List<DataObject> list) {
try {
String content = list.stream()
.map(row -> row.entrySet().stream()
.filter(entry -> !entry.getKey().startsWith("_"))
.map(entry -> {
Object value = entry.getValue();
return value instanceof Number ? Long.toString(toLong(value)) : toString(value);
})
.collect(Collectors.joining("|"))
)
.collect(Collectors.joining("\n"));
return Files.writeString(txtPath, content);
} catch (Exception e) {
throw runtimeException(e);
}
}
/** .
* @param req
* @return
*/
public List<DataObject> getRequestList(EmailRequestQuery req) {
return requestMapper.selectRequestList(req);
}
/** conKey .<br />
* @param conKey
* @return
*/
public DataObject getRequestInfo(String conKey) {
return requestMapper.selectRequestInfo(conKey);
}
/** conKeys .
* @param conKeys
* @return
*/
public List<EmailRequest> getRequests(String... conKeys) {
return requestMapper.selectRequests(conKeys);
}
/** .
* @param request
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean create(EmailRequest request) {
request.setRceptId(config("rceptId"));
request.setDataCd("00"); // 신규
request.setDfpayyn("001"); // 후납
request.setMailCnt(1);
return requestMapper.insert(request);
}
/** .
* @param request
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean update(EmailRequest request) {
return requestMapper.update(request);
}
/** .<br />
* file-job.conf epost-send-request/expiryDays .
* @return
*/
public int updateRequestAsDelivered() {
return requestMapper.updateRequestAsDelivered(
toInt(config("expiryDays")),
EmailRequest.DELIVERED
);
}
/** .
* @param conKeys
* @return
*/
public int removeRequest(String... conKeys) {
return requestMapper.deleteRequest(conKeys);
}
/** .
* @param req
* @return
*/
public List<DataObject> getRequestDetailList(EmailRequestQuery req) {
return requestMapper.selectRequestDetailList(req);
}
/** .<br />
* @param conKey
* @param rgstNmbr
* @return
*/
public DataObject getRequestDetailInfo(String conKey, String rgstNmbr) {
return requestMapper.selectRequestDetailInfo(conKey, rgstNmbr);
}
/** .
* @param conKey
* @return
*/
public List<EmailRequestDetail> getRequestDetails(String conKey) {
return requestMapper.selectRequestDetails(conKey);
}
/** .
* @param conKey
* @return
*/
public EmailRequestDetail getRequestDetail(String conKey, String rgstNmbr) {
return requestMapper.selectRequestDetail(conKey, rgstNmbr);
}
/** .
* @param requestDetail
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean create(EmailRequestDetail requestDetail) {
return requestMapper.insert(requestDetail);
}
/** .
* @param requestDetail
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean update(EmailRequestDetail requestDetail) {
return requestMapper.update(requestDetail);
}
}

@ -0,0 +1,105 @@
package cokr.xit.interfaces.epost.service.bean;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.interfaces.epost.EmailRequest;
import cokr.xit.interfaces.epost.EmailRequestDetail;
import cokr.xit.interfaces.epost.EmailRequestQuery;
import cokr.xit.interfaces.epost.service.EmailRequestService;
import cokr.xit.interfaces.filejob.service.bean.FileJobServiceBean;
/** .
*
* <p> :
*
* <pre>
* ============ ============
* 2023-07-03 mjkhan
* ================================
* </pre>
*/
@Service("emailRequestService")
public class EmailRequestServiceBean extends FileJobServiceBean implements EmailRequestService {
/** 전자우편 신청 정보 Bean */
@Resource(name = "emailRequestBean")
private EmailRequestBean requestBean;
@Override
public void sendRequests() {
execute(requestBean, requestBean::sendRequests);
}
@Override
public List<DataObject> getRequestList(EmailRequestQuery req) {
return requestBean.getRequestList(req);
}
/** conKey .<br />
* @param conKey
* @return
*/
@Override
public DataObject getRequestInfo(String conKey) {
return requestBean.getRequestInfo(conKey);
}
@Override
public List<EmailRequest> getRequests(String... conKeys) {
return requestBean.getRequests(conKeys);
}
@Override
public boolean create(EmailRequest request) {
return requestBean.create(request);
}
@Override
public boolean update(EmailRequest request) {
return requestBean.update(request);
}
@Override
public void updateRequestAsDelivered() {
execute(requestBean, requestBean::updateRequestAsDelivered);
}
@Override
public int removeRequest(String... conKeys) {
return requestBean.removeRequest(conKeys);
}
@Override
public List<DataObject> getRequestDetailList(EmailRequestQuery req) {
return requestBean.getRequestDetailList(req);
}
@Override
public DataObject getRequestDetailInfo(String conKey, String rgstNmbr) {
return requestBean.getRequestDetailInfo(conKey, rgstNmbr);
}
@Override
public List<EmailRequestDetail> getRequestDetails(String conKey) {
return requestBean.getRequestDetails(conKey);
}
@Override
public EmailRequestDetail getRequestDetail(String conKey, String rgstNmbr) {
return requestBean.getRequestDetail(conKey, rgstNmbr);
}
@Override
public boolean create(EmailRequestDetail requestDetail) {
return requestBean.create(requestDetail);
}
@Override
public boolean update(EmailRequestDetail requestDetail) {
return requestBean.update(requestDetail);
}
}

@ -0,0 +1,283 @@
package cokr.xit.interfaces.epost.service.bean;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.foundation.web.WebClient;
import cokr.xit.interfaces.epost.DeliveryResult;
import cokr.xit.interfaces.epost.EmailRequest;
import cokr.xit.interfaces.epost.EmailResult;
import cokr.xit.interfaces.epost.EmailResultLog;
import cokr.xit.interfaces.epost.ProductionResult;
import cokr.xit.interfaces.epost.ReceptionResult;
import cokr.xit.interfaces.epost.RegistrationResult;
import cokr.xit.interfaces.epost.dao.EmailRequestMapper;
import cokr.xit.interfaces.epost.dao.EmailResultMapper;
import cokr.xit.interfaces.filejob.service.bean.FileJobBean;
/** Bean
*
* <p> :
*
* <pre>
* ============ ============
* 2023-07-03 mjkhan
* ================================
* </pre>
*/
@Component("emailResultBean")
public class EmailResultBean extends FileJobBean {
/** 전자우편 신청 DAO */
@Resource(name = "emailRequestMapper")
private EmailRequestMapper requestMapper;
/** 전자우편 결과 DAO */
@Resource(name = "emailResultMapper")
private EmailResultMapper resultMapper;
@Override
public String jobName() {
return "epost-receive-result";
}
private int workSize() {
return toInt(ifEmpty(config("workSize"), "100"));
}
/** 결과 유형별 핸들러 */
private Map<String, Function<List<Path>, List<FileStatus>>> receivers = Map.of(
ReceptionResult.TYPE, this::receiveReceptionResults,
RegistrationResult.TYPE, this::receiveRegistrationResults,
ProductionResult.TYPE, this::receiveProductionResults,
DeliveryResult.TYPE, this::receiveDeliveryResults
);
/** . .
* @param types
* <ul><li> - {@link ReceptionResult#TYPE}</li>
* <li> - {@link RegistrationResult#TYPE}</li>
* <li> - {@link ProductionResult#TYPE}</li>
* <li> - {@link DeliveryResult#TYPE}</li>
* </ul>
*/
public void receiveResults(String... types) {
List<String> resultTypes = !isEmpty(types) ?
List.of(types) :
List.of(
ReceptionResult.TYPE,
RegistrationResult.TYPE,
ProductionResult.TYPE,
DeliveryResult.TYPE
);
List<Path> paths = getReceivedFilePaths(path -> resultTypes.contains(resultType(path)));
if (paths.isEmpty()) return;
ArrayList<FileStatus> processed = new ArrayList<>();
paths.stream()
.collect(Collectors.groupingBy(path -> resultType(path))) //결과 유형별 분류
.forEach((type, pathList) -> {
Function<List<Path>, List<FileStatus>> receiver = receivers.get(type);
if (receiver == null) return;
processed.addAll(receiver.apply(pathList)); //결과파일 처리
});
Map<Boolean, List<FileStatus>> successFail = processed.stream() //처리 결과를 성공 / 실패로 분류
.collect(Collectors.groupingBy(file -> file.isSuccess()));
List<FileStatus> success = successFail.get(true);
createLogs(success);
move(FileStatus.getPaths(success), successDir()); // 성공 디렉토리로 이동
move(FileStatus.getPaths(successFail.get(false)), failDir()); // 실패 디렉토리로 이동
}
private String resultType(Path path) {
String filename = path.getFileName().toString();
for (String type: receivers.keySet()) {
if (filename.contains(type))
return type;
}
throw new RuntimeException("Invalid result file: " + filename);
}
/** .
*/
private List<FileStatus> receiveReceptionResults(List<Path> paths) {
List<FileStatus> fileStatus = readReceived(paths, Charset.forName("EUC_KR"), line -> new ReceptionResult().parse(line));
fileStatus = writeReceived(fileStatus, resultMapper::insertReceptionResults);
List<ReceptionResult> results = getResults(fileStatus, true);
ReceptionResult.byStatus(results).forEach((status, list) ->
requestMapper.updateRequestStatus(
"reception",
list,
status,
status,
workSize()
)
);
return fileStatus;
}
/** .
*/
private List<FileStatus> receiveRegistrationResults(List<Path> paths) {
List<FileStatus> fileStatus = readReceived(paths, null, line -> new RegistrationResult().parse(line));
fileStatus = writeReceived(fileStatus, resultMapper::insertRegistrationResults);
List<RegistrationResult> results = getResults(fileStatus, true);
resultMapper.updateRegistrationResult(results, workSize());
requestMapper.updateRequestStatus(
"registration",
results,
EmailRequest.REGISTERED,
EmailRequest.REGISTERED,
workSize()
);
return fileStatus;
}
/** .
*/
private List<FileStatus> receiveProductionResults(List<Path> paths) {
List<FileStatus> fileStatus = readReceived(paths, null, line -> new ProductionResult().parse(line));
fileStatus = writeReceived(fileStatus, resultMapper::insertProductionResults);
List<ProductionResult> results = getResults(fileStatus, true);
String resultType = "production";
ProductionResult.byStatus(results).forEach((status, list) ->
requestMapper.updateRequestStatus(
resultType,
list,
status,
status,
workSize()
)
);
requestMapper.updateRequestDetailStatus(resultType, results, workSize());
return fileStatus;
}
/** .
*/
private List<FileStatus> receiveDeliveryResults(List<Path> paths) {
List<FileStatus> fileStatus = readReceived(paths, null, line -> new DeliveryResult().parse(line));
fileStatus = writeReceived(fileStatus, resultMapper::insertDeliveryResults);
String resultType = "delivery";
List<DeliveryResult> results = getResults(fileStatus, true);
DeliveryResult.byStatus(results).forEach((status, list) ->
requestMapper.updateRequestStatus(
resultType,
list,
status,
status,
workSize()
)
);
requestMapper.updateRequestDetailStatus(resultType, results, workSize());
return fileStatus;
}
/** .
* @param fileStatus
*/
private void createLogs(List<FileStatus> fileStatus) {
List<EmailResult> results = getResults(fileStatus, false);
config("workSize");
String procID = resultMapper.insertResultLogs(results.stream().map(EmailResult::toLog).toList(), workSize());
String alert = config("alert");
if (isEmpty(alert)) return;
new WebClient().post(req ->
req.uri(alert)
.data("procID", procID)
.data("infoCount", results.size())
.json(true)
.async(true)
);
}
private <T> List<FileStatus> readReceived(List<Path> paths, Charset charset, Function<String, T> parser) {
Charset chars = ifEmpty(charset, Charset::defaultCharset);
return isEmpty(paths) ?
Collections.emptyList() :
paths.stream()
.map(path -> {
FileStatus status = new FileStatus().setPath(path);
try {
List<T> results = Files.lines(path, chars)
.map(line -> parser.apply(line))
.toList();
return status.set("results", results);
} catch (Exception e) {
return status.setCause(e);
}
})
.toList();
}
private <T extends EmailResult> List<FileStatus> writeReceived(List<FileStatus> fileStatus, Consumer<List<T>> writer) {
if (isEmpty(fileStatus)) return Collections.emptyList();
List<T> results = getResults(fileStatus, false);
writer.accept(results);
return fileStatus;
}
@SuppressWarnings("unchecked")
private <T extends EmailResult> List<T> getResults(List<FileStatus> fileStatus, boolean savedOnly) {
return fileStatus.stream()
.filter(FileStatus::isSuccess)
.flatMap(status -> ((List<T>)status.get("results")).stream())
.toList().stream()
.filter(savedOnly ? EmailResult::isSaved : (result) -> true)
.toList();
}
/** .
* @param procID
* @param fetchSize
* @return
*/
public List<DataObject> getResultLogs(String procID, int fetchSize) {
return resultMapper.selectResultLogs(procID, fetchSize);
}
/** .
* @param log
* @return
*/
public String createResultLogs(List<EmailResultLog> logs) {
return resultMapper.insertResultLogs(logs, workSize());
}
/** .
* @param logs
* @return
*/
public int updateResultLogStatus(List<DataObject> logs) {
return resultMapper.updateResultLogStatus(logs, workSize());
}
}

@ -0,0 +1,67 @@
package cokr.xit.interfaces.epost.service.bean;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.interfaces.epost.DeliveryResult;
import cokr.xit.interfaces.epost.ProductionResult;
import cokr.xit.interfaces.epost.ReceptionResult;
import cokr.xit.interfaces.epost.RegistrationResult;
import cokr.xit.interfaces.epost.service.EmailResultService;
import cokr.xit.interfaces.filejob.service.bean.FileJobServiceBean;
/** .
*
* <p> :
*
* <pre>
* ============ ============
* 2023-07-03 mjkhan
* ================================
* </pre>
*/
@Service("emailResultService")
public class EmailResultServiceBean extends FileJobServiceBean implements EmailResultService {
/** 전자우편 접수 결과 정보 Bean */
@Resource(name = "emailResultBean")
private EmailResultBean resultBean;
@Override
public void receiveReceptionResults() {
execute(resultBean, () -> resultBean.receiveResults(ReceptionResult.TYPE));
}
@Override
public void receiveRegistrationResults() {
execute(resultBean, () -> resultBean.receiveResults(RegistrationResult.TYPE));
}
@Override
public void receiveProductionResults() {
execute(resultBean, () -> resultBean.receiveResults(ProductionResult.TYPE));
}
@Override
public void receiveDeliveryResults() {
execute(resultBean, () -> resultBean.receiveResults(DeliveryResult.TYPE));
}
@Override
public void receiveResults() {
execute(resultBean, () -> resultBean.receiveResults());
}
@Override
public List<DataObject> getResultLogs(String procID, int fetchSize) {
return resultBean.getResultLogs(procID, fetchSize);
}
@Override
public int updateResultLogStatus(List<DataObject> logs) {
return resultBean.updateResultLogStatus(logs);
}
}

@ -0,0 +1,3 @@
/**
*/
package cokr.xit.interfaces.epost.service.bean;

@ -0,0 +1,3 @@
/**
*/
package cokr.xit.interfaces.epost.service;

@ -0,0 +1,54 @@
package cokr.xit.interfaces.epost.web;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.foundation.web.AbstractController;
import cokr.xit.interfaces.epost.service.EmailRequestService;
import cokr.xit.interfaces.epost.service.EmailResultService;
@Controller
@RequestMapping(name = "전자우편 신청 결과", value = "/api/epost/result")
public class ApiController extends AbstractController {
@Resource(name = "emailRequestService")
private EmailRequestService requestService;
@Resource(name = "emailResultService")
private EmailResultService resultService;
@PostMapping(name = "/전자우편 신청결과 통보", value = "/receive.do")
public ModelAndView receive(@RequestBody Map<String, Object> resultInfo) {
log().debug("received processID: {}", resultInfo);
return new ModelAndView("jsonView")
.addObject("received", true);
}
@PostMapping(name = "/전자우편 신청결과 로그 조회", value = "/list.do")
public ModelAndView getResultLogs(@RequestBody Map<String, Object> req) {
String procID = (String)req.get("procID");
int fetchSize = (Integer)req.get("fetchSize");
List<DataObject> list = resultService.getResultLogs(procID, fetchSize);
DataObject last = list.isEmpty() ? null : list.get(list.size() - 1);
boolean more = last != null && last.number("TOT_CNT").longValue() > last.number("").longValue();
return new ModelAndView("jsonView")
.addObject("logs", list)
.addObject("more", more);
}
@PostMapping(name = "/전자우편 신청결과 상태 변경", value = "/update.do")
public ModelAndView updateResultLogStatus(@RequestBody Map<String, Object> req) {
List<DataObject> logs = (List<DataObject>)req.get("logs");
int affected = resultService.updateResultLogStatus(logs);
return new ModelAndView("jsonView")
.addObject("affected", affected)
.addObject("saved", affected > 0);
}
}

@ -0,0 +1,177 @@
package cokr.xit.interfaces.epost.web;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.foundation.web.AbstractController;
import cokr.xit.interfaces.epost.EmailRequest;
import cokr.xit.interfaces.epost.EmailRequestDetail;
import cokr.xit.interfaces.epost.EmailRequestQuery;
import cokr.xit.interfaces.epost.service.EmailRequestService;
/**
*
* <p> :
*
* <pre>
* ============ ============
* 2023-07-03 mjkhan
* ================================
* </pre>
*/
@RequestMapping(name = "전자우편 신청", value = "/request")
public class EmailRequestController extends AbstractController {
/**전자우편 신청 서비스*/
@Resource(name = "emailRequestService")
private EmailRequestService emailRequestService;
/** (request/request-main) .
* {@link #getEmailRequestList(EmailRequestQuery) } .
* @return /request/request-main
*/
@RequestMapping(name = "전자우편 신청 메인", value = "/main.do")
public ModelAndView main() {
ModelAndView mav = getEmailRequestList(new EmailRequestQuery().setPageNum(1));
mav.setViewName("/request/request-main");
return mav.addObject("requestList", toJson(mav.getModel().get("requestList")));
}
/** .<br />
* {@link EmailRequestService#getRequestList(EmailRequestQuery)}
* @param req
* @return jsonView
* <pre><code> {
* "requestList": [ ]
* "requestStart":
* "requestFetch":
* "requestTotal":
* }</code></pre>
*/
@RequestMapping(name = "전자우편 신청 조회", value = "/list.do")
public ModelAndView getEmailRequestList(EmailRequestQuery req) {
List<?> result = emailRequestService.getRequestList(setFetchSize(req));
return setCollectionInfo(new ModelAndView("jsonView"), result, "emailRequest");
}
/** .<br />
* {@link EmailRequestService#getRequestInfo(String)}
* @param conKey
* @return jsonView
* <pre><code> {
* "emailRequestInfo":
* }</code></pre>
*/
@RequestMapping(name = "전자우편 신청 정보 조회", value = "/info.do")
public ModelAndView getEmailRequestInfo(String conKey) {
return new ModelAndView("jsonView")
.addObject("requestInfo", emailRequestService.getRequestInfo(conKey));
}
/** .
* @param request
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name = "전자우편 신청 등록", value = "/create.do")
public ModelAndView create(EmailRequest request) {
boolean saved = emailRequestService.create(request);
return new ModelAndView("jsonView")
.addObject("saved", saved);
}
/** .
* @param request
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name = "전자우편 신청 수정", value = "/update.do")
public ModelAndView update(EmailRequest request) {
boolean saved = emailRequestService.update(request);
return new ModelAndView("jsonView")
.addObject("saved", saved);
}
/** .
* @param requestIDs
* @return jsonView
* <pre><code> {
* "affected":
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name = "전자우편 신청 제거", value = "/remove.do")
public ModelAndView remove(String[] conKeys) {
int affected = emailRequestService.removeRequest(conKeys);
return new ModelAndView("jsonView")
.addObject("affected", affected)
.addObject("saved", affected > 0);
}
/** .<br />
* {@link emailRequestService#getEmailRequestDetailList(EmailRequestQuery)}
* @param req
* @return jsonView
* <pre><code> {
* "requestDetailList": [ ]
* "requestDetailStart":
* "requestDetailFetch":
* "requestDetailTotal":
* }</code></pre>
*/
@RequestMapping(name = "전자우편 신청 상세 목록 조회", value = "/detail/list.do")
public ModelAndView getRequestDetailList(EmailRequestQuery req) {
List<?> result = emailRequestService.getRequestDetailList(setFetchSize(req));
return setCollectionInfo(new ModelAndView("jsonView"), result, "requestDetail");
}
/** .<br />
* {@link emailRequestService#getEmailRequestDetailInfo(EmailRequestQuery)}
* @param req
* @return jsonView
* <pre><code> {
* "requestDetailInfo":
* }</code></pre>
*/
@RequestMapping(name = "전자우편 신청 상세 정보 조회", value = "/detail/info.do")
public ModelAndView getEmailRequestDetailInfo(String conKey, String rgstNmbr) {
return new ModelAndView("jsonView")
.addObject("requestDetailInfo", emailRequestService.getRequestDetailInfo(conKey, rgstNmbr));
}
/** .
* @param requestDetail
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name = "전자우편 신청 상세 등록", value = "/detail/create.do")
public ModelAndView create(EmailRequestDetail requestDetail) {
boolean saved = emailRequestService.create(requestDetail);
return new ModelAndView("jsonView")
.addObject("saved", saved);
}
/** .
* @param requestDetail
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@PostMapping(name = "전자우편 신청 상세 수정", value = "/detail/update.do")
public ModelAndView update(EmailRequestDetail requestDetail) {
boolean saved = emailRequestService.update(requestDetail);
return new ModelAndView("jsonView")
.addObject("saved", saved);
}
}

@ -0,0 +1,16 @@
package cokr.xit.interfaces.epost.web;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import cokr.xit.foundation.web.AbstractController;
import cokr.xit.interfaces.epost.service.EmailResultService;
@Controller
@RequestMapping(name = "전자우편 신청 결과", value = "/result")
public class EmailResultController extends AbstractController {
@Resource(name = "emailResultService")
private EmailResultService resultService;
}

@ -0,0 +1,3 @@
/**
*/
package cokr.xit.interfaces.epost.web;

@ -0,0 +1,835 @@
<?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.interfaces.epost.dao.EmailRequestMapper">
<!-- 전자우편 신청 정보 매퍼
========== 변경 이력 ==========
2023-07-03 mjkhan 최초 작성
============================ -->
<select id="selectSendingRequestList" parameterType="map" resultType="dataobject">/* 전자우편 접수 전송 대상 조회(emailRequestMapper.selectSendingRequestList) */
SELECT CON_ORG <!-- 외부기관구분코드 -->
, RCEPT_ID <!-- 접수우체국국기호 -->
, DATA_CD <!-- 접수코드 -->
, DIV_KB <!-- 취급구분 -->
, DFPAYYN <!-- 결재방법 -->
, RCPT_KB <!-- 내용문 유형 -->
, SEAL_CD <!-- 내용문 상세 종류 -->
, WORD_KB <!-- 내용문 종류 -->
, MAIL_CNT <!-- 내용문 매수 -->
, RECEV_CNT <!-- 수취인 수 -->
, ENV_CD <!-- 봉투 종류 -->
, COLOR_YN <!-- 칼라우편물/흑백우편물 -->
, MM_YN <!-- 메일머지 플래그 -->
, FLEX_CD <!-- 이면구분 -->
, DM_CNT <!-- 동봉물 개수, 없다면 '0' -->
, SB_FG <!-- 반송불필요여부 -->
, APVL_NB <!-- 승인번호 -->
, SEND_DATE <!-- 신청일자 -->
, SEND_TIME <!-- 전송시간 -->
, A.CON_KEY <!-- 외부 연계 식별키 -->
, RELORSECT_CD <!-- 연계기관결제부서코드 -->
, RGST_NMBR CON_DATA <!-- 외부 연계 추가 데이터 -->
, RECEV_SENDER_NM SENDER_NM <!-- 발송인명 -->
, RECEV_SENDER_ZIPCODE SENDER_ZIPCODE <!-- 우편번호 -->
, RECEV_SENDER_ADDR SENDER_ADDR <!-- 주소(시, 구) -->
, RECEV_SENDER_DETAILADDR SENDER_DTAILADDR <!-- 상세주소 -->
, A.CON_KEY SENDER_DATA <!-- 발송인별 추가 데이터 -->
, @row_no := CASE WHEN @con_key = A.CON_KEY THEN @row_no + 1
ELSE 1
END SQL_CNT <!-- 수취인순번 -->
, @con_key := A.CON_KEY _PREV_CON
, RECEV_CAR_OWNER_NM RECEV_NM <!-- 수취인명 -->
, RECEV_CAR_OWNER_ZIPCODE RECEV_ZIPCODE <!-- 우편번호 -->
, RECEV_CAR_OWNER_ADDR RECEV_ADDR <!-- 주소(시, 구) -->
, RECEV_CAR_OWNER_DETAILADDR RECEV_DTAILADDR <!-- 상세주소 -->
, RGST_NMBR <!-- 등기번호 -->
, 'NULL' RECEV_DATA <!-- 수취인별 추가 데이터 -->
, 'NULL' TEL_NUMBER1 <!-- 수취인별 전화번호(앞) -->
, 'NULL' TEL_NUMBER2 <!-- 수취인별 전화번호(중간) -->
, 'NULL' TEL_NUMBER3 <!-- 수취인별 전화번호(끝) -->
, 'NULL' PHONE_NUMBER1 <!-- 수취인별핸드폰번호(앞) -->
, 'NULL' PHONE_NUMBER2 <!-- 수취인별핸드폰번호(중간) -->
, 'NULL' PHONE_NUMBER3 <!-- 수취인별핸드폰번호(끝) -->
, 'NULL' RETURN_NM <!-- 회송처 -->
, 'NULL' RETURN_ZIPCODE <!-- 회송처 우편번호 -->
, 'NULL' RETURN_ADDR <!-- 회송처 주소 -->
, 'NULL' RETURN_DTAILADDR <!-- 회송처 상세주소 -->
, NULL ATTACH_NM <!-- 첨부파일 -->
, RECEV_SENDER_ORG_CODE <!-- 발송기관코드 -->
, RECEV_SENDER_NM <!-- 발송인명 -->
, RECEV_SENDER_ZIPCODE <!-- 발송인 우편번호 -->
, RECEV_SENDER_ADDR <!-- 주소(시, 구) -->
, RECEV_SENDER_DETAILADDR <!-- 상세주소 -->
, RECEV_SENDER_DEPART_TEL <!-- 부과부서 전화번호 -->
, RECEV_SENDER_DEPART_NM <!-- 부과부서 -->
, RECEV_DIV_CD <!-- 등기구분 -->
, RECEV_SEQ <!-- 일련번호 -->
, RECEV_CODE <!-- 발송코드 -->
, RECEV_BAR1D <!-- 바코드 -->
, RECEV_BAR2D <!-- 이차원바코드 -->
, RECEV_BILL_NUNBER <!-- 고지번호 -->
, RECEV_DOC_CD1 <!-- 문서종류1 -->
, RECEV_DOC_CD2 <!-- 문서종류2 -->
, RECEV_DOC_CD3 <!-- 문서종류3 -->
, RECEV_DOC_CD4 <!-- 문서종류4 -->
, RECEV_DOC_CD5 <!-- 문서종류5 -->
, RECEV_SUBJ1 <!-- 과목명1 -->
, RECEV_SUBJ2 <!-- 과목명2 -->
, RECEV_SUBJ3 <!-- 과목명3 -->
, RECEV_VIOLATE_DT <!-- 위반일시 -->
, RECEV_VIOLATE_DONG <!-- 위반동 -->
, RECEV_VIOLATE_PLACE <!-- 위반장소 -->
, RECEV_LAWS <!-- 법조항 -->
, RECEV_PAY_NUMBER1 <!-- 납부번호1 -->
, RECEV_PAY_NUMBER2 <!-- 납부번호2 -->
, RECEV_OCR0 <!-- OCR0 -->
, RECEV_OCR1 <!-- OCR1 -->
, RECEV_OCR2 <!-- OCR2 -->
, RECEV_ONLINE_PAY_NUMBER <!-- 전자납부번호 -->
, VRACTNO RECEV_VACCOUNT_NUMBER <!-- 가상계좌번호 -->
, RECEV_FINE_PRICE <!-- 과태료 -->
, RECEV_PAY_PRICE <!-- 납부금액 -->
, RECEV_PAY_DT <!-- 납부기한 -->
, RECEV_PAY_IN_DATE <!-- 납기내기한 -->
, RECEV_PAY_IN_PRICE <!-- 납기내금액 -->
, RECEV_PAY_IN_ADD_PRICE <!-- 납기내가산금 -->
, RECEV_PAY_IN_DEFAULT_PRICE <!-- 납기내합계금액 -->
, RECEV_PAY_OUT_DATE <!-- 납기후기한 -->
, RECEV_PAY_OUT_PRICE <!-- 납기후금액 -->
, RECEV_PAY_OUT_ADD_PRICE <!-- 납기후가산금 -->
, RECEV_PAY_OUT_DEFAULT_PRICE <!-- 납기후합계금액 -->
, RECEV_CAR_NUMBER <!-- 차량번호 -->
, RECEV_CAR_OWNER_ZIPCODE <!-- 우편번호 -->
, RECEV_CAR_OWNER_ADDR <!-- 주소(시, 구) -->
, RECEV_CAR_OWNER_DETAILADDR <!-- 상세주소 -->
, RECEV_CAR_OWNER_NM <!-- 소유자명 -->
, RECEV_CAR_OWNER_SSN <!-- 주민번호(생년월일) -->
, RECEV_PRINT_DT <!-- 출력일자 -->
, RECEV_PRINT_YEAR <!-- 출력년도 -->
, RECEV_PRINT_MONTH <!-- 출력월 -->
, RECEV_PRINT_DAY <!-- 출력일 -->
, RECEV_EVIDENCE_NUMBER <!-- 증거번호 -->
, RECEV_PHOTO_CNT <!-- 사진장수 -->
, RECEV_PHOTO_FILENAME1 <!-- 사진파일명1 -->
, RECEV_PHOTO_FILENAME2 <!-- 사진파일명2 -->
, RECEV_PHOTO_FILENAME3 <!-- 사진파일명3 -->
, RECEV_PHOTO_FILENAME4 <!-- 사진파일명4 -->
, REG_VAR_DATA1 RECV_NOTICE_CONTS <!-- 주.정차위반과태료납부 안내 -->
, 'NULL' RECEV_TEMP_DATA1 <!-- 추가데이터1 -->
, 'NULL' RECEV_TEMP_DATA2 <!-- 추가데이터2 -->
, 'NULL' RECEV_TEMP_DATA3 <!-- 추가데이터3 -->
, DTL_VAR_DATA1 RECEV_TEMP_DATA4 <!-- 추가데이터4 (계도 메일 제목) -->
, DTL_VAR_DATA2 RECEV_TEMP_DATA5 <!-- 추가데이터5 (계도 메일 내용) -->
, RECEV_SENDER_FAX <!-- 부과부서 팩스번호 -->
, RECEV_SERDER_STAFF <!-- 부과부서 담당자 -->
, RECEV_SENDER_EMAIL <!-- 부과부서 이메일 -->
, VRACTNO2 RECEV_TEMP_DATA6 <!-- 추가데이터6 -->
, VRACTNO3 RECEV_TEMP_DATA7 <!-- 추가데이터7 -->
, VRACTNO4 RECEV_TEMP_DATA8 <!-- 추가데이터8 -->
, VRACTNO5 RECEV_TEMP_DATA9 <!-- 추가데이터9 -->
, VRACTNO6 RECEV_TEMP_DATA10 <!-- 추가데이터10 -->
, VRACTNO7 RECEV_TEMP_DATA11 <!-- 추가데이터11 -->
, VRACTNO8 RECEV_TEMP_DATA12 <!-- 추가데이터12 -->
, VRACTNO9 RECEV_TEMP_DATA13 <!-- 추가데이터13 -->
, VRACTNO10 RECEV_TEMP_DATA14 <!-- 추가데이터14 -->
, VRACTNO11 RECEV_TEMP_DATA15 <!-- 추가데이터15 -->
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'
AND A.CON_KEY = B.CON_KEY
ORDER BY A.CON_KEY, RGST_NMBR, RECEV_SEQ</select>
<resultMap id="emailRequestRow" type="cokr.xit.interfaces.epost.EmailRequest"> <!-- 전자우편 신청 -->
<result property="conKey" column="CON_KEY" /> <!-- 외부연계식별키 -->
<result property="rceptId" column="RCEPT_ID" /> <!-- 접수우체국국기호 -->
<result property="dataCd" column="DATA_CD" /> <!-- 접수코드 -->
<result property="divKb" column="DIV_KB" /> <!-- 취급구분 -->
<result property="dfpayyn" column="DFPAYYN" /> <!-- 결재방법 -->
<result property="rcptKb" column="RCPT_KB" /> <!-- 내용문 유형 -->
<result property="sealCd" column="SEAL_CD" /> <!-- 내용문 상세 종류 -->
<result property="wordKb" column="WORD_KB" /> <!-- 내용문 종류 -->
<result property="mailCnt" column="MAIL_CNT" /> <!-- 내용문 매수 -->
<result property="recevCnt" column="RECEV_CNT" /> <!-- 수취인 수 -->
<result property="envCd" column="ENV_CD" /> <!-- 봉투 종류 -->
<result property="colorYn" column="COLOR_YN" /> <!-- 칼라우편물 -->
<result property="mmYn" column="MM_YN" /> <!-- 메일머지 플래그 -->
<result property="flexCd" column="FLEX_CD" /> <!-- 이면구분 -->
<result property="dmCnt" column="DM_CNT" /> <!-- 동봉물 개수 -->
<result property="sbFg" column="SB_FG" /> <!-- 반송불필요 여부 -->
<result property="apvlNb" column="APVL_NB" /> <!-- 승인번호 -->
<result property="sendDate" column="SEND_DATE" /> <!-- 신청 일자 -->
<result property="sendTime" column="SEND_TIME" /> <!-- 전송 시간 -->
<result property="relorsectCd" column="RELORSECT_CD" /> <!-- 연계기관결제부서코드 -->
<result property="recevSenderOrgCode" column="RECEV_SENDER_ORG_CODE" /> <!-- 발송기관코드 -->
<result property="recevSenderNm" column="RECEV_SENDER_NM" /> <!-- 발송인명 -->
<result property="recevSenderZipcode" column="RECEV_SENDER_ZIPCODE" /> <!-- 발송인 우편번호 -->
<result property="recevSenderAddr" column="RECEV_SENDER_ADDR" /> <!-- 주소 -->
<result property="recevSenderDetailaddr" column="RECEV_SENDER_DETAILADDR" /> <!-- 상세주소 -->
<result property="recevSenderDepartTel" column="RECEV_SENDER_DEPART_TEL" /> <!-- 부과부서 전화번호 -->
<result property="recevSenderDepartNm" column="RECEV_SENDER_DEPART_NM" /> <!-- 부과부서 -->
<result property="recevDivCd" column="RECEV_DIV_CD" /> <!-- 등기구분 -->
<result property="recevPrintDt" column="RECEV_PRINT_DT" /> <!-- 출력일자 -->
<result property="recevPrintYear" column="RECEV_PRINT_YEAR" /> <!-- 출력연도 -->
<result property="recevPrintMonth" column="RECEV_PRINT_MONTH" /> <!-- 출력월 -->
<result property="recevPrintDay" column="RECEV_PRINT_DAY" /> <!-- 출력일 -->
<result property="recevSenderFax" column="RECEV_SENDER_FAX" /> <!-- 부과부서 팩스번호 -->
<result property="recevSerderStaff" column="RECEV_SERDER_STAFF" /> <!-- 부과부서 담당자 -->
<result property="recevSenderEmail" column="RECEV_SENDER_EMAIL" /> <!-- 부과부서 이메일 -->
<result property="sndngId" column="SNDNG_ID" /> <!-- 발송 ID -->
<result property="jobCd" column="JOB_CD" /> <!-- 작업 코드 -->
<result property="regVarData1" column="REG_VAR_DATA1" /> <!-- 추가 데이터1 (주.정차위반과태료납부 안내) -->
<result property="regVarData2" column="REG_VAR_DATA2" /> <!-- 추가 데이터2 -->
<result property="regVarData3" column="REG_VAR_DATA3" /> <!-- 추가 데이터3 -->
<result property="regVarData4" column="REG_VAR_DATA4" /> <!-- 추가 데이터4 -->
<result property="regVarData5" column="REG_VAR_DATA5" /> <!-- 추가 데이터5 -->
<result property="postProcStt" column="POST_PROC_STT" /> <!-- 우편 처리 상태 -->
<result property="rceptYmd" column="RCEPT_YMD" /> <!-- 접수 일자 -->
<result property="delYn" column="DEL_YN" /> <!-- 삭제 여부 -->
<result property="createdAt" column="REG_DT" /> <!-- 등록 일시 -->
<result property="createdBy" column="RGTR" /> <!-- 등록자 -->
<result property="removedAt" column="DEL_DT" /> <!-- 삭제 일시 -->
<result property="removedBy" column="DLTR" /> <!-- 삭제자 -->
</resultMap>
<sql id="select">SELECT CON_KEY <!-- 외부연계식별키 -->
, RCEPT_ID <!-- 접수우체국국기호 -->
, DATA_CD <!-- 접수코드 -->
, DIV_KB <!-- 취급구분 -->
, DFPAYYN <!-- 결재방법 -->
, RCPT_KB <!-- 내용문 유형 -->
, SEAL_CD <!-- 내용문 상세 종류 -->
, WORD_KB <!-- 내용문 종류 -->
, MAIL_CNT <!-- 내용문 매수 -->
, RECEV_CNT <!-- 수취인 수 -->
, ENV_CD <!-- 봉투 종류 -->
, COLOR_YN <!-- 칼라우편물 -->
, MM_YN <!-- 메일머지 플래그 -->
, FLEX_CD <!-- 이면구분 -->
, DM_CNT <!-- 동봉물 개수 -->
, SB_FG <!-- 반송불필요 여부 -->
, APVL_NB <!-- 승인번호 -->
, SEND_DATE <!-- 신청 일자 -->
, SEND_TIME <!-- 전송 시간 -->
, RELORSECT_CD <!-- 연계기관결제부서코드 -->
, RECEV_SENDER_ORG_CODE <!-- 발송기관코드 -->
, RECEV_SENDER_NM <!-- 발송인명 -->
, RECEV_SENDER_ZIPCODE <!-- 발송인 우편번호 -->
, RECEV_SENDER_ADDR <!-- 주소 -->
, RECEV_SENDER_DETAILADDR <!-- 상세주소 -->
, RECEV_SENDER_DEPART_TEL <!-- 부과부서 전화번호 -->
, RECEV_SENDER_DEPART_NM <!-- 부과부서 -->
, RECEV_DIV_CD <!-- 등기구분 -->
, RECEV_PRINT_DT <!-- 출력일자 -->
, RECEV_PRINT_YEAR <!-- 출력연도 -->
, RECEV_PRINT_MONTH <!-- 출력월 -->
, RECEV_PRINT_DAY <!-- 출력일 -->
, RECEV_SENDER_FAX <!-- 부과부서 팩스번호 -->
, RECEV_SERDER_STAFF <!-- 부과부서 담당자 -->
, RECEV_SENDER_EMAIL <!-- 부과부서 이메일 -->
, SNDNG_ID <!-- 발송 ID -->
, JOB_CD <!-- 작업 코드 -->
, REG_VAR_DATA1 <!-- 추가 데이터1 (주.정차위반과태료납부 안내) -->
, REG_VAR_DATA2 <!-- 추가 데이터2 -->
, REG_VAR_DATA3 <!-- 추가 데이터3 -->
, REG_VAR_DATA4 <!-- 추가 데이터4 -->
, REG_VAR_DATA5 <!-- 추가 데이터5 -->
, POST_PROC_STT <!-- 우편 처리 상태 -->
, RCEPT_YMD <!-- 접수 일자 -->
, DEL_YN <!-- 삭제 여부 -->
, REG_DT <!-- 등록 일시 -->
, RGTR <!-- 등록자 -->
, DEL_DT <!-- 삭제 일시 -->
, DLTR <!-- 삭제자 -->
FROM TB_EPOST_RCPT_REG</sql>
<select id="selectRequestList" parameterType="map" resultType="dataobject">/* 전자우편 신청 목록 조회(emailRequestMapper.selectRequestList) */
<include refid="utility.paging-prefix" />
<include refid="select" />
<where>
<if test="conKeys != null">AND CON_KEY IN (<foreach collection="conKeys" item="conKey" separator=",">#{conKey}</foreach>)</if>
<if test="conKeys == null">
AND RCEPT_YMD BETWEEN #{fromRegDate} AND #{toRegDate}
<if test="statusList != null">AND POST_PROC_STT IN (<foreach collection="statusList" item="status" separator=",">#{status}</foreach>)</if>
AND DEL_YN = 'N'
</if>
</where>
<include refid="utility.orderBy" />
<include refid="utility.paging-suffix" /></select>
<select id="selectRequests" parameterType="map" resultMap="emailRequestRow">/* 전자우편 신청 객체 가져오기(emailRequestMapper.selectRequests) */
<include refid="select" />
<where>AND CON_KEY IN (<foreach collection="conKeys" item="conKey" separator=",">#{conKey}</foreach>)</where>
<include refid="utility.orderBy" /></select>
<insert id="insertRequest" parameterType="map">/* 전자우편 신청 등록(emailRequestMapper.insertRequest) */
INSERT INTO TB_EPOST_RCPT_REG (
CON_KEY <!-- 외부연계식별키 -->
, RCEPT_ID <!-- 접수우체국국기호 -->
, DATA_CD <!-- 접수코드 -->
, DIV_KB <!-- 취급구분 -->
, DFPAYYN <!-- 결재방법 -->
, RCPT_KB <!-- 내용문 유형 -->
, SEAL_CD <!-- 내용문 상세 종류 -->
, WORD_KB <!-- 내용문 종류 -->
, MAIL_CNT <!-- 내용문 매수 -->
, RECEV_CNT <!-- 수취인 수 -->
, ENV_CD <!-- 봉투 종류 -->
, COLOR_YN <!-- 칼라우편물 -->
, MM_YN <!-- 메일머지 플래그 -->
, FLEX_CD <!-- 이면구분 -->
, DM_CNT <!-- 동봉물 개수 -->
, SB_FG <!-- 반송불필요 여부 -->
, APVL_NB <!-- 승인번호 -->
, SEND_DATE <!-- 신청 일자 -->
, SEND_TIME <!-- 전송 시간 -->
, RELORSECT_CD <!-- 연계기관결제부서코드 -->
, RECEV_SENDER_ORG_CODE <!-- 발송기관코드 -->
, RECEV_SENDER_NM <!-- 발송인명 -->
, RECEV_SENDER_ZIPCODE <!-- 발송인 우편번호 -->
, RECEV_SENDER_ADDR <!-- 주소 -->
, RECEV_SENDER_DETAILADDR <!-- 상세주소 -->
, RECEV_SENDER_DEPART_TEL <!-- 부과부서 전화번호 -->
, RECEV_SENDER_DEPART_NM <!-- 부과부서 -->
, RECEV_DIV_CD <!-- 등기구분 -->
, RECEV_PRINT_DT <!-- 출력일자 -->
, RECEV_PRINT_YEAR <!-- 출력연도 -->
, RECEV_PRINT_MONTH <!-- 출력월 -->
, RECEV_PRINT_DAY <!-- 출력일 -->
, RECEV_SENDER_FAX <!-- 부과부서 팩스번호 -->
, RECEV_SERDER_STAFF <!-- 부과부서 담당자 -->
, RECEV_SENDER_EMAIL <!-- 부과부서 이메일 -->
, SNDNG_ID <!-- 발송 ID -->
, JOB_CD <!-- 작업 코드 -->
, REG_VAR_DATA1 <!-- 추가 데이터1 (주.정차위반과태료납부 안내) -->
, REG_VAR_DATA2 <!-- 추가 데이터2 -->
, REG_VAR_DATA3 <!-- 추가 데이터3 -->
, REG_VAR_DATA4 <!-- 추가 데이터4 -->
, REG_VAR_DATA5 <!-- 추가 데이터5 -->
, POST_PROC_STT <!-- 우편 처리 상태 -->
, RCEPT_YMD <!-- 접수 일자 -->
, DEL_YN <!-- 삭제 여부 -->
, REG_DT <!-- 등록 일시 -->
, RGTR <!-- 등록자 -->
, DEL_DT <!-- 삭제 일시 -->
, DLTR <!-- 삭제자 -->
) VALUES (
#{emailRequest.conKey} <!-- 외부연계식별키 -->
, #{emailRequest.rceptId} <!-- 접수우체국국기호 -->
, #{emailRequest.dataCd} <!-- 접수코드 -->
, #{emailRequest.divKb} <!-- 취급구분 -->
, #{emailRequest.dfpayyn} <!-- 결재방법 -->
, #{emailRequest.rcptKb} <!-- 내용문 유형 -->
, #{emailRequest.sealCd} <!-- 내용문 상세 종류 -->
, #{emailRequest.wordKb} <!-- 내용문 종류 -->
, #{emailRequest.mailCnt} <!-- 내용문 매수 -->
, #{emailRequest.recevCnt} <!-- 수취인 수 -->
, #{emailRequest.envCd} <!-- 봉투 종류 -->
, #{emailRequest.colorYn} <!-- 칼라우편물 -->
, #{emailRequest.mmYn} <!-- 메일머지 플래그 -->
, #{emailRequest.flexCd} <!-- 이면구분 -->
, #{emailRequest.dmCnt} <!-- 동봉물 개수 -->
, #{emailRequest.sbFg} <!-- 반송불필요 여부 -->
, #{emailRequest.apvlNb} <!-- 승인번호 -->
, #{emailRequest.sendDate} <!-- 신청 일자 -->
, #{emailRequest.sendTime} <!-- 전송 시간 -->
, #{emailRequest.relorsectCd} <!-- 연계기관결제부서코드 -->
, #{emailRequest.recevSenderOrgCode} <!-- 발송기관코드 -->
, #{emailRequest.recevSenderNm} <!-- 발송인명 -->
, #{emailRequest.recevSenderZipcode} <!-- 발송인 우편번호 -->
, #{emailRequest.recevSenderAddr} <!-- 주소 -->
, #{emailRequest.recevSenderDetailaddr} <!-- 상세주소 -->
, #{emailRequest.recevSenderDepartTel} <!-- 부과부서 전화번호 -->
, #{emailRequest.recevSenderDepartNm} <!-- 부과부서 -->
, #{emailRequest.recevDivCd} <!-- 등기구분 -->
, #{emailRequest.recevPrintDt} <!-- 출력일자 -->
, #{emailRequest.recevPrintYear} <!-- 출력연도 -->
, #{emailRequest.recevPrintMonth} <!-- 출력월 -->
, #{emailRequest.recevPrintDay} <!-- 출력일 -->
, #{emailRequest.recevSenderFax} <!-- 부과부서 팩스번호 -->
, #{emailRequest.recevSerderStaff} <!-- 부과부서 담당자 -->
, #{emailRequest.recevSenderEmail} <!-- 부과부서 이메일 -->
, #{emailRequest.sndngId} <!-- 발송 ID -->
, #{emailRequest.jobCd} <!-- 작업 코드 -->
, #{emailRequest.regVarData1} <!-- 추가 데이터1 (주.정차위반과태료납부 안내) -->
, #{emailRequest.regVarData2} <!-- 추가 데이터2 -->
, #{emailRequest.regVarData3} <!-- 추가 데이터3 -->
, #{emailRequest.regVarData4} <!-- 추가 데이터4 -->
, #{emailRequest.regVarData5} <!-- 추가 데이터5 -->
, #{emailRequest.postProcStt} <!-- 우편 처리 상태 -->
, #{emailRequest.rceptYmd} <!-- 접수 일자 -->
, #{emailRequest.delYn} <!-- 삭제 여부 -->
, <include refid="utility.now" /> <!-- 등록 일시 -->
, #{currentUser.id} <!-- 등록자 -->
, #{emailRequest.removedAt} <!-- 삭제 일시 -->
, #{emailRequest.removedBy} <!-- 삭제자 -->
)</insert>
<update id="updateRequest" parameterType="map">/* 전자우편 신청 수정(emailRequestMapper.updateRequest) */
UPDATE TB_EPOST_RCPT_REG SET
RCEPT_ID = #{emailRequest.rceptId} <!-- 접수우체국국기호 -->
, DATA_CD = #{emailRequest.dataCd} <!-- 접수코드 -->
, DIV_KB = #{emailRequest.divKb} <!-- 취급구분 -->
, DFPAYYN = #{emailRequest.dfpayyn} <!-- 결재방법 -->
, RCPT_KB = #{emailRequest.rcptKb} <!-- 내용문 유형 -->
, SEAL_CD = #{emailRequest.sealCd} <!-- 내용문 상세 종류 -->
, WORD_KB = #{emailRequest.wordKb} <!-- 내용문 종류 -->
, MAIL_CNT = #{emailRequest.mailCnt} <!-- 내용문 매수 -->
, RECEV_CNT = #{emailRequest.recevCnt} <!-- 수취인 수 -->
, ENV_CD = #{emailRequest.envCd} <!-- 봉투 종류 -->
, COLOR_YN = #{emailRequest.colorYn} <!-- 칼라우편물 -->
, MM_YN = #{emailRequest.mmYn} <!-- 메일머지 플래그 -->
, FLEX_CD = #{emailRequest.flexCd} <!-- 이면구분 -->
, DM_CNT = #{emailRequest.dmCnt} <!-- 동봉물 개수 -->
, SB_FG = #{emailRequest.sbFg} <!-- 반송불필요 여부 -->
, APVL_NB = #{emailRequest.apvlNb} <!-- 승인번호 -->
, SEND_DATE = #{emailRequest.sendDate} <!-- 신청 일자 -->
, SEND_TIME = #{emailRequest.sendTime} <!-- 전송 시간 -->
, RELORSECT_CD = #{emailRequest.relorsectCd} <!-- 연계기관결제부서코드 -->
, RECEV_SENDER_ORG_CODE = #{emailRequest.recevSenderOrgCode} <!-- 발송기관코드 -->
, RECEV_SENDER_NM = #{emailRequest.recevSenderNm} <!-- 발송인명 -->
, RECEV_SENDER_ZIPCODE = #{emailRequest.recevSenderZipcode} <!-- 발송인 우편번호 -->
, RECEV_SENDER_ADDR = #{emailRequest.recevSenderAddr} <!-- 주소 -->
, RECEV_SENDER_DETAILADDR = #{emailRequest.recevSenderDetailaddr} <!-- 상세주소 -->
, RECEV_SENDER_DEPART_TEL = #{emailRequest.recevSenderDepartTel} <!-- 부과부서 전화번호 -->
, RECEV_SENDER_DEPART_NM = #{emailRequest.recevSenderDepartNm} <!-- 부과부서 -->
, RECEV_DIV_CD = #{emailRequest.recevDivCd} <!-- 등기구분 -->
, RECEV_PRINT_DT = #{emailRequest.recevPrintDt} <!-- 출력일자 -->
, RECEV_PRINT_YEAR = #{emailRequest.recevPrintYear} <!-- 출력연도 -->
, RECEV_PRINT_MONTH = #{emailRequest.recevPrintMonth} <!-- 출력월 -->
, RECEV_PRINT_DAY = #{emailRequest.recevPrintDay} <!-- 출력일 -->
, RECEV_SENDER_FAX = #{emailRequest.recevSenderFax} <!-- 부과부서 팩스번호 -->
, RECEV_SERDER_STAFF = #{emailRequest.recevSerderStaff} <!-- 부과부서 담당자 -->
, RECEV_SENDER_EMAIL = #{emailRequest.recevSenderEmail} <!-- 부과부서 이메일 -->
, SNDNG_ID = #{emailRequest.sndngId} <!-- 발송 ID -->
, JOB_CD = #{emailRequest.jobCd} <!-- 작업 코드 -->
, REG_VAR_DATA1 = #{emailRequest.regVarData1} <!-- 추가 데이터1 (주.정차위반과태료납부 안내) -->
, REG_VAR_DATA2 = #{emailRequest.regVarData2} <!-- 추가 데이터2 -->
, REG_VAR_DATA3 = #{emailRequest.regVarData3} <!-- 추가 데이터3 -->
, REG_VAR_DATA4 = #{emailRequest.regVarData4} <!-- 추가 데이터4 -->
, REG_VAR_DATA5 = #{emailRequest.regVarData5} <!-- 추가 데이터5 -->
, POST_PROC_STT = #{emailRequest.postProcStt} <!-- 우편 처리 상태 -->
, RCEPT_YMD = #{emailRequest.rceptYmd} <!-- 접수 일자 -->
, DEL_YN = #{emailRequest.delYn} <!-- 삭제 여부 -->
, DEL_DT = #{emailRequest.removedAt} <!-- 삭제 일시 -->
, DLTR = #{emailRequest.removedBy} <!-- 삭제자 -->
WHERE CON_KEY = #{emailRequest.conKey}</update>
<update id="updateRequestStatus" parameterType="map">/* 전자우편 신청 상태 변경(emailRequestMapper.updateRequestStatus) */
UPDATE TB_EPOST_RCPT_REG SET
POST_PROC_STT = #{status}
<if test='resultType == "registration"'> , RCEPT_YMD = CASE CON_KEY<foreach collection="results" item="result">
WHEN #{result.reletcdata} THEN #{result.rceptYmd}</foreach>
ELSE RCEPT_YMD END</if>
WHERE CON_KEY IN (
<if test='conKeys != null'><foreach collection="conKeys" item="conKey" separator=",">#{conKey}</foreach></if>
<if test='resultType == "reception"'><foreach collection="results" item="result" separator=",">#{result.reldivkey}</foreach></if>
<if test='resultType == "registration"'><foreach collection="results" item="result" separator=",">#{result.reletcdata}</foreach></if>
<if test='resultType == "production"'><foreach collection="results" item="result" separator=",">#{result.conKey}</foreach></if>
<if test='resultType == "delivery"'><foreach collection="results" item="result" separator=",">#{result.reletcdata}</foreach></if>
)
AND POST_PROC_STT &lt; #{maxStatus}</update>
<update id="updateRequestAsDelivered" parameterType="map">/* 전자우편 배달 완료 처리(emailRequestMapper.updateRequestAsDelivered) */
UPDATE TB_EPOST_RCPT_REG SET
POST_PROC_STT = #{status}
WHERE POST_PROC_STT = '27' <!-- 배달중 -->
AND DEL_YN = 'N'
AND REG_DT &lt; CONCAT(DATE_FORMAT(DATE_SUB(CURRENT_DATE, INTERVAL #{expiryDays} DAY), '%Y%m%d'), '000000')</update>
<update id="deleteRequest" parameterType="map">/* 전자우편 신청 삭제(emailRequestMapper.deleteRequest) */
UPDATE TB_EPOST_RCPT_REG SET
DEL_YN = 'Y'
, DEL_DT =<include refid="utility.now" />
, DLTR = #{currentUser.id}
WHERE CON_KEY IN (<foreach collection="conKeys" item="conKey" separator=",">#{conKey}</foreach>)</update>
<resultMap id="emailRequestDetailRow" type="cokr.xit.interfaces.epost.EmailRequestDetail"> <!-- 전자우편 신청 상세 -->
<result property="conKey" column="CON_KEY" /> <!-- 외부연계식별키 -->
<result property="rgstNmbr" column="RGST_NMBR" /> <!-- 등기번호 -->
<result property="recevSeq" column="RECEV_SEQ" /> <!-- 일련번호 -->
<result property="recevCode" column="RECEV_CODE" /> <!-- 발송코드 -->
<result property="recevBar1d" column="RECEV_BAR1D" /> <!-- 바코드 -->
<result property="recevBar2d" column="RECEV_BAR2D" /> <!-- 이차원바코드 -->
<result property="recevBillNunber" column="RECEV_BILL_NUNBER" /> <!-- 고지번호 -->
<result property="recevDocCd1" column="RECEV_DOC_CD1" /> <!-- 문서종류1 -->
<result property="recevDocCd2" column="RECEV_DOC_CD2" /> <!-- 문서종류2 -->
<result property="recevDocCd3" column="RECEV_DOC_CD3" /> <!-- 문서종류3 -->
<result property="recevDocCd4" column="RECEV_DOC_CD4" /> <!-- 문서종류4 -->
<result property="recevDocCd5" column="RECEV_DOC_CD5" /> <!-- 문서종류5 -->
<result property="recevSubj1" column="RECEV_SUBJ1" /> <!-- 과목명1 -->
<result property="recevSubj2" column="RECEV_SUBJ2" /> <!-- 과목명2 -->
<result property="recevSubj3" column="RECEV_SUBJ3" /> <!-- 과목명3 -->
<result property="recevViolateDt" column="RECEV_VIOLATE_DT" /> <!-- 위반일시 -->
<result property="recevViolateDong" column="RECEV_VIOLATE_DONG" /> <!-- 위반동 -->
<result property="recevViolatePlace" column="RECEV_VIOLATE_PLACE" /> <!-- 위반장소 -->
<result property="recevLaws" column="RECEV_LAWS" /> <!-- 법조항 -->
<result property="recevPayNumber1" column="RECEV_PAY_NUMBER1" /> <!-- 납부번호1 -->
<result property="recevPayNumber2" column="RECEV_PAY_NUMBER2" /> <!-- 납부번호2 -->
<result property="recevOcr0" column="RECEV_OCR0" /> <!-- OCR0 -->
<result property="recevOcr1" column="RECEV_OCR1" /> <!-- OCR1 -->
<result property="recevOcr2" column="RECEV_OCR2" /> <!-- OCR2 -->
<result property="recevOnlinePayNumber" column="RECEV_ONLINE_PAY_NUMBER" /> <!-- 전자납부번호 -->
<result property="recevFinePrice" column="RECEV_FINE_PRICE" /> <!-- 과태료 -->
<result property="recevPayPrice" column="RECEV_PAY_PRICE" /> <!-- 납부금액 -->
<result property="recevPayDt" column="RECEV_PAY_DT" /> <!-- 납부기한 -->
<result property="recevPayInDate" column="RECEV_PAY_IN_DATE" /> <!-- 납기내기한 -->
<result property="recevPayInPrice" column="RECEV_PAY_IN_PRICE" /> <!-- 납기내금액 -->
<result property="recevPayInAddPrice" column="RECEV_PAY_IN_ADD_PRICE" /> <!-- 납기내가산금 -->
<result property="recevPayInDefaultPrice" column="RECEV_PAY_IN_DEFAULT_PRICE" /> <!-- 납기내합계금액 -->
<result property="recevPayOutDate" column="RECEV_PAY_OUT_DATE" /> <!-- 납기후기한 -->
<result property="recevPayOutPrice" column="RECEV_PAY_OUT_PRICE" /> <!-- 납기후금액 -->
<result property="recevPayOutAddPrice" column="RECEV_PAY_OUT_ADD_PRICE" /> <!-- 납기후가산금 -->
<result property="recevPayOutDefaultPrice" column="RECEV_PAY_OUT_DEFAULT_PRICE" /> <!-- 납기후합계금액 -->
<result property="recevCarNumber" column="RECEV_CAR_NUMBER" /> <!-- 차량번호 -->
<result property="recevCarOwnerZipcode" column="RECEV_CAR_OWNER_ZIPCODE" /> <!-- 우편번호 -->
<result property="recevCarOwnerAddr" column="RECEV_CAR_OWNER_ADDR" /> <!-- 주소 -->
<result property="recevCarOwnerDetailaddr" column="RECEV_CAR_OWNER_DETAILADDR" /> <!-- 상세주소 -->
<result property="recevCarOwnerNm" column="RECEV_CAR_OWNER_NM" /> <!-- 소유자명 -->
<result property="recevCarOwnerSsn" column="RECEV_CAR_OWNER_SSN" /> <!-- 주민번호 -->
<result property="recevEvidenceNumber" column="RECEV_EVIDENCE_NUMBER" /> <!-- 증거번호 -->
<result property="recevPhotoCnt" column="RECEV_PHOTO_CNT" /> <!-- 사진장수 -->
<result property="recevPhotoFilename1" column="RECEV_PHOTO_FILENAME1" /> <!-- 사진파일명1 -->
<result property="recevPhotoFilename2" column="RECEV_PHOTO_FILENAME2" /> <!-- 사진파일명2 -->
<result property="recevPhotoFilename3" column="RECEV_PHOTO_FILENAME3" /> <!-- 사진파일명3 -->
<result property="recevPhotoFilename4" column="RECEV_PHOTO_FILENAME4" /> <!-- 사진파일명4 -->
<result property="vractno2" column="VRACTNO2" /> <!-- 가상계좌번호2 -->
<result property="vractno3" column="VRACTNO3" /> <!-- 가상계좌번호3 -->
<result property="vractno4" column="VRACTNO4" /> <!-- 가상계좌번호4 -->
<result property="vractno5" column="VRACTNO5" /> <!-- 가상계좌번호5 -->
<result property="vractno6" column="VRACTNO6" /> <!-- 가상계좌번호6 -->
<result property="vractno7" column="VRACTNO7" /> <!-- 가상계좌번호7 -->
<result property="vractno8" column="VRACTNO8" /> <!-- 가상계좌번호8 -->
<result property="vractno9" column="VRACTNO9" /> <!-- 가상계좌번호9 -->
<result property="vractno10" column="VRACTNO10" /> <!-- 가상계좌번호10 -->
<result property="vractno11" column="VRACTNO11" /> <!-- 가상계좌번호11 -->
<result property="dtlVarData1" column="DTL_VAR_DATA1" /> <!-- 추가 데이터1 (계도 메일 제목) -->
<result property="dtlVarData2" column="DTL_VAR_DATA2" /> <!-- 추가 데이터2 (계도 메일 내용) -->
<result property="dtlVarData3" column="DTL_VAR_DATA3" /> <!-- 추가 데이터3 -->
<result property="dtlVarData4" column="DTL_VAR_DATA4" /> <!-- 추가 데이터4 -->
<result property="dtlVarData5" column="DTL_VAR_DATA5" /> <!-- 추가 데이터5 -->
<result property="dlvrRsltId" column="DLVR_RSLT_ID" /> <!-- 배달 결과 ID -->
<result property="makeRsltCd" column="MAKE_RSLT_CD" /> <!-- 제작 결과 코드 -->
<result property="createdAt" column="REG_DT" /> <!-- 등록 일시 -->
<result property="createdBy" column="RGTR" /> <!-- 등록자 -->
<result property="vractno" column="VRACTNO" /> <!-- 가상계좌번호 -->
</resultMap>
<sql id="selectDetail">SELECT CON_KEY <!-- 외부연계식별키 -->
, RGST_NMBR <!-- 등기번호 -->
, RECEV_SEQ <!-- 일련번호 -->
, RECEV_CODE <!-- 발송코드 -->
, RECEV_BAR1D <!-- 바코드 -->
, RECEV_BAR2D <!-- 이차원바코드 -->
, RECEV_BILL_NUNBER <!-- 고지번호 -->
, RECEV_DOC_CD1 <!-- 문서종류1 -->
, RECEV_DOC_CD2 <!-- 문서종류2 -->
, RECEV_DOC_CD3 <!-- 문서종류3 -->
, RECEV_DOC_CD4 <!-- 문서종류4 -->
, RECEV_DOC_CD5 <!-- 문서종류5 -->
, RECEV_SUBJ1 <!-- 과목명1 -->
, RECEV_SUBJ2 <!-- 과목명2 -->
, RECEV_SUBJ3 <!-- 과목명3 -->
, RECEV_VIOLATE_DT <!-- 위반일시 -->
, RECEV_VIOLATE_DONG <!-- 위반동 -->
, RECEV_VIOLATE_PLACE <!-- 위반장소 -->
, RECEV_LAWS <!-- 법조항 -->
, RECEV_PAY_NUMBER1 <!-- 납부번호1 -->
, RECEV_PAY_NUMBER2 <!-- 납부번호2 -->
, RECEV_OCR0 <!-- OCR0 -->
, RECEV_OCR1 <!-- OCR1 -->
, RECEV_OCR2 <!-- OCR2 -->
, RECEV_ONLINE_PAY_NUMBER <!-- 전자납부번호 -->
, RECEV_FINE_PRICE <!-- 과태료 -->
, RECEV_PAY_PRICE <!-- 납부금액 -->
, RECEV_PAY_DT <!-- 납부기한 -->
, RECEV_PAY_IN_DATE <!-- 납기내기한 -->
, RECEV_PAY_IN_PRICE <!-- 납기내금액 -->
, RECEV_PAY_IN_ADD_PRICE <!-- 납기내가산금 -->
, RECEV_PAY_IN_DEFAULT_PRICE <!-- 납기내합계금액 -->
, RECEV_PAY_OUT_DATE <!-- 납기후기한 -->
, RECEV_PAY_OUT_PRICE <!-- 납기후금액 -->
, RECEV_PAY_OUT_ADD_PRICE <!-- 납기후가산금 -->
, RECEV_PAY_OUT_DEFAULT_PRICE <!-- 납기후합계금액 -->
, RECEV_CAR_NUMBER <!-- 차량번호 -->
, RECEV_CAR_OWNER_ZIPCODE <!-- 우편번호 -->
, RECEV_CAR_OWNER_ADDR <!-- 주소 -->
, RECEV_CAR_OWNER_DETAILADDR <!-- 상세주소 -->
, RECEV_CAR_OWNER_NM <!-- 소유자명 -->
, RECEV_CAR_OWNER_SSN <!-- 주민번호 -->
, RECEV_EVIDENCE_NUMBER <!-- 증거번호 -->
, RECEV_PHOTO_CNT <!-- 사진장수 -->
, RECEV_PHOTO_FILENAME1 <!-- 사진파일명1 -->
, RECEV_PHOTO_FILENAME2 <!-- 사진파일명2 -->
, RECEV_PHOTO_FILENAME3 <!-- 사진파일명3 -->
, RECEV_PHOTO_FILENAME4 <!-- 사진파일명4 -->
, VRACTNO2 <!-- 가상계좌번호2 -->
, VRACTNO3 <!-- 가상계좌번호3 -->
, VRACTNO4 <!-- 가상계좌번호4 -->
, VRACTNO5 <!-- 가상계좌번호5 -->
, VRACTNO6 <!-- 가상계좌번호6 -->
, VRACTNO7 <!-- 가상계좌번호7 -->
, VRACTNO8 <!-- 가상계좌번호8 -->
, VRACTNO9 <!-- 가상계좌번호9 -->
, VRACTNO10 <!-- 가상계좌번호10 -->
, VRACTNO11 <!-- 가상계좌번호11 -->
, DTL_VAR_DATA1 <!-- 추가 데이터1 (계도 메일 제목) -->
, DTL_VAR_DATA2 <!-- 추가 데이터2 (계도 메일 내용) -->
, DTL_VAR_DATA3 <!-- 추가 데이터3 -->
, DTL_VAR_DATA4 <!-- 추가 데이터4 -->
, DTL_VAR_DATA5 <!-- 추가 데이터5 -->
, DLVR_RSLT_ID <!-- 배달 결과 ID -->
, MAKE_RSLT_CD <!-- 제작 결과 코드 -->
, REG_DT <!-- 등록 일시 -->
, RGTR <!-- 등록자 -->
, VRACTNO <!-- 가상계좌번호 -->
FROM TB_EPOST_RCPT_DTL</sql>
<select id="selectRequestDetailList" parameterType="map" resultType="dataobject">/* 전자우편 신청 상세 목록 조회(emailRequestMapper.selectRequestDetailList) */
<include refid="utility.paging-prefix" />
<include refid="selectDetail" />
<where>
AND CON_KEY IN (<foreach collection="conKeys" item="conKey" separator=",">#{conKey}</foreach>)
<if test="rgstNmbrs != null">AND RGST_NMBR IN (<foreach collection="rgstNmbrs" item="rgstNmbr" separator=",">#{rgstNmbr}</foreach>)</if>
</where>
<include refid="utility.orderBy" />
<include refid="utility.paging-suffix" /></select>
<select id="selectRequestDetails" parameterType="map" resultMap="emailRequestDetailRow">/* 전자우편 신청 상세 객체 가져오기(emailRequestMapper.selectRequestDetails) */
<include refid="selectDetail" />
<where>
AND CON_KEY IN (<foreach collection="conKeys" item="conKey" separator=",">#{conKey}</foreach>)
<if test="rgstNmbrs != null">AND RGST_NMBR IN (<foreach collection="rgstNmbrs" item="rgstNmbr" separator=",">#{rgstNmbr}</foreach>)</if>
</where>
<include refid="utility.orderBy" /></select>
<insert id="insertRequestDetail" parameterType="map">/* 전자우편 신청 상세 등록(emailRequestMapper.insertRequestDetail) */
INSERT INTO TB_EPOST_RCPT_DTL (
CON_KEY <!-- 외부연계식별키 -->
, RGST_NMBR <!-- 등기번호 -->
, RECEV_SEQ <!-- 일련번호 -->
, RECEV_CODE <!-- 발송코드 -->
, RECEV_BAR1D <!-- 바코드 -->
, RECEV_BAR2D <!-- 이차원바코드 -->
, RECEV_BILL_NUNBER <!-- 고지번호 -->
, RECEV_DOC_CD1 <!-- 문서종류1 -->
, RECEV_DOC_CD2 <!-- 문서종류2 -->
, RECEV_DOC_CD3 <!-- 문서종류3 -->
, RECEV_DOC_CD4 <!-- 문서종류4 -->
, RECEV_DOC_CD5 <!-- 문서종류5 -->
, RECEV_SUBJ1 <!-- 과목명1 -->
, RECEV_SUBJ2 <!-- 과목명2 -->
, RECEV_SUBJ3 <!-- 과목명3 -->
, RECEV_VIOLATE_DT <!-- 위반일시 -->
, RECEV_VIOLATE_DONG <!-- 위반동 -->
, RECEV_VIOLATE_PLACE <!-- 위반장소 -->
, RECEV_LAWS <!-- 법조항 -->
, RECEV_PAY_NUMBER1 <!-- 납부번호1 -->
, RECEV_PAY_NUMBER2 <!-- 납부번호2 -->
, RECEV_OCR0 <!-- OCR0 -->
, RECEV_OCR1 <!-- OCR1 -->
, RECEV_OCR2 <!-- OCR2 -->
, RECEV_ONLINE_PAY_NUMBER <!-- 전자납부번호 -->
, RECEV_FINE_PRICE <!-- 과태료 -->
, RECEV_PAY_PRICE <!-- 납부금액 -->
, RECEV_PAY_DT <!-- 납부기한 -->
, RECEV_PAY_IN_DATE <!-- 납기내기한 -->
, RECEV_PAY_IN_PRICE <!-- 납기내금액 -->
, RECEV_PAY_IN_ADD_PRICE <!-- 납기내가산금 -->
, RECEV_PAY_IN_DEFAULT_PRICE <!-- 납기내합계금액 -->
, RECEV_PAY_OUT_DATE <!-- 납기후기한 -->
, RECEV_PAY_OUT_PRICE <!-- 납기후금액 -->
, RECEV_PAY_OUT_ADD_PRICE <!-- 납기후가산금 -->
, RECEV_PAY_OUT_DEFAULT_PRICE <!-- 납기후합계금액 -->
, RECEV_CAR_NUMBER <!-- 차량번호 -->
, RECEV_CAR_OWNER_ZIPCODE <!-- 우편번호 -->
, RECEV_CAR_OWNER_ADDR <!-- 주소 -->
, RECEV_CAR_OWNER_DETAILADDR <!-- 상세주소 -->
, RECEV_CAR_OWNER_NM <!-- 소유자명 -->
, RECEV_CAR_OWNER_SSN <!-- 주민번호 -->
, RECEV_EVIDENCE_NUMBER <!-- 증거번호 -->
, RECEV_PHOTO_CNT <!-- 사진장수 -->
, RECEV_PHOTO_FILENAME1 <!-- 사진파일명1 -->
, RECEV_PHOTO_FILENAME2 <!-- 사진파일명2 -->
, RECEV_PHOTO_FILENAME3 <!-- 사진파일명3 -->
, RECEV_PHOTO_FILENAME4 <!-- 사진파일명4 -->
, VRACTNO2 <!-- 가상계좌번호2 -->
, VRACTNO3 <!-- 가상계좌번호3 -->
, VRACTNO4 <!-- 가상계좌번호4 -->
, VRACTNO5 <!-- 가상계좌번호5 -->
, VRACTNO6 <!-- 가상계좌번호6 -->
, VRACTNO7 <!-- 가상계좌번호7 -->
, VRACTNO8 <!-- 가상계좌번호8 -->
, VRACTNO9 <!-- 가상계좌번호9 -->
, VRACTNO10 <!-- 가상계좌번호10 -->
, VRACTNO11 <!-- 가상계좌번호11 -->
, DTL_VAR_DATA1 <!-- 추가 데이터1 (계도 메일 제목) -->
, DTL_VAR_DATA2 <!-- 추가 데이터2 (계도 메일 내용) -->
, DTL_VAR_DATA3 <!-- 추가 데이터3 -->
, DTL_VAR_DATA4 <!-- 추가 데이터4 -->
, DTL_VAR_DATA5 <!-- 추가 데이터5 -->
, DLVR_RSLT_ID <!-- 배달 결과 ID -->
, MAKE_RSLT_CD <!-- 제작 결과 코드 -->
, REG_DT <!-- 등록 일시 -->
, RGTR <!-- 등록자 -->
, VRACTNO <!-- 가상계좌번호 -->
) VALUES (
#{emailRequestDetail.conKey} <!-- 외부연계식별키 -->
, #{emailRequestDetail.rgstNmbr} <!-- 등기번호 -->
, #{emailRequestDetail.recevSeq} <!-- 일련번호 -->
, #{emailRequestDetail.recevCode} <!-- 발송코드 -->
, #{emailRequestDetail.recevBar1d} <!-- 바코드 -->
, #{emailRequestDetail.recevBar2d} <!-- 이차원바코드 -->
, #{emailRequestDetail.recevBillNunber} <!-- 고지번호 -->
, #{emailRequestDetail.recevDocCd1} <!-- 문서종류1 -->
, #{emailRequestDetail.recevDocCd2} <!-- 문서종류2 -->
, #{emailRequestDetail.recevDocCd3} <!-- 문서종류3 -->
, #{emailRequestDetail.recevDocCd4} <!-- 문서종류4 -->
, #{emailRequestDetail.recevDocCd5} <!-- 문서종류5 -->
, #{emailRequestDetail.recevSubj1} <!-- 과목명1 -->
, #{emailRequestDetail.recevSubj2} <!-- 과목명2 -->
, #{emailRequestDetail.recevSubj3} <!-- 과목명3 -->
, #{emailRequestDetail.recevViolateDt} <!-- 위반일시 -->
, #{emailRequestDetail.recevViolateDong} <!-- 위반동 -->
, #{emailRequestDetail.recevViolatePlace} <!-- 위반장소 -->
, #{emailRequestDetail.recevLaws} <!-- 법조항 -->
, #{emailRequestDetail.recevPayNumber1} <!-- 납부번호1 -->
, #{emailRequestDetail.recevPayNumber2} <!-- 납부번호2 -->
, #{emailRequestDetail.recevOcr0} <!-- OCR0 -->
, #{emailRequestDetail.recevOcr1} <!-- OCR1 -->
, #{emailRequestDetail.recevOcr2} <!-- OCR2 -->
, #{emailRequestDetail.recevOnlinePayNumber} <!-- 전자납부번호 -->
, #{emailRequestDetail.recevFinePrice} <!-- 과태료 -->
, #{emailRequestDetail.recevPayPrice} <!-- 납부금액 -->
, #{emailRequestDetail.recevPayDt} <!-- 납부기한 -->
, #{emailRequestDetail.recevPayInDate} <!-- 납기내기한 -->
, #{emailRequestDetail.recevPayInPrice} <!-- 납기내금액 -->
, #{emailRequestDetail.recevPayInAddPrice} <!-- 납기내가산금 -->
, #{emailRequestDetail.recevPayInDefaultPrice} <!-- 납기내합계금액 -->
, #{emailRequestDetail.recevPayOutDate} <!-- 납기후기한 -->
, #{emailRequestDetail.recevPayOutPrice} <!-- 납기후금액 -->
, #{emailRequestDetail.recevPayOutAddPrice} <!-- 납기후가산금 -->
, #{emailRequestDetail.recevPayOutDefaultPrice} <!-- 납기후합계금액 -->
, #{emailRequestDetail.recevCarNumber} <!-- 차량번호 -->
, #{emailRequestDetail.recevCarOwnerZipcode} <!-- 우편번호 -->
, #{emailRequestDetail.recevCarOwnerAddr} <!-- 주소 -->
, #{emailRequestDetail.recevCarOwnerDetailaddr} <!-- 상세주소 -->
, #{emailRequestDetail.recevCarOwnerNm} <!-- 소유자명 -->
, #{emailRequestDetail.recevCarOwnerSsn} <!-- 주민번호 -->
, #{emailRequestDetail.recevEvidenceNumber} <!-- 증거번호 -->
, #{emailRequestDetail.recevPhotoCnt} <!-- 사진장수 -->
, #{emailRequestDetail.recevPhotoFilename1} <!-- 사진파일명1 -->
, #{emailRequestDetail.recevPhotoFilename2} <!-- 사진파일명2 -->
, #{emailRequestDetail.recevPhotoFilename3} <!-- 사진파일명3 -->
, #{emailRequestDetail.recevPhotoFilename4} <!-- 사진파일명4 -->
, #{emailRequestDetail.vractno2} <!-- 가상계좌번호2 -->
, #{emailRequestDetail.vractno3} <!-- 가상계좌번호3 -->
, #{emailRequestDetail.vractno4} <!-- 가상계좌번호4 -->
, #{emailRequestDetail.vractno5} <!-- 가상계좌번호5 -->
, #{emailRequestDetail.vractno6} <!-- 가상계좌번호6 -->
, #{emailRequestDetail.vractno7} <!-- 가상계좌번호7 -->
, #{emailRequestDetail.vractno8} <!-- 가상계좌번호8 -->
, #{emailRequestDetail.vractno9} <!-- 가상계좌번호9 -->
, #{emailRequestDetail.vractno10} <!-- 가상계좌번호10 -->
, #{emailRequestDetail.vractno11} <!-- 가상계좌번호11 -->
, #{emailRequestDetail.dtlVarData1} <!-- 추가 데이터1 (계도 메일 제목) -->
, #{emailRequestDetail.dtlVarData2} <!-- 추가 데이터2 (계도 메일 내용) -->
, #{emailRequestDetail.dtlVarData3} <!-- 추가 데이터3 -->
, #{emailRequestDetail.dtlVarData4} <!-- 추가 데이터4 -->
, #{emailRequestDetail.dtlVarData5} <!-- 추가 데이터5 -->
, #{emailRequestDetail.dlvrRsltId} <!-- 배달 결과 ID -->
, #{emailRequestDetail.makeRsltCd} <!-- 제작 결과 코드 -->
, <include refid="utility.now" /> <!-- 등록 일시 -->
, #{currentUser.id} <!-- 등록자 -->
, #{emailRequestDetail.vractno} <!-- 가상계좌번호 -->
)</insert>
<update id="updateRequestDetail" parameterType="map">/* 전자우편 신청 상세 수정(emailRequestMapper.updateRequestDetail) */
UPDATE TB_EPOST_RCPT_DTL SET
RECEV_SEQ = #{emailRequestDetail.recevSeq} <!-- 일련번호 -->
, RECEV_CODE = #{emailRequestDetail.recevCode} <!-- 발송코드 -->
, RECEV_BAR1D = #{emailRequestDetail.recevBar1d} <!-- 바코드 -->
, RECEV_BAR2D = #{emailRequestDetail.recevBar2d} <!-- 이차원바코드 -->
, RECEV_BILL_NUNBER = #{emailRequestDetail.recevBillNunber} <!-- 고지번호 -->
, RECEV_DOC_CD1 = #{emailRequestDetail.recevDocCd1} <!-- 문서종류1 -->
, RECEV_DOC_CD2 = #{emailRequestDetail.recevDocCd2} <!-- 문서종류2 -->
, RECEV_DOC_CD3 = #{emailRequestDetail.recevDocCd3} <!-- 문서종류3 -->
, RECEV_DOC_CD4 = #{emailRequestDetail.recevDocCd4} <!-- 문서종류4 -->
, RECEV_DOC_CD5 = #{emailRequestDetail.recevDocCd5} <!-- 문서종류5 -->
, RECEV_SUBJ1 = #{emailRequestDetail.recevSubj1} <!-- 과목명1 -->
, RECEV_SUBJ2 = #{emailRequestDetail.recevSubj2} <!-- 과목명2 -->
, RECEV_SUBJ3 = #{emailRequestDetail.recevSubj3} <!-- 과목명3 -->
, RECEV_VIOLATE_DT = #{emailRequestDetail.recevViolateDt} <!-- 위반일시 -->
, RECEV_VIOLATE_DONG = #{emailRequestDetail.recevViolateDong} <!-- 위반동 -->
, RECEV_VIOLATE_PLACE = #{emailRequestDetail.recevViolatePlace} <!-- 위반장소 -->
, RECEV_LAWS = #{emailRequestDetail.recevLaws} <!-- 법조항 -->
, RECEV_PAY_NUMBER1 = #{emailRequestDetail.recevPayNumber1} <!-- 납부번호1 -->
, RECEV_PAY_NUMBER2 = #{emailRequestDetail.recevPayNumber2} <!-- 납부번호2 -->
, RECEV_OCR0 = #{emailRequestDetail.recevOcr0} <!-- OCR0 -->
, RECEV_OCR1 = #{emailRequestDetail.recevOcr1} <!-- OCR1 -->
, RECEV_OCR2 = #{emailRequestDetail.recevOcr2} <!-- OCR2 -->
, RECEV_ONLINE_PAY_NUMBER = #{emailRequestDetail.recevOnlinePayNumber} <!-- 전자납부번호 -->
, RECEV_FINE_PRICE = #{emailRequestDetail.recevFinePrice} <!-- 과태료 -->
, RECEV_PAY_PRICE = #{emailRequestDetail.recevPayPrice} <!-- 납부금액 -->
, RECEV_PAY_DT = #{emailRequestDetail.recevPayDt} <!-- 납부기한 -->
, RECEV_PAY_IN_DATE = #{emailRequestDetail.recevPayInDate} <!-- 납기내기한 -->
, RECEV_PAY_IN_PRICE = #{emailRequestDetail.recevPayInPrice} <!-- 납기내금액 -->
, RECEV_PAY_IN_ADD_PRICE = #{emailRequestDetail.recevPayInAddPrice} <!-- 납기내가산금 -->
, RECEV_PAY_IN_DEFAULT_PRICE = #{emailRequestDetail.recevPayInDefaultPrice} <!-- 납기내합계금액 -->
, RECEV_PAY_OUT_DATE = #{emailRequestDetail.recevPayOutDate} <!-- 납기후기한 -->
, RECEV_PAY_OUT_PRICE = #{emailRequestDetail.recevPayOutPrice} <!-- 납기후금액 -->
, RECEV_PAY_OUT_ADD_PRICE = #{emailRequestDetail.recevPayOutAddPrice} <!-- 납기후가산금 -->
, RECEV_PAY_OUT_DEFAULT_PRICE = #{emailRequestDetail.recevPayOutDefaultPrice} <!-- 납기후합계금액 -->
, RECEV_CAR_NUMBER = #{emailRequestDetail.recevCarNumber} <!-- 차량번호 -->
, RECEV_CAR_OWNER_ZIPCODE = #{emailRequestDetail.recevCarOwnerZipcode} <!-- 우편번호 -->
, RECEV_CAR_OWNER_ADDR = #{emailRequestDetail.recevCarOwnerAddr} <!-- 주소 -->
, RECEV_CAR_OWNER_DETAILADDR = #{emailRequestDetail.recevCarOwnerDetailaddr} <!-- 상세주소 -->
, RECEV_CAR_OWNER_NM = #{emailRequestDetail.recevCarOwnerNm} <!-- 소유자명 -->
, RECEV_CAR_OWNER_SSN = #{emailRequestDetail.recevCarOwnerSsn} <!-- 주민번호 -->
, RECEV_EVIDENCE_NUMBER = #{emailRequestDetail.recevEvidenceNumber} <!-- 증거번호 -->
, RECEV_PHOTO_CNT = #{emailRequestDetail.recevPhotoCnt} <!-- 사진장수 -->
, RECEV_PHOTO_FILENAME1 = #{emailRequestDetail.recevPhotoFilename1} <!-- 사진파일명1 -->
, RECEV_PHOTO_FILENAME2 = #{emailRequestDetail.recevPhotoFilename2} <!-- 사진파일명2 -->
, RECEV_PHOTO_FILENAME3 = #{emailRequestDetail.recevPhotoFilename3} <!-- 사진파일명3 -->
, RECEV_PHOTO_FILENAME4 = #{emailRequestDetail.recevPhotoFilename4} <!-- 사진파일명4 -->
, VRACTNO2 = #{emailRequestDetail.vractno2} <!-- 가상계좌번호2 -->
, VRACTNO3 = #{emailRequestDetail.vractno3} <!-- 가상계좌번호3 -->
, VRACTNO4 = #{emailRequestDetail.vractno4} <!-- 가상계좌번호4 -->
, VRACTNO5 = #{emailRequestDetail.vractno5} <!-- 가상계좌번호5 -->
, VRACTNO6 = #{emailRequestDetail.vractno6} <!-- 가상계좌번호6 -->
, VRACTNO7 = #{emailRequestDetail.vractno7} <!-- 가상계좌번호7 -->
, VRACTNO8 = #{emailRequestDetail.vractno8} <!-- 가상계좌번호8 -->
, VRACTNO9 = #{emailRequestDetail.vractno9} <!-- 가상계좌번호9 -->
, VRACTNO10 = #{emailRequestDetail.vractno10} <!-- 가상계좌번호10 -->
, VRACTNO11 = #{emailRequestDetail.vractno11} <!-- 가상계좌번호11 -->
, DTL_VAR_DATA1 = #{emailRequestDetail.dtlVarData1} <!-- 추가 데이터1 -->
, DTL_VAR_DATA2 = #{emailRequestDetail.dtlVarData2} <!-- 추가 데이터2 -->
, DTL_VAR_DATA3 = #{emailRequestDetail.dtlVarData3} <!-- 추가 데이터3 -->
, DTL_VAR_DATA4 = #{emailRequestDetail.dtlVarData4} <!-- 추가 데이터4 -->
, DTL_VAR_DATA5 = #{emailRequestDetail.dtlVarData5} <!-- 추가 데이터5 -->
, DLVR_RSLT_ID = #{emailRequestDetail.dlvrRsltId} <!-- 배달 결과 ID -->
, MAKE_RSLT_CD = #{emailRequestDetail.makeRsltCd} <!-- 제작 결과 코드 -->
, VRACTNO = #{emailRequestDetail.vractno} <!-- 가상계좌번호 -->
WHERE CON_KEY = #{emailRequestDetail.conKey}
AND RGST_NMBR = #{emailRequestDetail.rgstNmbr}</update>
<update id="updateRequestDetailStatus" parameterType="map">/* 전자우편 신청 상세 상태 변경(emailRequestMapper.updateRequestDetailStatus) */
UPDATE TB_EPOST_RCPT_DTL A
<if test='resultType == "production"'>
, (<foreach collection="results" item="result" separator=" UNION">
SELECT #{result.conKey} CON_KEY, #{result.rgstNmbr} RGST_NMBR, #{result.dataCd} MAKE_RSLT_CD</foreach>
) B
SET A.MAKE_RSLT_CD = B.MAKE_RSLT_CD
</if>
<if test='resultType == "delivery"'>
, (<foreach collection="results" item="result" separator=" UNION">
SELECT #{result.reletcdata} CON_KEY, #{result.regino} RGST_NMBR, #{result.dlvrRsltId} DLVR_RSLT_ID</foreach>
) B
SET A.DLVR_RSLT_ID = B.DLVR_RSLT_ID
</if>
WHERE A.CON_KEY = B.CON_KEY
AND B.RGST_NMBR = B.RGST_NMBR
</update>
</mapper>

@ -0,0 +1,216 @@
<?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.interfaces.epost.dao.EmailResultMapper">
<!-- 전자우편 신청 정보 매퍼
========== 변경 이력 ==========
2023-07-03 mjkhan 최초 작성
============================ -->
<insert id="insertReceptionResult" parameterType="cokr.xit.interfaces.epost.ReceptionResult">/* 전자우편 신청 수신 결과 등록(emailResultMapper.insertReceptionResult) */
<selectKey resultType="string" keyProperty="rcptnRsltId" order="BEFORE">
SELECT IFNULL(MAX(RCPTN_RSLT_ID) + 1, CONCAT(TODAY, '0000001')) NEW_ID
FROM TB_EPOST_RCPTN_RSLT A, (<include refid="utility.selectToday" />) B
WHERE RCPTN_RSLT_ID LIKE CONCAT(TODAY, '%')</selectKey>
INSERT INTO TB_EPOST_RCPTN_RSLT (
RCPTN_RSLT_ID <!-- 수신 결과 ID -->
, OUTSIDUSERID <!-- 연계기관코드 -->
, INIT_TIME <!-- 수신일시 -->
, RECV_FILENAME <!-- 수신파일명 -->
, RELDIVKEY <!-- 연계키 -->
, RECPRSNSEQ <!-- 수취인순번 -->
, REGINO <!-- 등기번호 -->
, ATTACHFILENM <!-- 첨부파일명 -->
, JUNGHAP1 <!-- 1차검증 -->
, JUNGHAP2 <!-- 2차검증 -->
, JUNGHAP3 <!-- 3차검증 -->
, CODE <!-- 상태코드 -->
, MSG <!-- 메시지 -->
, REG_DT <!-- 등록 일시 -->
, RGTR <!-- 등록자 -->
)
SELECT #{rcptnRsltId} <!-- 수신 결과 ID -->
, #{outsiduserid} <!-- 연계기관코드 -->
, #{initTime} <!-- 수신일시 -->
, #{recvFilename} <!-- 수신파일명 -->
, #{reldivkey} <!-- 연계키 -->
, #{recprsnseq} <!-- 수취인순번 -->
, #{regino} <!-- 등기번호 -->
, #{attachfilenm} <!-- 첨부파일명 -->
, #{junghap1} <!-- 1차검증 -->
, #{junghap2} <!-- 2차검증 -->
, #{junghap3} <!-- 3차검증 -->
, #{code} <!-- 상태코드 -->
, #{msg} <!-- 메시지 -->
, #{createdAt} <!-- 등록 일시 -->
, #{createdBy} <!-- 등록자 -->
WHERE NOT EXISTS (
SELECT 1
FROM TB_EPOST_RCPTN_RSLT
WHERE RELDIVKEY = #{reldivkey}
AND REGINO = #{regino}
)</insert>
<insert id="insertRegistrationResult" parameterType="cokr.xit.interfaces.epost.RegistrationResult">/* 전자우편 신청 접수 결과 등록(emailResultMapper.insertRegistrationResult) */
<selectKey resultType="string" keyProperty="rcptRsltId" order="BEFORE">
SELECT IFNULL(MAX(RCPT_RSLT_ID) + 1, CONCAT(TODAY, '0000001')) NEW_ID
FROM TB_EPOST_RCPT_RSLT A, (<include refid="utility.selectToday" />) B
WHERE RCPT_RSLT_ID LIKE CONCAT(TODAY, '%')</selectKey>
INSERT INTO TB_EPOST_RCPT_RSLT (
RCPT_RSLT_ID <!-- 접수 결과 ID -->
, CON_ORG <!-- 외부기관구분코드 -->
, RELORSECT_CD <!-- 결제부서코드 -->
, RELETCDATA <!-- 발송인별추가데이터 -->
, EXTRI_REGYMD <!-- 기관발송일자 -->
, RCEPT_YMD <!-- 접수일자 -->
, RCEPT_ID <!-- 접수우체국국기호 -->
, DIV_KB <!-- 취급구분 -->
, RCEPT_CNT <!-- 발송수량 -->
, RCEPT_AMT <!-- 결제금액 -->
, USEFEE_AMT <!-- 제작수수료 -->
, TOTPOST_PRC <!-- 우편요금 -->
, JOB_CD <!-- 작업 코드 -->
, REG_DT <!-- 등록 일시 -->
, RGTR <!-- 등록자 -->
)
SELECT #{rcptRsltId} <!-- 접수 결과 ID -->
, #{conOrg} <!-- 외부기관구분코드 -->
, #{relorsectCd} <!-- 결제부서코드 -->
, #{reletcdata} <!-- 발송인별추가데이터 -->
, #{extriRegymd} <!-- 기관발송일자 -->
, #{rceptYmd} <!-- 접수일자 -->
, #{rceptId} <!-- 접수우체국국기호 -->
, #{divKb} <!-- 취급구분 -->
, #{rceptCnt} <!-- 발송수량 -->
, #{rceptAmt} <!-- 결제금액 -->
, #{usefeeAmt} <!-- 제작수수료 -->
, #{totpostPrc} <!-- 우편요금 -->
, #{jobCd} <!-- 작업 코드 -->
, #{createdAt} <!-- 등록 일시 -->
, #{createdBy} <!-- 등록자 -->
FROM DUAL
WHERE NOT EXISTS ( <!-- RELETCDATA가 등록되어 있는 것은 제외 -->
SELECT 1
FROM TB_EPOST_RCPT_RSLT
WHERE RELETCDATA = #{reletcdata}
)</insert>
<update id="updateRegistrationResult" parameterType="map">/* 전자우편 신청 접수 결과(jobCd) 업데이트(emailResultMapper.updateRegistrationResult) */
UPDATE TB_EPOST_RCPT_RSLT A
, TB_EPOST_RCPT_REG B
SET A.JOB_CD = SUBSTR(B.JOB_CD, 2)
WHERE A.RELETCDATA IN (<foreach collection="conKeys" item="conKey" separator=",">#{conKey}</foreach>)
AND A.RELETCDATA = B.CON_KEY</update>
<insert id="insertProductionResult" parameterType="cokr.xit.interfaces.epost.ProductionResult">/* 전자우편 제작 결과 등록(emailResultMapper.insertProductionResult) */
INSERT INTO TB_EPOST_MAKE_RSLT (
CON_KEY <!-- 외부연계식별키 -->
, RGST_NMBR <!-- 등기 번호 -->
, RELETCDATA <!-- 발송인별추가데이터 -->
, DATA_CD <!-- 제작결과 -->
, MAIL_CNT <!-- 내용문매수 -->
, REG_DT <!-- 등록 일시 -->
, RGTR <!-- 등록자 -->
)
SELECT #{conKey} <!-- 외부연계식별키 -->
, #{rgstNmbr} <!-- 등기 번호 -->
, #{reletcdata} <!-- 발송인별추가데이터 -->
, #{dataCd} <!-- 제작결과 -->
, #{mailCnt} <!-- 내용문매수 -->
, #{createdAt} <!-- 등록 일시 -->
, #{createdBy} <!-- 등록자 -->
FROM DUAL
WHERE NOT EXISTS ( <!-- CON_KEY, RGST_NMBR가 등록되어 있는 것은 제외 -->
SELECT 1
FROM TB_EPOST_MAKE_RSLT
WHERE CON_KEY = #{conKey}
AND RGST_NMBR = #{rgstNmbr}
)</insert>
<insert id="insertDeliveryResult" parameterType="cokr.xit.interfaces.epost.DeliveryResult">/* 전자우편 배달 결과 등록(emailResultMapper.insertDeliveryResult) */
<selectKey resultType="string" keyProperty="dlvrRsltId" order="BEFORE">
SELECT IFNULL(MAX(DLVR_RSLT_ID) + 1, CONCAT(TODAY, '0000001')) NEW_ID
FROM TB_EPOST_DLVR_RSLT A, (<include refid="utility.selectToday" />) B
WHERE DLVR_RSLT_ID LIKE CONCAT(TODAY, '%')</selectKey>
INSERT INTO TB_EPOST_DLVR_RSLT (
DLVR_RSLT_ID <!-- 배달 결과 ID -->
, CON_KEY <!-- 외부연계식별키 -->
, OUTSIDUSERID <!-- 외부기관구분코드 -->
, RELETCDATA <!-- 발송인별추가데이터 -->
, REGINO <!-- 등기번호 -->
, DELIVYMD <!-- 배달일자 -->
, DELIVHHMI <!-- 배달시분 -->
, DELIVRSLTCD <!-- 배달결과코드 -->
, NONDELIVREASNCD <!-- 미배달사유코드 -->
, NONDELIVREASNCDNM <!-- 미배달사유명 -->
, SUBRECPRSNNM <!-- 수령인명 -->
, RELRECPRSNCD <!-- 수령인관계코드 -->
, RELRECPRSNCDNM <!-- 수령인관계명 -->
, REG_DT <!-- 등록 일시 -->
, RGTR <!-- 등록자 -->
) VALUES (
#{dlvrRsltId} <!-- 배달 결과 ID -->
, #{reletcdata} <!-- 외부연계식별키, 발송인별추가데이터 -->
, #{outsiduserid} <!-- 외부기관구분코드 -->
, #{reletcdata} <!-- 발송인별추가데이터 -->
, #{regino} <!-- 등기번호 -->
, #{delivymd} <!-- 배달일자 -->
, #{delivhhmi} <!-- 배달시분 -->
, #{delivrsltcd} <!-- 배달결과코드 -->
, #{nondelivreasncd} <!-- 미배달사유코드 -->
, #{nondelivreasncdnm} <!-- 미배달사유명 -->
, #{subrecprsnnm} <!-- 수령인명 -->
, #{relrecprsncd} <!-- 수령인관계코드 -->
, #{relrecprsncdnm} <!-- 수령인관계명 -->
, #{createdAt} <!-- 등록 일시 -->
, #{createdBy} <!-- 등록자 -->
)</insert>
<select id="selectResultLogs" parameterType="map" resultType="dataobject">/* 전자우편 신청결과 로그 조회(emailResultMapper.selectResultLogs) */
<include refid="utility.paging-prefix" />
SELECT PROC_ID <!-- 처리 ID -->
, PROC_SEQ <!-- 순번 -->
, PROC_TYPE <!-- 처리 유형 -->
, RESULT_ID <!-- 처리결과 ID -->
, CON_KEY <!-- 외부연계 식별자 -->
, RGST_NMBR <!-- 등기번호 -->
, PROC_STT <!-- 처리상태 -->
FROM TB_EPOST_PROC_LOG
WHERE PROC_ID = #{procID}
AND PROC_STT = 'N'
<include refid="utility.orderBy" />
<include refid="utility.paging-suffix" /></select>
<insert id="insertResultLogs" parameterType="map">/* 전자우편 신청결과 로그 등록(emailResultMapper.insertResultLogs) */
INSERT INTO TB_EPOST_PROC_LOG (
PROC_ID <!-- 처리 ID -->
, PROC_SEQ <!-- 처리 순번 -->
, PROC_TYPE <!-- 처리 유형 -->
, RESULT_ID <!-- 결과 ID -->
, CON_KEY <!-- 외부연계 식별키 -->
, RGST_NMBR <!-- 등기번호 -->
, PROC_STT <!-- 업무 연계 상태 -->
, REG_DT <!-- 등록 일시 -->
, RGTR <!-- 등록자 -->
)<foreach collection="logs" item="log" separator=" UNION">
SELECT #{log.procId} <!-- 처리 ID -->
, #{log.procSeq} <!-- 처리 순번 -->
, #{log.procType} <!-- 처리 유형 -->
, #{log.resultId} <!-- 결과 ID -->
, #{log.conKey} <!-- 외부연계 식별키 -->
, #{log.rgstNmbr} <!-- 등기번호 -->
, 'N' <!-- 업무 연계 상태 -->
, #{log.createdAt} <!-- 등록 일시 -->
, #{log.createdBy} <!-- 등록자 --></foreach>
</insert>
<update id="updateResultLogStatus" parameterType="map">/* 전자우편 신청결과 로그 상태 업데이트(emailResultMapper.updateResultLogStatus) */
UPDATE TB_EPOST_PROC_LOG A
, (<foreach collection="logs" item="log" separator=" UNION">
SELECT #{log.PROC_ID} PROC_ID, #{log.PROC_SEQ} PROC_SEQ, #{log.PROC_STT} PROC_STT</foreach>
) B
SET A.PROC_STT = B.PROC_STT
WHERE A.PROC_ID = B.PROC_ID
AND A.PROC_SEQ = B.PROC_SEQ</update>
</mapper>

@ -0,0 +1,114 @@
CREATE OR REPLACE TABLE TB_EPOST_RCPT_REG (
CON_KEY VARCHAR(30) NOT NULL COMMENT '외부연계식별키',
RCEPT_ID VARCHAR(5) COMMENT '접수우체국국기호',
DATA_CD VARCHAR(2) COMMENT '접수코드',
DIV_KB VARCHAR(3) COMMENT '취급구분',
DFPAYYN VARCHAR(3) COMMENT '결재방법',
RCPT_KB VARCHAR(3) COMMENT '내용문 유형',
SEAL_CD VARCHAR(3) COMMENT '내용문 상세 종류',
WORD_KB VARCHAR(3) COMMENT '내용문 종류',
MAIL_CNT INT(11) COMMENT '내용문 매수',
RECEV_CNT INT(11) COMMENT '수취인 수',
ENV_CD VARCHAR(3) COMMENT '봉투 종류',
COLOR_YN VARCHAR(1) COMMENT '칼라우편물',
MM_YN VARCHAR(1) COMMENT '메일머지 플래그',
FLEX_CD VARCHAR(1) COMMENT '이면구분',
DM_CNT INT(11) COMMENT '동봉물 개수',
SB_FG VARCHAR(1) COMMENT '반송불필요 여부',
APVL_NB VARCHAR(10) COMMENT '승인번호',
SEND_DATE VARCHAR(8) COMMENT '신청 일자',
SEND_TIME VARCHAR(6) COMMENT '전송 시간',
RELORSECT_CD VARCHAR(15) COMMENT '연계기관결제부서코드',
RECEV_SENDER_ORG_CODE VARCHAR(15) COMMENT '발송기관코드',
RECEV_SENDER_NM VARCHAR(40) COMMENT '발송인명',
RECEV_SENDER_ZIPCODE VARCHAR(6) COMMENT '발송인 우편번호',
RECEV_SENDER_ADDR VARCHAR(60) COMMENT '주소',
RECEV_SENDER_DETAILADDR VARCHAR(100) COMMENT '상세주소',
RECEV_SENDER_DEPART_TEL VARCHAR(60) COMMENT '부과부서 전화번호',
RECEV_SENDER_DEPART_NM VARCHAR(30) COMMENT '부과부서',
RECEV_DIV_CD VARCHAR(1) COMMENT '등기구분',
RECEV_PRINT_DT VARCHAR(21) COMMENT '출력일자',
RECEV_PRINT_YEAR VARCHAR(4) COMMENT '출력연도',
RECEV_PRINT_MONTH VARCHAR(2) COMMENT '출력월',
RECEV_PRINT_DAY VARCHAR(2) COMMENT '출력일',
RECEV_SENDER_FAX VARCHAR(20) COMMENT '부과부서 팩스번호',
RECEV_SERDER_STAFF VARCHAR(30) COMMENT '부과부서 담당자',
RECEV_SENDER_EMAIL VARCHAR(60) COMMENT '부과부서 이메일',
SNDNG_ID VARCHAR(20) COMMENT '발송 ID',
JOB_CD VARCHAR(4) COMMENT '작업 코드',
POST_PROC_STT VARCHAR(2) COMMENT 'POST_PROC_STT',
RCEPT_YMD VARCHAR(8) COMMENT 'RCEPT_YMD',
DEL_YN VARCHAR(1) COMMENT '삭제 여부',
REG_DT VARCHAR(14) COMMENT '등록 일시',
RGTR VARCHAR(20) COMMENT '등록자',
DEL_DT VARCHAR(14) COMMENT '삭제 일시',
DLTR VARCHAR(20) COMMENT '삭제자',
PRIMARY KEY (CON_KEY)
) COMMENT='전자우편 접수 등록';
CREATE OR REPLACE TABLE TB_EPOST_RCPT_DTL (
CON_KEY VARCHAR(30) NOT NULL COMMENT '외부연계식별키',
RGST_NMBR VARCHAR(13) NOT NULL COMMENT '등기번호',
RECEV_SEQ VARCHAR(20) COMMENT '일련번호',
RECEV_CODE VARCHAR(10) COMMENT '발송코드',
RECEV_BAR1D VARCHAR(18) COMMENT '바코드',
RECEV_BAR2D VARCHAR(170) COMMENT '이차원바코드',
RECEV_BILL_NUNBER VARCHAR(21) COMMENT '고지번호',
RECEV_DOC_CD1 VARCHAR(60) COMMENT '문서종류1',
RECEV_DOC_CD2 VARCHAR(30) COMMENT '문서종류2',
RECEV_DOC_CD3 VARCHAR(6) COMMENT '문서종류3',
RECEV_DOC_CD4 VARCHAR(60) COMMENT '문서종류4',
RECEV_DOC_CD5 VARCHAR(15) COMMENT '문서종류5',
RECEV_SUBJ1 VARCHAR(6) COMMENT '과목명1',
RECEV_SUBJ2 VARCHAR(6) COMMENT '과목명2',
RECEV_SUBJ3 VARCHAR(14) COMMENT '과목명3',
RECEV_VIOLATE_DT VARCHAR(30) COMMENT '위반일시',
RECEV_VIOLATE_DONG VARCHAR(39) COMMENT '위반동',
RECEV_VIOLATE_PLACE VARCHAR(80) COMMENT '위반장소',
RECEV_LAWS VARCHAR(70) COMMENT '법조항',
RECEV_PAY_NUMBER1 VARCHAR(17) COMMENT '납부번호1',
RECEV_PAY_NUMBER2 VARCHAR(15) COMMENT '납부번호2',
RECEV_OCR0 VARCHAR(32) COMMENT 'OCR0',
RECEV_OCR1 VARCHAR(54) COMMENT 'OCR1',
RECEV_OCR2 VARCHAR(54) COMMENT 'OCR2',
RECEV_ONLINE_PAY_NUMBER VARCHAR(30) COMMENT '전자납부번호',
RECEV_VACCOUNT_NUMBER VARCHAR(50) COMMENT '가상계좌번호',
RECEV_FINE_PRICE VARCHAR(10) COMMENT '과태료',
RECEV_PAY_PRICE VARCHAR(10) COMMENT '납부금액',
RECEV_PAY_DT VARCHAR(15) COMMENT '납부기한',
RECEV_PAY_IN_DATE VARCHAR(10) COMMENT '납기내기한',
RECEV_PAY_IN_PRICE VARCHAR(10) COMMENT '납기내금액',
RECEV_PAY_IN_ADD_PRICE VARCHAR(10) COMMENT '납기내가산금',
RECEV_PAY_IN_DEFAULT_PRICE VARCHAR(10) COMMENT '납기내합계금액',
RECEV_PAY_OUT_DATE VARCHAR(10) COMMENT '납기후기한',
RECEV_PAY_OUT_PRICE VARCHAR(10) COMMENT '납기후금액',
RECEV_PAY_OUT_ADD_PRICE VARCHAR(10) COMMENT '납기후가산금',
RECEV_PAY_OUT_DEFAULT_PRICE VARCHAR(10) COMMENT '납기후합계금액',
RECEV_CAR_NUMBER VARCHAR(50) COMMENT '차량번호',
RECEV_CAR_OWNER_ZIPCODE VARCHAR(6) COMMENT '우편번호',
RECEV_CAR_OWNER_ADDR VARCHAR(99) COMMENT '주소',
RECEV_CAR_OWNER_DETAILADDR VARCHAR(159) COMMENT '상세주소',
RECEV_CAR_OWNER_NM VARCHAR(60) COMMENT '소유자명',
RECEV_CAR_OWNER_SSN VARCHAR(6) COMMENT '주민번호',
RECEV_EVIDENCE_NUMBER VARCHAR(24) COMMENT '증거번호',
RECEV_PHOTO_CNT VARCHAR(2) COMMENT '사진장수',
RECEV_PHOTO_FILENAME1 VARCHAR(80) COMMENT '사진파일명1',
RECEV_PHOTO_FILENAME2 VARCHAR(80) COMMENT '사진파일명2',
RECEV_PHOTO_FILENAME3 VARCHAR(80) COMMENT '사진파일명3',
RECEV_PHOTO_FILENAME4 VARCHAR(80) COMMENT '사진파일명4',
VRACTNO2 VARCHAR(50) COMMENT '가상계좌번호2',
VRACTNO3 VARCHAR(50) COMMENT '가상계좌번호3',
VRACTNO4 VARCHAR(50) COMMENT '가상계좌번호4',
VRACTNO5 VARCHAR(50) COMMENT '가상계좌번호5',
VRACTNO6 VARCHAR(50) COMMENT '가상계좌번호6',
VRACTNO7 VARCHAR(50) COMMENT '가상계좌번호7',
VRACTNO8 VARCHAR(50) COMMENT '가상계좌번호8',
VRACTNO9 VARCHAR(50) COMMENT '가상계좌번호9',
VRACTNO10 VARCHAR(50) COMMENT '가상계좌번호10',
VRACTNO11 VARCHAR(50) COMMENT '가상계좌번호11',
DLVR_RSLT_ID VARCHAR(20) COMMENT '배달 결과 ID',
MAKE_RSLT_CD VARCHAR(2) COMMENT '제작 결과 코드',
REG_DT VARCHAR(14) COMMENT '등록 일시',
RGTR VARCHAR(20) COMMENT '등록자',
PRIMARY KEY (CON_KEY, RGST_NMBR)
) COMMENT = '전자우편 접수 상세';
Loading…
Cancel
Save