우편모아 연계 수정

main
mjkhan21 3 months ago
parent f8c25d86f7
commit 3c0b7ab337

@ -31,7 +31,7 @@ public interface SndngMapper extends AbstractMapper {
* @param req
* @return
*/
List<DataObject> selectSndngs(SndbQuery req);
List<Sndng> selectSndngs(SndbQuery req);
default DataObject selectSndngInfo(SndbQuery req) {
// 삭제여부
@ -41,7 +41,7 @@ public interface SndngMapper extends AbstractMapper {
if (req.getOrderBy() == null)
req.setOrderBy("S.SNDNG_ID DESC");
List<DataObject> sndngs = selectSndngs(req);
List<DataObject> sndngs = selectSndngList(req);
return !sndngs.isEmpty() ? sndngs.get(0) : null;
}

@ -127,7 +127,7 @@ public interface SndngService {
* @param req
* @return
*/
List<DataObject> getSndngs(SndbQuery req);
List<Sndng> getSndngs(SndbQuery req);
/**(EPost) .
* @param sndng

@ -686,7 +686,7 @@ public class SndngBean extends AbstractBean {
* @param req
* @return
*/
public List<DataObject> getSndngs(SndbQuery req) {
public List<Sndng> getSndngs(SndbQuery req) {
// 삭제 여부 확인
if (req.getDelYn() == null) {
req.setDelYn("N");
@ -699,7 +699,6 @@ public class SndngBean extends AbstractBean {
req.setOrderBy(CmmnUtil.convertCamelCaseToSnakeCase(req.getBy()));
}
}
return sndngMapper.selectSndngs(req);
}

@ -110,7 +110,7 @@ public class SndngServiceBean extends AbstractServiceBean implements SndngServic
}
@Override
public List<DataObject> getSndngs(SndbQuery req) {
public List<Sndng> getSndngs(SndbQuery req) {
return sndngBean.getSndngs(req);
}

@ -489,7 +489,8 @@ public class Sndb01Controller extends ApplicationController {
.setSndngDtlList(list)
.setStandardYN("규격")
.setWeight(25)
.setPieceCount(1);
.setPieceCount(1)
.setSndngId(req.getSndngId());
Downloadable downloadable = woopyonMoaService.downloadRequest(wreq);
return new ModelAndView("downloadView")
.addObject("download", downloadable.setFilename("우편등록_" + now() + ".xls"));
@ -1264,7 +1265,7 @@ public class Sndb01Controller extends ApplicationController {
return new ModelAndView("fims/sndb/sndb01210-info")
.addObject("callPurpose", req.getCallPurpose()) // 호출 용도
.addObject("pageName", "sndb01210") // View(jsp)에서 사용할 id 뒤에 붙일 suffix
.addObject("prefixUrl", CLASS_URL) // prefixUrl
.addObject("infoPrefixUrl", CLASS_URL) // prefixUrl
.addObject("sggCd", req.getSggCd()) // 시군구 코드(SGG_CD)
.addObject("taskSeCd", req.getTaskSeCd()) // 업무 구분 코드(TASK_SE_CD)
.addObject("FIM047List", commonCodes.get("FIM047")) // 발송 구분 코드(SNDNG_SE_CD)

@ -3,27 +3,67 @@ package cokr.xit.fims.wpm;
import java.util.List;
import java.util.function.BiConsumer;
import cokr.xit.foundation.AbstractEntity;
import cokr.xit.fims.sndb.SndngDtl;
import cokr.xit.foundation.AbstractObject;
import lombok.Getter;
import lombok.Setter;
/**
* <ul><li>no - </li>
* <li>mailType - </li>
* <li>registPostOffice - </li>
* <li>deliveryStatus - </li>
* <li>generalNo - </li>
* <li>registrationNo - </li>
* <li>registeredNo - </li>
* <li>returnYN - </li>
* <li>standardYN - </li>
* <li>weight - </li>
* <li>pieceCount - </li>
* <li>fee - </li>
* <li>remark - </li>
* <li>payee - </li>
* <li>zipCode - </li>
* <li>address - </li>
* <li>detailAddress - </li>
* <li>docNo - </li>
* <li>docTitle - </li>
* <li>deptName - </li>
* <li>manager - </li>
* <li>deliveryPostOffice - </li>
* <li>deliveryResult - </li>
* <li>returnReason - </li>
* <li>deliveryDate - </li>
* <li>recipient - </li>
* <li>recipientRelation - </li>
* <li>contact - </li>
* <li>mailingDate - </li>
* <li>recipientTelno - </li>
* <li>recipientMobileNo - </li>
* <li>createdAt - </li>
* <li>useYN - </li>
* </ul>
* @author mjkhan
*/
@Getter
@Setter
public class WoopyonMoa extends AbstractEntity {
public class WoopyonMoa extends AbstractObject {
public static final List<BiConsumer<WoopyonMoa, String>> setters(List<String> headers) {
return headers.stream()
.map(header -> {
BiConsumer<WoopyonMoa, String> setter = switch (header) {
case "번호" -> (row, str) -> row.setNo(toInt(str));
case "번호" -> (row, str) -> {if (!isEmpty(str)) row.setNo(toInt(str));};
case "우편구분" -> (row, str) -> row.setMailType(str);
case "접수우체국" -> (row, str) -> row.setRegistPostOffice(str);
case "발송상태" -> (row, str) -> row.setDeliveryStatus(str);
case "일반번호" -> (row, str) -> row.setGeneralNo(str);
case "등기번호", "창구접수등기번호" -> (row, str) -> row.setRegistrationNo(str);
case "창구접수등기번호" -> (row, str) -> row.setRegistrationNo(str);
case "등기번호" -> (row, str) -> row.setRegisteredNo(str);
case "환부여부" -> (row, str) -> row.setReturnYN(str);
case "규격", "규격여부" -> (row, str) -> row.setStandardYN(str);
case "중량" -> (row, str) -> row.setWeight(toInt(str));
case "통수" -> (row, str) -> row.setPieceCount(toInt(str));
case "요금" -> (row, str) -> row.setFee(toLong(str));
case "중량" -> (row, str) -> {if (!isEmpty(str)) row.setWeight(toInt(str));};
case "통수" -> (row, str) -> {if (!isEmpty(str)) row.setPieceCount(toInt(str));};
case "요금" -> (row, str) -> {if (!isEmpty(str)) row.setFee(toLong(str));};
case "비고" -> (row, str) -> row.setRemark(str);
case "수취인" -> (row, str) -> row.setPayee(str);
case "우편번호" -> (row, str) -> row.setZipCode(str);
@ -51,8 +91,11 @@ public class WoopyonMoa extends AbstractEntity {
.filter(setter -> setter != null)
.toList();
}
/** 번호 */
private int no;
/** 우편구분 */
private String mailType;
/** 접수우체국 */
private String registPostOffice;
/** 발송상태 */
@ -61,6 +104,8 @@ public class WoopyonMoa extends AbstractEntity {
private String generalNo;
/** 창구접수등기번호 */
private String registrationNo;
/** 등기번호 */
private String registeredNo;
/** 환부여부 */
private String returnYN;
/** 규격여부 */
@ -113,4 +158,53 @@ public class WoopyonMoa extends AbstractEntity {
private String createdAt;
/** 사용여부 */
private String useYN;
public void update(SndngDtl sndngDtl) {
sndngDtl.setRgNo(ifEmpty(registeredNo, registrationNo)); // 등기번호
sndngDtl.setDlvrYmd(blankIfEmpty(deliveryDate).replace("-", "")); // 배달일
sndngDtl.setActlRcpnNm(recipient); // 실제 수령인
sndngDtl.setRcpnRelNm(recipientRelation); // 수령인 관계명
setUndelivered(sndngDtl); // 미배달 사유
setSndngDtlSttsCd(sndngDtl); // 상세상태코드
}
private void setUndelivered(SndngDtl sndngDtl) {
if (isEmpty(returnReason)) return;
sndngDtl.setUndlvrRsnNm(returnReason); // 미배달사유 이름
// 반송사유: 수취인부재, 주소불명, 수취인불명, 이사불명, 수취거절, 배달누락, 기타, 폐문부재
String code = switch (returnReason) { // EGP010
case "수취인부재" -> "5";
case "주소불명" -> "4";
case "수취인불명" -> "10";
case "이사불명" -> "8";
case "수취거절" -> "1";
case "배달누락" -> "11";
case "폐문부재" -> "12";
default -> "7";
};
sndngDtl.setUndlvrRsnCd(code); // 미배달사유 코드
}
private void setSndngDtlSttsCd(SndngDtl sndngDtl) {
/*
: , , , ,
: , , ,
*/
String delivery = deliveryStatus;
if (!"배달완료".equals(delivery))
delivery = deliveryResult;
String code = null;
if ("배달완료".equals(delivery))
code = "04"; // 발송확인(FIM050)
else if ("반송".equals(delivery))
code = "05";
else if (!isEmpty(returnReason))
code = "05"; //반송
else code = "03"; //발송
if (isEmpty(code)) return;
sndngDtl.setSndngDtlSttsCd(code);
}
}

@ -13,7 +13,6 @@ import lombok.experimental.Accessors;
@Accessors(chain = true)
public class WoopyonMoaRequest extends ServiceRequest {
private static final long serialVersionUID = 1L;
/** 템플릿 */
private String template;
/** 규격여부 */
@ -22,6 +21,8 @@ public class WoopyonMoaRequest extends ServiceRequest {
private int weight;
/** 통수 */
private int pieceCount;
/** 발송 아이디 */
private String sndngId;
/** 발송상세목록 */
private List<DataObject> sndngDtlList;
}

@ -0,0 +1,10 @@
package cokr.xit.fims.wpm.dao;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.foundation.component.AbstractMapper;
@Mapper("woopyonMoaMapper")
public interface WoopyonMoaMapper extends AbstractMapper {
}

@ -1,8 +1,11 @@
package cokr.xit.fims.wpm.service.bean;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.stream.Collectors;
import javax.annotation.Resource;
@ -11,7 +14,11 @@ import org.springframework.stereotype.Component;
import cokr.xit.base.docs.xls.XLSReader;
import cokr.xit.base.docs.xls.XLSWriter;
import cokr.xit.fims.sndb.service.bean.SndngDtlBean;
import cokr.xit.fims.sndb.SndbQuery;
import cokr.xit.fims.sndb.Sndng;
import cokr.xit.fims.sndb.SndngDtl;
import cokr.xit.fims.sndb.dao.SndngDtlMapper;
import cokr.xit.fims.sndb.dao.SndngMapper;
import cokr.xit.fims.wpm.WoopyonMoa;
import cokr.xit.fims.wpm.WoopyonMoaRequest;
import cokr.xit.foundation.Downloadable;
@ -21,14 +28,28 @@ import cokr.xit.foundation.data.DataObject;
@Component("woopyonMoaBean")
public class WoopyonMoaBean extends AbstractBean {
/** 발송 상세 정보 Bean */
@Resource(name = "sndngDtlBean")
private SndngDtlBean sndngDtlBean;
@Resource(name = "sndngMapper")
private SndngMapper sndngMapper;
/** 발송 상세 정보 Bean */
@Resource(name = "sndngDtlMapper")
private SndngDtlMapper sndngDtlMapper;
public Downloadable downloadRequest(WoopyonMoaRequest req) {
try (InputStream input = getTemplate(req.getTemplate())) {
int rowIndex = 1;
XLSWriter xlsx = new XLSWriter().template(input).worksheet(0);
Sndng sndng = new Sndng();
/*
sndng.setConKey(epostRcptReg.getConKey()); // 외부연계식별키
sndng.setDivKb(epostRcptReg.getDivKb()); // 취급 구분
// sndng.setEpostNoticeId(); // 전자우편 안내문 ID
*/
sndng.setSndngSttsCd("03"); // 발송 상태 코드(FIM049) - 03 전송, 01 발송 대기
sndng.setSndngId(req.getSndngId()); // 발송 ID
ArrayList<SndngDtl> sndngDtls = new ArrayList<>();
for (DataObject row: req.getSndngDtlList()) {
xlsx.cell(rowIndex, 0)
.rowValues(List.of(req.getStandardYN(), req.getWeight(), req.getPieceCount())) // 규격, 중량, 통수
@ -43,8 +64,23 @@ public class WoopyonMoaBean extends AbstractBean {
row.get("TTL_NM"), // 문서제목
blankIfEmpty(row.get("ETC_CN")) // 비고
));
SndngDtl sndngDtl = new SndngDtl();
/*
sndngDtl.setConKey(conKey); // 외부연계식별키
sndngDtl.setRgNo(rgstNmbr); // 등기 번호
*/
sndngDtl.setSndngDtlSttsCd("03"); // 발송 상세 상태 코드(FIM050) - 03 발송
sndngDtl.setSndngDtlId(row.string("SNDNG_DTL_ID"));
sndngDtls.add(sndngDtl);
++rowIndex;
}
sndngMapper.updateSndngSttsCd(sndng);
for (SndngDtl sndngDtl: sndngDtls) {
sndngDtlMapper.updateSndngDtlEPost(sndngDtl); // 전자우편 발송상세 내역 수정
}
return xlsx.getDownloadable();
} catch (Exception e) {
throw runtimeException(e);
@ -55,8 +91,34 @@ public class WoopyonMoaBean extends AbstractBean {
return new ClassPathResource("template/" + template).getInputStream();
}
public void updateStatus(InputStream input) {
List<WoopyonMoa> read = parse(input);
public int updateStatus(InputStream input) {
List<WoopyonMoa> parsed = parse(input);
if (isEmpty(parsed)) return 0;
// 발송상세 조회 및 업데이트
List<String> idList = parsed.stream().map(WoopyonMoa::getDocNo).toList(); // 발송상세ID
SndbQuery sreq = new SndbQuery().setSndngDtlIds(idList.toArray(new String[idList.size()]));
List<SndngDtl> details = sndngDtlMapper.selectSndngDetails(sreq);
if (details.isEmpty()) return 0;
Map<String, SndngDtl> byDtlId = details.stream().collect(Collectors.toMap(
SndngDtl::getSndngDtlId,
sndngDtl -> sndngDtl
));
for (WoopyonMoa wpm: parsed) {
SndngDtl detail = byDtlId.get(wpm.getDocNo());
if (detail == null) continue;
wpm.update(detail);
}
int affected = 0;
for (SndngDtl detail: details) {
affected += sndngDtlMapper.updateSndngDtl(detail);
}
return affected;
}
static List<WoopyonMoa> parse(InputStream input) {

@ -23,7 +23,6 @@ public class WoopyonMoaServiceBean extends AbstractServiceBean implements Woopyo
@Override
public int updateStatus(InputStream input) {
WoopyonMoaBean.parse(input);
return 0;
return woopyonMoaBean.updateStatus(input);
}
}

@ -0,0 +1,31 @@
package cokr.xit.fims.wpm.web;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.fims.wpm.service.WoopyonMoaService;
import cokr.xit.foundation.web.AbstractController;
@Controller
@RequestMapping("/woopyonmoa")
public class WoopyonMoaController extends AbstractController {
@Resource(name = "woopyonMoaService")
private WoopyonMoaService woopyonMoaService;
@PostMapping(name="발송정보 업데이트", value="/update.do")
public ModelAndView updateStatus(MultipartFile upload) {
try {
int affected = woopyonMoaService.updateStatus(upload.getInputStream());
return new ModelAndView("jsonView")
.addObject("affected", affected)
.addObject("saved", affected > 0);
} catch (Exception e) {
throw runtimeException(e);
}
}
}

@ -8,35 +8,35 @@
============================ -->
<resultMap id="sndngRow" type="cokr.xit.fims.sndb.Sndng"> <!-- TB_SNDNG 발송 대장 -->
<result property="sndngId" column="SNDNG_ID" /> <!-- 발송 ID -->
<result property="sggCd" column="SGG_CD" /> <!-- 시군구 코드 -->
<result property="taskSeCd" column="TASK_SE_CD" /> <!-- 업무 구분 코드 -->
<result property="deptCd" column="DEPT_CD" /> <!-- 부서 코드 -->
<result property="sndngRegSeCd" column="SNDNG_REG_SE_CD" /> <!-- 발송 등록 구분 코드 -->
<result property="sndngSeCd" column="SNDNG_SE_CD" /> <!-- 발송 구분 코드 -->
<result property="vltnId" column="VLTN_ID" /> <!-- 위반 ID -->
<result property="levyBgngYmd" column="LEVY_BGNG_YMD" /> <!-- 부과 시작 일자 -->
<result property="levyEndYmd" column="LEVY_END_YMD" /> <!-- 부과 종료 일자 -->
<result property="sndngYmd" column="SNDNG_YMD" /> <!-- 발송 일자 -->
<result property="sndngEndYmd" column="SNDNG_END_YMD" /> <!-- 발송 종료 일자 -->
<result property="ttlNm" column="TTL_NM" /> <!-- 제목 명 -->
<result property="docNo" column="DOC_NO" /> <!-- 문서 번호 -->
<result property="etcCn" column="ETC_CN" /> <!-- 기타 내용 -->
<result property="tnocs" column="TNOCS" /> <!-- 총건수 -->
<result property="gramt" column="GRAMT" /> <!-- 총금액 -->
<result property="conKey" column="CON_KEY" /> <!-- 외부연계식별키 -->
<result property="divKb" column="DIV_KB" /> <!-- 취급 구분 -->
<result property="epostNoticeId" column="EPOST_NOTICE_ID" /> <!-- 전자우편 안내문 ID -->
<result property="sndngSttsCd" column="SNDNG_STTS_CD" /> <!-- 발송 상태 코드 -->
<result property="rsndYn" column="RSND_YN" /> <!-- 재발송 여부 -->
<result property="delYn" column="DEL_YN" /> <!-- 삭제 여부 -->
<result property="createdAt" column="REG_DT" /> <!-- 등록 일시 -->
<result property="createdBy" column="RGTR" /> <!-- 등록자 -->
<result property="lastModified" column="MDFCN_DT" /> <!-- 수정 일시 -->
<result property="modifiedBy" column="MDFR" /> <!-- 수정자 -->
<result property="delDt" column="DEL_DT" /> <!-- 삭제 일시 -->
<result property="dltr" column="DLTR" /> <!-- 삭제자 -->
<result property="delRsn" column="DEL_RSN" /> <!-- 삭제 사유 -->
<result property="sndngId" column="SNDNG_ID" /> <!-- 발송 ID -->
<result property="sggCd" column="SGG_CD" /> <!-- 시군구 코드 -->
<result property="taskSeCd" column="TASK_SE_CD" /> <!-- 업무 구분 코드 -->
<result property="deptCd" column="DEPT_CD" /> <!-- 부서 코드 -->
<result property="sndngRegSeCd" column="SNDNG_REG_SE_CD" /><!-- 발송 등록 구분 코드 -->
<result property="sndngSeCd" column="SNDNG_SE_CD" /> <!-- 발송 구분 코드 -->
<result property="vltnId" column="VLTN_ID" /> <!-- 위반 ID -->
<result property="levyBgngYmd" column="LEVY_BGNG_YMD" /> <!-- 부과 시작 일자 -->
<result property="levyEndYmd" column="LEVY_END_YMD" /> <!-- 부과 종료 일자 -->
<result property="sndngYmd" column="SNDNG_YMD" /> <!-- 발송 일자 -->
<result property="sndngEndYmd" column="SNDNG_END_YMD" /> <!-- 발송 종료 일자 -->
<result property="ttlNm" column="TTL_NM" /> <!-- 제목 명 -->
<result property="docNo" column="DOC_NO" /> <!-- 문서 번호 -->
<result property="etcCn" column="ETC_CN" /> <!-- 기타 내용 -->
<result property="tnocs" column="TNOCS" /> <!-- 총건수 -->
<result property="gramt" column="GRAMT" /> <!-- 총금액 -->
<result property="conKey" column="CON_KEY" /> <!-- 외부연계식별키 -->
<result property="divKb" column="DIV_KB" /> <!-- 취급 구분 -->
<result property="epostNoticeId" column="EPOST_NOTICE_ID" /><!-- 전자우편 안내문 ID -->
<result property="sndngSttsCd" column="SNDNG_STTS_CD" /> <!-- 발송 상태 코드 -->
<result property="rsndYn" column="RSND_YN" /> <!-- 재발송 여부 -->
<result property="delYn" column="DEL_YN" /> <!-- 삭제 여부 -->
<result property="createdAt" column="REG_DT" /> <!-- 등록 일시 -->
<result property="createdBy" column="RGTR" /> <!-- 등록자 -->
<result property="lastModified" column="MDFCN_DT" /> <!-- 수정 일시 -->
<result property="modifiedBy" column="MDFR" /> <!-- 수정자 -->
<result property="delDt" column="DEL_DT" /> <!-- 삭제 일시 -->
<result property="dltr" column="DLTR" /> <!-- 삭제자 -->
<result property="delRsn" column="DEL_RSN" /> <!-- 삭제 사유 -->
</resultMap>
<sql id="selectList">
@ -84,64 +84,36 @@
<include refid="utility.paging-prefix" />
<include refid="selectList" />
<where>
<if test="schSndngYmdFrom != null">
AND S.SNDNG_YMD <![CDATA[>=]]> #{schSndngYmdFrom} <!-- 발송 일자 시작 -->
</if>
<if test="schSndngYmdTo != null">
AND S.SNDNG_YMD <![CDATA[<=]]> #{schSndngYmdTo} <!-- 발송 일자 종료 -->
</if>
<if test="schSndngRegSeCd != null">
AND S.SNDNG_REG_SE_CD = #{schSndngRegSeCd} <!-- 발송 등록 구분 코드 -->
</if>
<if test="schSndngSeCd != null">
AND S.SNDNG_SE_CD = #{schSndngSeCd} <!-- 발송 구분 코드 -->
</if>
<if test="sndngSeCd != null">
AND S.SNDNG_SE_CD = #{sndngSeCd} <!-- 발송 구분 코드 -->
</if>
<if test="sndngSeCdFrom != null">
AND S.SNDNG_SE_CD <![CDATA[>=]]> #{sndngSeCdFrom} <!-- 발송 구분 코드 시작 -->
</if>
<if test="sndngSeCdTo != null">
AND S.SNDNG_SE_CD <![CDATA[<=]]> #{sndngSeCdTo} <!-- 발송 구분 코드 종료 -->
</if>
<if test="sggCd != null">
AND S.SGG_CD = #{sggCd} <!-- 시군구 코드 -->
</if>
<if test="taskSeCd != null">
AND S.TASK_SE_CD = #{taskSeCd} <!-- 업무 구분 코드 -->
</if>
AND S.DEL_YN = 'N' <!-- 삭제 여부 -->
<if test="sndngIds != null">AND S.SNDNG_ID IN (<foreach collection="sndngIds" item="sndngId" separator=",">#{sndngId}</foreach>)</if><!-- 발송 Ids -->
<if test="sndngId != null">AND S.SNDNG_ID = #{sndngId}</if><!-- 발송 ID -->
<if test="schSndngYmdFrom != null">AND S.SNDNG_YMD <![CDATA[>=]]> #{schSndngYmdFrom} <!-- 발송 일자 시작 --></if>
<if test="schSndngYmdTo != null">AND S.SNDNG_YMD <![CDATA[<=]]> #{schSndngYmdTo} <!-- 발송 일자 종료 --></if>
<if test="schSndngRegSeCd != null">AND S.SNDNG_REG_SE_CD = #{schSndngRegSeCd} <!-- 발송 등록 구분 코드 --></if>
<if test="schSndngSeCd != null">AND S.SNDNG_SE_CD = #{schSndngSeCd} <!-- 발송 구분 코드 --></if>
<if test="sndngSeCd != null">AND S.SNDNG_SE_CD = #{sndngSeCd} <!-- 발송 구분 코드 --></if>
<if test="sndngSeCdFrom != null">AND S.SNDNG_SE_CD <![CDATA[>=]]> #{sndngSeCdFrom} <!-- 발송 구분 코드 시작 --></if>
<if test="sndngSeCdTo != null">AND S.SNDNG_SE_CD <![CDATA[<=]]> #{sndngSeCdTo} <!-- 발송 구분 코드 종료 --></if>
<if test="sggCd != null">AND S.SGG_CD = #{sggCd} <!-- 시군구 코드 --></if>
<if test="taskSeCd != null">AND S.TASK_SE_CD = #{taskSeCd} <!-- 업무 구분 코드 --></if>
AND S.DEL_YN = 'N' <!-- 삭제 여부 -->
<choose>
<when test="schRegDateOpt == 'regDt'">
<if test="schRegDateFrom != null">
AND S.REG_DT <![CDATA[>=]]> CONCAT(#{schRegDateFrom},'000000') <!-- 등록 일자 시작 -->
</if>
<if test="schRegDateTo != null">
AND S.REG_DT <![CDATA[<=]]> CONCAT(#{schRegDateTo},'235959') <!-- 등록 일자 종료 -->
</if>
<if test="schRegDateFrom != null">AND S.REG_DT <![CDATA[>=]]> CONCAT(#{schRegDateFrom},'000000') <!-- 등록 일자 시작 --></if>
<if test="schRegDateTo != null">AND S.REG_DT <![CDATA[<=]]> CONCAT(#{schRegDateTo},'235959') <!-- 등록 일자 종료 --></if>
</when>
<when test="schRegDateOpt == 'mdfcnDt'">
<if test="schRegDateFrom != null">
AND S.MDFCN_DT <![CDATA[>=]]> CONCAT(#{schRegDateFrom},'000000') <!-- 수정 일자 시작 -->
</if>
<if test="schRegDateTo != null">
AND S.MDFCN_DT <![CDATA[<=]]> CONCAT(#{schRegDateTo},'235959') <!-- 수정 일자 종료 -->
</if>
<if test="schRegDateFrom != null">AND S.MDFCN_DT <![CDATA[>=]]> CONCAT(#{schRegDateFrom},'000000') <!-- 수정 일자 시작 --></if>
<if test="schRegDateTo != null">AND S.MDFCN_DT <![CDATA[<=]]> CONCAT(#{schRegDateTo},'235959') <!-- 수정 일자 종료 --></if>
</when>
<otherwise>
</otherwise>
</choose>
<choose>
<when test="schRgtrOpt == 'rgtr'">
<if test="schRgtrCd != null">
AND S.RGTR = #{schRgtrCd} <!-- 등록자 코드 -->
</if>
<if test="schRgtrCd != null">AND S.RGTR = #{schRgtrCd} <!-- 등록자 코드 --></if>
</when>
<when test="schRgtrOpt == 'mdfr'">
<if test="schRgtrCd != null">
AND S.MDFR = #{schRgtrCd} <!-- 수정자 코드 -->
</if>
<if test="schRgtrCd != null">AND S.MDFR = #{schRgtrCd} <!-- 수정자 코드 --></if>
</when>
<otherwise>
</otherwise>
@ -174,17 +146,11 @@
<include refid="utility.paging-suffix" />
</select>
<select id="selectSndngs" parameterType="map" resultType="dataobject">/* 발송 대장 객체 가져오기(sndngMapper.selectSndngs) */
<select id="selectSndngs" parameterType="map" resultMap="sndngRow">/* 발송 대장 객체 가져오기(sndngMapper.selectSndngs) */
<include refid="selectList" />
<where>
<if test="sndngIds != null">
AND S.SNDNG_ID IN ( <!-- 발송 Ids -->
<foreach collection="sndngIds" item="sndngId" separator=","> #{sndngId} </foreach>
)
</if>
<if test="sndngId != null">
AND S.SNDNG_ID = #{sndngId} <!-- 발송 ID -->
</if>
<if test="sndngIds != null">AND S.SNDNG_ID IN (<foreach collection="sndngIds" item="sndngId" separator=",">#{sndngId}</foreach>)</if><!-- 발송 Ids -->
<if test="sndngId != null">AND S.SNDNG_ID = #{sndngId}</if><!-- 발송 ID -->
<choose>
<when test="delYn != null">
AND S.DEL_YN = #{delYn} <!-- 삭제 여부 -->

@ -11,7 +11,8 @@ import cokr.xit.fims.wpm.WoopyonMoa;
public class WoopyonMoaBeanTest {
@Test
void parse() {
try (InputStream input = new ClassPathResource("files/일반우편_발송완료.xls").getInputStream()) {
String path = "우편정보 업데이트 테스트.xls";
try (InputStream input = new ClassPathResource("files/" + path).getInputStream()) {
List<WoopyonMoa> rows = WoopyonMoaBean.parse(input);
rows.forEach(System.out::println);
} catch (Exception e) {

Loading…
Cancel
Save