단속 납부자 주소 이력 테이블 변경으로 이한 수정.

main
JoJH 1 week ago
parent be7e818ce9
commit afc3512e17

@ -5,7 +5,7 @@ import lombok.Getter;
import lombok.Setter; import lombok.Setter;
/** /**
* *
* @author JoJH * @author JoJH
*/ */
@Getter @Getter

@ -1,35 +0,0 @@
package cokr.xit.fims.cmmn;
import cokr.xit.foundation.AbstractEntity;
import lombok.Getter;
import lombok.Setter;
/**
*
* @author leebj
*/
@Getter
@Setter
public class CrdnPayerHstry extends AbstractEntity {
/**
* ID
*/
private String chgHstryId;
/**
* ID
*/
private String crdnId;
/**
* ID
*/
private String rtpyrId;
/**
*
*/
private String addrSn;
}

@ -0,0 +1,56 @@
package cokr.xit.fims.cmmn.dao;
import java.util.List;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.fims.cmmn.CrdnPayerAddrHstry;
import cokr.xit.fims.cmmn.CrdnPayerHstryQuery;
import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject;
/** DAO
*
* <p> :
*
* <pre>
* ============ ============
* 2023-08-16 leebj
* 2024-11-05 JoJH
* ================================
* </pre>
*/
@Mapper("crdnPayerAddrHstryMapper")
public interface CrdnPayerAddrHstryMapper extends AbstractMapper {
/** .<br />
* @param req
* @return
*/
List<DataObject> selectCrdnPayerHstryList(CrdnPayerHstryQuery req);
/** .
* @param req
* @return
*/
List<DataObject> selectCrdnPayerHstrys(CrdnPayerHstryQuery req);
/** .
* @param params
* <ul><li>"crdnPayerHstry" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
int insertCrdnPayerAddrHstry(CrdnPayerAddrHstry crdnPayerAddrHstry);
/**(TB_CRDN) ID .
* @param params
* <ul><li>"crdnPayerHstry" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
int updateCrdnPayerAddr(CrdnPayerAddrHstry crdnPayerAddrHstry);
}

@ -1,97 +0,0 @@
package cokr.xit.fims.cmmn.dao;
import java.util.List;
import java.util.Map;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.fims.cmmn.CrdnPayerAddrHstry;
import cokr.xit.fims.cmmn.CrdnPayerHstry;
import cokr.xit.fims.cmmn.CrdnPayerHstryQuery;
import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject;
/** DAO
*
* <p> :
*
* <pre>
* ============ ============
* 2023-08-16 leebj
* ================================
* </pre>
*/
@Mapper("crdnPayerHstryMapper")
public interface CrdnPayerHstryMapper extends AbstractMapper {
/** .<br />
* @param req
* @return
*/
List<DataObject> selectCrdnPayerHstryList(CrdnPayerHstryQuery req);
/** .
* @param req
* @return
*/
List<CrdnPayerHstry> selectCrdnPayerHstrys(CrdnPayerHstryQuery req);
/** .
* @param params
* <ul><li>"crdnPayerHstry" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
int insertCrdnPayerHstry(Map<String, Object> params);
/** .
* @param crdnPayerHstry
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
default boolean insertCrdnPayerHstry(CrdnPayerHstry crdnPayerHstry) {
return crdnPayerHstry != null && insertCrdnPayerHstry(params().set("crdnPayerHstry", crdnPayerHstry)) == 1;
}
/** .
* @param params
* <ul><li>"crdnPayerHstry" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
int insertCrdnPayerAddrHstry(CrdnPayerAddrHstry crdnPayerAddrHstry);
/**(TB_CRDN) ID .
* @param params
* <ul><li>"crdnPayerHstry" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
int updateCrdnPayerAddr(CrdnPayerAddrHstry crdnPayerAddrHstry);
/**(TB_CRDN) ID .
* @param params
* <ul><li>"crdnPayerHstry" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
*/
int updateCrdnRtpyrId(Map<String, Object> params);
/**(TB_CRDN) ID .
* @param crdnPayerHstry
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
default boolean updateCrdnPayer(CrdnPayerHstry crdnPayerHstry) {
return crdnPayerHstry != null && updateCrdnRtpyrId(params().set("crdnPayerHstry", crdnPayerHstry)) == 1;
}
}

@ -7,9 +7,8 @@ import javax.annotation.Resource;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import cokr.xit.fims.cmmn.CrdnPayerAddrHstry; import cokr.xit.fims.cmmn.CrdnPayerAddrHstry;
import cokr.xit.fims.cmmn.CrdnPayerHstry;
import cokr.xit.fims.cmmn.CrdnPayerHstryQuery; import cokr.xit.fims.cmmn.CrdnPayerHstryQuery;
import cokr.xit.fims.cmmn.dao.CrdnPayerHstryMapper; import cokr.xit.fims.cmmn.dao.CrdnPayerAddrHstryMapper;
import cokr.xit.foundation.component.AbstractBean; import cokr.xit.foundation.component.AbstractBean;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
@ -20,63 +19,51 @@ import cokr.xit.foundation.data.DataObject;
* <pre> * <pre>
* ============ ============ * ============ ============
* 2023-08-16 leebj * 2023-08-16 leebj
* 2024-11-05 JoJH
* ================================ * ================================
* </pre> * </pre>
*/ */
@Component("crdnPayerHstryBean") @Component("crdnPayerAddrHstryBean")
public class CrdnPayerHstryBean extends AbstractBean { public class CrdnPayerAddrHstryBean extends AbstractBean {
/** 단속 납부자 이력 정보 DAO */ /** 단속 납부자 이력 정보 DAO */
@Resource(name = "crdnPayerHstryMapper") @Resource(name = "crdnPayerAddrHstryMapper")
private CrdnPayerHstryMapper crdnPayerHstryMapper; private CrdnPayerAddrHstryMapper crdnPayerAddrHstryMapper;
/** . /** .
* @param req * @param req
* @return * @return
*/ */
public List<DataObject> getCrdnPayerHstryList(CrdnPayerHstryQuery req) { public List<DataObject> getCrdnPayerHstryList(CrdnPayerHstryQuery req) {
return crdnPayerHstryMapper.selectCrdnPayerHstryList(req); return crdnPayerAddrHstryMapper.selectCrdnPayerHstryList(req);
} }
/** . /** .
* @param req * @param req
* @return * @return
*/ */
public List<CrdnPayerHstry> getCrdnPayerHstrys(CrdnPayerHstryQuery req) { public List<DataObject> getCrdnPayerHstrys(CrdnPayerHstryQuery req) {
return crdnPayerHstryMapper.selectCrdnPayerHstrys(req); return crdnPayerAddrHstryMapper.selectCrdnPayerHstrys(req);
} }
/** . /** .
* @param crdnPayerHstry * @param crdnPayerAddrHstry
* @return * @return
* <ul><li> true</li> * <ul><li> true</li>
* <li> false</li> * <li> false</li>
* </ul> * </ul>
*/ */
public boolean createCrdnPayerHstry(CrdnPayerHstry crdnPayerHstry) { public boolean create(CrdnPayerAddrHstry crdnPayerAddrHstry) {
return crdnPayerHstryMapper.insertCrdnPayerHstry(crdnPayerHstry); int rtnNocs = crdnPayerAddrHstryMapper.insertCrdnPayerAddrHstry(crdnPayerAddrHstry);
if (rtnNocs != 1) {
return false;
} }
/** , . return true;
* @param crdnPayerHstry
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean updateCrdnPayer(CrdnPayerHstry crdnPayerHstry) {
return crdnPayerHstryMapper.updateCrdnPayer(crdnPayerHstry);
} }
/** .
* @param crdnPayerAddrHstry
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public int createCrdnPayerAddrHstry(CrdnPayerAddrHstry crdnPayerAddrHstry) { public int createCrdnPayerAddrHstry(CrdnPayerAddrHstry crdnPayerAddrHstry) {
return crdnPayerHstryMapper.insertCrdnPayerAddrHstry(crdnPayerAddrHstry); return crdnPayerAddrHstryMapper.insertCrdnPayerAddrHstry(crdnPayerAddrHstry);
} }
/** . /** .
@ -87,7 +74,7 @@ public class CrdnPayerHstryBean extends AbstractBean {
* </ul> * </ul>
*/ */
public int updateCrdnPayerAddr(CrdnPayerAddrHstry crdnPayerAddrHstry) { public int updateCrdnPayerAddr(CrdnPayerAddrHstry crdnPayerAddrHstry) {
return crdnPayerHstryMapper.updateCrdnPayerAddr(crdnPayerAddrHstry); return crdnPayerAddrHstryMapper.updateCrdnPayerAddr(crdnPayerAddrHstry);
} }
/** , . /** , .
@ -101,7 +88,7 @@ public class CrdnPayerHstryBean extends AbstractBean {
int rtnNocs = -1; // 처리 결과 건수 int rtnNocs = -1; // 처리 결과 건수
// 단속 납부자 주소 이력(TB_CRDN_PAYER_ADDR_HSTRY) 대장을 등록한다. // 단속 납부자 주소 이력(TB_CRDN_PAYER_ADDR_HSTRY) 대장을 등록한다.
rtnNocs = crdnPayerHstryMapper.insertCrdnPayerAddrHstry(crdnPayerAddrHstry); rtnNocs = crdnPayerAddrHstryMapper.insertCrdnPayerAddrHstry(crdnPayerAddrHstry);
if (rtnNocs != 1) { if (rtnNocs != 1) {
throw new RuntimeException("납부자주소 이력 대장 등록 중 오류가 발생하였습니다."); // 예외를 발생시켜서 DB Rollback throw new RuntimeException("납부자주소 이력 대장 등록 중 오류가 발생하였습니다."); // 예외를 발생시켜서 DB Rollback
} }

@ -23,7 +23,7 @@ import cokr.xit.base.file.service.bean.FileBean;
import cokr.xit.fims.cmmn.CmmnUtil; import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.CrdnPayerAddrHstry; import cokr.xit.fims.cmmn.CrdnPayerAddrHstry;
import cokr.xit.fims.cmmn.CrdnSttsHstry; import cokr.xit.fims.cmmn.CrdnSttsHstry;
import cokr.xit.fims.cmmn.service.bean.CrdnPayerHstryBean; import cokr.xit.fims.cmmn.service.bean.CrdnPayerAddrHstryBean;
import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean; import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean;
import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.Team; import cokr.xit.fims.crdn.Team;
@ -46,8 +46,8 @@ public class CrdnBean extends AbstractBean {
@Resource(name = "crdnSttsHstryBean") @Resource(name = "crdnSttsHstryBean")
private CrdnSttsHstryBean crdnSttsHstryBean; private CrdnSttsHstryBean crdnSttsHstryBean;
@Resource(name = "crdnPayerHstryBean") @Resource(name = "crdnPayerAddrHstryBean")
private CrdnPayerHstryBean crdnPayerHstryBean; private CrdnPayerAddrHstryBean crdnPayerAddrHstryBean;
@Resource(name = "fileBean") @Resource(name = "fileBean")
private FileBean fileBean; private FileBean fileBean;
@ -168,7 +168,7 @@ public class CrdnBean extends AbstractBean {
crdnPayerAddrHstry.setAddrSn(crdn.getAddrSn()); crdnPayerAddrHstry.setAddrSn(crdn.getAddrSn());
// 단속 대장의 납부자ID 수정 및 단속 납부자 이력(TB_CRDN_PAYER_HSTRY) 대장에 등록한다. // 단속 대장의 납부자ID 수정 및 단속 납부자 이력(TB_CRDN_PAYER_HSTRY) 대장에 등록한다.
int effected = crdnPayerHstryBean.createCrdnPayerAddrHstry(crdnPayerAddrHstry); int effected = crdnPayerAddrHstryBean.createCrdnPayerAddrHstry(crdnPayerAddrHstry);
if(effected != 1) { if(effected != 1) {
throw new RuntimeException("단속자료 등록 중 단속 납부자주소 이력 등록에 실패하였습니다."); throw new RuntimeException("단속자료 등록 중 단속 납부자주소 이력 등록에 실패하였습니다.");
} }

@ -10,7 +10,7 @@ import org.springframework.stereotype.Component;
import cokr.xit.fims.cmmn.CrdnPayerAddrHstry; import cokr.xit.fims.cmmn.CrdnPayerAddrHstry;
import cokr.xit.fims.cmmn.CrdnSttsHstry; import cokr.xit.fims.cmmn.CrdnSttsHstry;
import cokr.xit.fims.cmmn.service.bean.CrdnPayerHstryBean; import cokr.xit.fims.cmmn.service.bean.CrdnPayerAddrHstryBean;
import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean; import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean;
import cokr.xit.fims.payer.Payer; import cokr.xit.fims.payer.Payer;
import cokr.xit.fims.payer.PayerQuery; import cokr.xit.fims.payer.PayerQuery;
@ -59,8 +59,8 @@ public class PayerBean extends AbstractBean {
private CrdnSttsHstryBean crdnSttsHstryBean; private CrdnSttsHstryBean crdnSttsHstryBean;
/** 단속 납부자 이력 정보 Bean */ /** 단속 납부자 이력 정보 Bean */
@Resource(name = "crdnPayerHstryBean") @Resource(name = "crdnPayerAddrHstryBean")
private CrdnPayerHstryBean crdnPayerHstryBean; private CrdnPayerAddrHstryBean crdnPayerAddrHstryBean;
/** . /** .
* @param req * @param req
@ -474,7 +474,7 @@ public class PayerBean extends AbstractBean {
// 단속 납부자 주소 이력(TB_CRDN_PAYER_ADDR_HSTRY) 대장에 등록한다. // 단속 납부자 주소 이력(TB_CRDN_PAYER_ADDR_HSTRY) 대장에 등록한다.
if (bInstHstry) { if (bInstHstry) {
rtnScs = crdnPayerHstryBean.createHstryUpdateCrdnPayerAddr(crdnPayerAddrHstry); rtnScs = crdnPayerAddrHstryBean.createHstryUpdateCrdnPayerAddr(crdnPayerAddrHstry);
if (!rtnScs) { if (!rtnScs) {
throw new RuntimeException("납부자 등록 실행중 단속 대장에 주소 일련번호 등록에 실패하였습니다."); // 예외를 발생시켜서 DB Rollback throw new RuntimeException("납부자 등록 실행중 단속 대장에 주소 일련번호 등록에 실패하였습니다."); // 예외를 발생시켜서 DB Rollback
} }

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cokr.xit.fims.cmmn.dao.CrdnPayerAddrHstryMapper">
<!-- 단속 납부자 이력 정보 매퍼
========== 변경 이력 ==========
2023-08-16 leebj 최초 작성
============================ -->
<resultMap id="crdnPayerAddrHstryRow" type="cokr.xit.fims.cmmn.CrdnPayerAddrHstry"> <!-- 단속 납부자 주소 이력 -->
<result property="addrHstryId" column="ADDR_HSTRY_ID" /> <!-- 주소 이력 ID -->
<result property="crdnId" column="CRDN_ID" /> <!-- 단속 ID -->
<result property="rtpyrId" column="RTPYR_ID" /> <!-- 납부자 ID -->
<result property="addrSn" column="ADDR_SN" /> <!-- 주소 일련번호 -->
<result property="createdAt" column="REG_DT" /> <!-- 등록 일시 -->
<result property="createdBy" column="RGTR" /> <!-- 등록자 -->
</resultMap>
<sql id="select">
SELECT CPAH.ADDR_HSTRY_ID <!-- 변경 이력 ID -->
, CPAH.CRDN_ID <!-- 단속 ID -->
, CPAH.RTPYR_ID <!-- 납부자 ID -->
, CPAH.ADDR_SN <!-- 주소 일련번호 -->
, CPAH.REG_DT <!-- 등록 일시 -->
, CPAH.RGTR <!-- 등록자 -->
, (SELECT USER_NM FROM TB_USER X WHERE X.USER_ID = CPAH.RGTR) AS RGTR_NM <!-- 등록자 명 -->
, P.RTPYR_NO <!-- 납부자 번호 -->
, P.RTPYR_NM <!-- 납부자 명 -->
, PA.ZIP <!-- 우편번호 -->
, PA.WHOL_ADDR <!-- 전체 주소 -->
, PA.ROAD_NM_CD <!-- 도로 명 코드 -->
, PA.STDG_CD <!-- 법정동 코드 -->
FROM TB_CRDN_PAYER_ADDR_HSTRY CPAH
INNER JOIN TB_PAYER P ON (CPAH.RTPYR_ID = P.RTPYR_ID)
INNER JOIN TB_PAYER_ADDR PA ON (CPAH.RTPYR_ID = PA.RTPYR_ID AND CPAH.ADDR_SN = PA.ADDR_SN)
</sql>
<select id="selectCrdnPayerHstryList" parameterType="map" resultType="dataobject">/* 단속 납부자 이력 목록 조회(crdnPayerAddrHstryMapper.selectCrdnPayerHstryList) */
<include refid="utility.paging-prefix" />
<include refid="select" />
<where>
</where>
<include refid="utility.orderBy" />
<include refid="utility.paging-suffix" />
</select>
<select id="selectCrdnPayerHstrys" parameterType="map" resultType="dataobject">/* 단속 납부자 이력 객체 가져오기(crdnPayerAddrHstryMapper.selectCrdnPayerHstrys) */
<include refid="select" />
<where>
<if test="crdnId != null">
AND CPAH.CRDN_ID = #{crdnId} <!-- 단속 ID -->
</if>
<if test="rtpyrId != null">
AND CPAH.RTPYR_ID = #{rtpyrId} <!-- 납부자 ID -->
<if test="addrSn != null">
AND CPAH.ADDR_SN = #{addrSn} <!-- 주소 일련번호 -->
</if>
</if>
</where>
<include refid="utility.orderBy" />
</select>
<insert id="insertCrdnPayerAddrHstry" parameterType="cokr.xit.fims.cmmn.CrdnPayerAddrHstry">/* 단속 납부자 주소 이력 등록(crdnPayerAddrHstryMapper.insertCrdnPayerAddrHstry) */
<selectKey resultType="string" keyProperty="addrHstryId" keyColumn="NEW_ID" order="BEFORE">
<include refid="numbering.keyByYear">
<property name="TABLE_NAME" value="TB_CRDN_PAYER_ADDR_HSTRY" />
<property name="TABLE_KEY" value="ADDR_HSTRY_ID" />
<property name="pad" value="20" />
</include>
</selectKey>
INSERT
INTO TB_CRDN_PAYER_ADDR_HSTRY (
ADDR_HSTRY_ID <!-- 주소 변경 이력 ID -->
, CRDN_ID <!-- 단속 ID -->
, RTPYR_ID <!-- 납부자 ID -->
, ADDR_SN <!-- 주소 일련번호 -->
, REG_DT <!-- 등록 일시 -->
, RGTR <!-- 등록자 -->
)
VALUES (
#{addrHstryId} <!-- 주소 변경 이력 ID -->
, #{crdnId} <!-- 단속 ID -->
, #{rtpyrId} <!-- 납부자 ID -->
, #{addrSn} <!-- 주소 일련번호 -->
, <include refid="utility.now" /> <!-- 등록 일시 -->
, #{createdBy} <!-- 등록자 -->
)
</insert>
<update id="updateCrdnPayerAddr" parameterType="cokr.xit.fims.cmmn.CrdnPayerAddrHstry">/* 단속 납부자 수정(crdnPayerAddrHstryMapper.updateCrdnPayerAddr) */
UPDATE TB_CRDN
SET RTPYR_ID = #{rtpyrId} <!-- 납부자 ID -->
, ADDR_SN = #{addrSn} <!-- 주소 일련번호 -->
, MDFCN_DT = <include refid="utility.now" /> <!-- 수정 일시 -->
, MDFR = #{modifiedBy} <!-- 수정자 -->
WHERE CRDN_ID = #{crdnId} <!-- 단속 ID -->
</update>
</mapper>

@ -1,129 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cokr.xit.fims.cmmn.dao.CrdnPayerHstryMapper">
<!-- 단속 납부자 이력 정보 매퍼
========== 변경 이력 ==========
2023-08-16 leebj 최초 작성
============================ -->
<resultMap id="crdnPayerHstryRow" type="cokr.xit.fims.cmmn.CrdnPayerHstry"> <!-- 단속 납부자 이력 -->
<result property="chgHstryId" column="CHG_HSTRY_ID" /><!-- 변경 이력 ID -->
<result property="crdnId" column="CRDN_ID" /> <!-- 단속 ID -->
<result property="rtpyrId" column="RTPYR_ID" /> <!-- 납부자 ID -->
<result property="addrSn" column="ADDR_SN" /> <!-- 주소 일련번호 -->
<result property="createdAt" column="REG_DT" /> <!-- 등록 일시 -->
<result property="createdBy" column="RGTR" /> <!-- 등록자 -->
</resultMap>
<sql id="select">
SELECT CPH.CHG_HSTRY_ID <!-- 변경 이력 ID -->
, CPH.CRDN_ID /* 단속 ID */
, CPH.RTPYR_ID /* 납부자 ID */
, CPH.REG_DT /* 등록 일시 */
, CPH.RGTR /* 등록자 */
, (SELECT USER_NM FROM TB_USER X WHERE X.USER_ID = CPH.RGTR) AS RGTR_NM /* 등록자 명 */
, PH.RTPYR_NO /* 납부자 번호 */
, PH.RTPYR_NM /* 납부자 명 */
, PH.ZIP /* 우편번호 */
, PH.WHOL_ADDR /* 전체 주소 */
, PH.REG_DT AS PH_REG_DT /* 등록 일시 */
, PH.RGTR AS PH_RGTR /* 등록자 */
, (SELECT USER_NM FROM TB_USER X WHERE X.USER_ID = PH.RGTR) AS PH_RGTR_NM /* 등록자 명 */
FROM TB_CRDN_PAYER_HSTRY CPH
INNER JOIN TB_PAYER_HSTRY PH ON (CPH.RTPYR_ID = PH.RTPYR_ID)
</sql>
<select id="selectCrdnPayerHstryList" parameterType="map" resultType="dataobject">/* 단속 납부자 이력 목록 조회(crdnPayerHstryMapper.selectCrdnPayerHstryList) */
<include refid="utility.paging-prefix" />
<include refid="select" />
<where>
</where>
<include refid="utility.orderBy" />
<include refid="utility.paging-suffix" />
</select>
<select id="selectCrdnPayerHstrys" parameterType="map" resultType="dataobject">/* 단속 납부자 이력 객체 가져오기(crdnPayerHstryMapper.selectCrdnPayerHstrys) */
<include refid="select" />
<where>
<if test="crdnId != null">
AND CPH.CRDN_ID = #{crdnId} /* 단속 ID */
</if>
<if test="rtpyrId != null">
AND CPH.RTPYR_ID = #{rtpyrId} /* 납부자 ID */
</if>
</where>
<include refid="utility.orderBy" />
</select>
<insert id="insertCrdnPayerHstry" parameterType="map">/* 단속 납부자 이력 등록(crdnPayerHstryMapper.insertCrdnPayerHstry) */
<selectKey resultType="string" keyProperty="crdnPayerHstry.chgHstryId" keyColumn="NEW_ID" order="BEFORE">
<include refid="numbering.keyByYear">
<property name="TABLE_NAME" value="TB_CRDN_PAYER_HSTRY" />
<property name="TABLE_KEY" value="CHG_HSTRY_ID" />
<property name="pad" value="20" />
</include>
</selectKey>
INSERT
INTO TB_CRDN_PAYER_HSTRY (
CHG_HSTRY_ID <!-- 변경 이력 ID -->
, CRDN_ID <!-- 단속 ID -->
, RTPYR_ID <!-- 납부자 ID -->
, REG_DT <!-- 등록 일시 -->
, RGTR <!-- 등록자 -->
)
VALUES (
#{crdnPayerHstry.chgHstryId} <!-- 변경 이력 ID -->
, #{crdnPayerHstry.crdnId} <!-- 단속 ID -->
, #{crdnPayerHstry.rtpyrId} <!-- 납부자 ID -->
, #{crdnPayerHstry.createdAt} <!-- 등록 일시 -->
, #{crdnPayerHstry.createdBy} <!-- 등록자 -->
)
</insert>
<update id="updateCrdnPayer" parameterType="map">/* 단속 납부자 수정(crdnPayerHstryMapper.updateCrdnPayer) */
UPDATE TB_CRDN
SET RTPYR_ID = #{rtpyrId} <!-- 납부자 ID -->
, ADDR_SN = #{addrSn} <!-- 주소 일련번호 -->
, MDFCN_DT = <include refid="utility.now" /> <!-- 수정 일시 -->
, MDFR = #{modifiedBy} <!-- 수정자 -->
WHERE CRDN_ID = #{crdnId} <!-- 단속 ID -->
</update>
<insert id="insertCrdnPayerAddrHstry" parameterType="cokr.xit.fims.cmmn.CrdnPayerAddrHstry">/* 단속 납부자 주소 이력 등록(crdnPayerHstryMapper.insertCrdnPayerAddrHstry) */
<selectKey resultType="string" keyProperty="addrHstryId" keyColumn="NEW_ID" order="BEFORE">
<include refid="numbering.keyByYear">
<property name="TABLE_NAME" value="TB_CRDN_PAYER_ADDR_HSTRY" />
<property name="TABLE_KEY" value="ADDR_HSTRY_ID" />
<property name="pad" value="20" />
</include>
</selectKey>
INSERT
INTO TB_CRDN_PAYER_ADDR_HSTRY (
ADDR_HSTRY_ID <!-- 주소 변경 이력 ID -->
, CRDN_ID <!-- 단속 ID -->
, RTPYR_ID <!-- 납부자 ID -->
, ADDR_SN <!-- 주소 일련번호 -->
, REG_DT <!-- 등록 일시 -->
, RGTR <!-- 등록자 -->
)
VALUES (
#{addrHstryId} <!-- 주소 변경 이력 ID -->
, #{crdnId} <!-- 단속 ID -->
, #{rtpyrId} <!-- 납부자 ID -->
, #{addrSn} <!-- 주소 일련번호 -->
, <include refid="utility.now" /> <!-- 등록 일시 -->
, #{createdBy} <!-- 등록자 -->
)
</insert>
<update id="updateCrdnPayerAddr" parameterType="cokr.xit.fims.cmmn.CrdnPayerAddrHstry">/* 단속 납부자 수정(crdnPayerHstryMapper.updateCrdnPayer) */
UPDATE TB_CRDN
SET RTPYR_ID = #{rtpyrId} <!-- 납부자 ID -->
, ADDR_SN = #{addrSn} <!-- 주소 일련번호 -->
, MDFCN_DT = <include refid="utility.now" /> <!-- 수정 일시 -->
, MDFR = #{modifiedBy} <!-- 수정자 -->
WHERE CRDN_ID = #{crdnId} <!-- 단속 ID -->
</update>
</mapper>

@ -268,11 +268,11 @@
</select> </select>
<sql id="selectPayerHstry"> <sql id="selectPayerHstry">
SELECT CPH.CHG_HSTRY_ID <!-- 변경 이력 ID --> SELECT CPAH.ADDR_HSTRY_ID <!-- 변경 이력 ID -->
, CPH.CRDN_ID <!-- 단속 ID --> , CPAH.CRDN_ID <!-- 단속 ID -->
, CPH.RTPYR_ID <!-- 납부자 ID --> , CPAH.RTPYR_ID <!-- 납부자 ID -->
, CPH.REG_DT <!-- 등록 일시 --> , CPAH.REG_DT <!-- 등록 일시 -->
, (SELECT USER_NM FROM TB_USER X WHERE X.USER_ID = CPH.RGTR) AS RGTR_NM <!-- 등록자 명 --> , (SELECT USER_NM FROM TB_USER X WHERE X.USER_ID = CPAH.RGTR) AS RGTR_NM <!-- 등록자 명 -->
, (GET_CODE_NM('FIM015', P.RTPYR_INPT_SE_CD)) AS RTPYR_INPT_SE_NM <!-- 납부자 입력 구분 명 --> , (GET_CODE_NM('FIM015', P.RTPYR_INPT_SE_CD)) AS RTPYR_INPT_SE_NM <!-- 납부자 입력 구분 명 -->
, (GET_CODE_NM('FIM011', P.RTPYR_SE_CD)) AS RTPYR_SE_NM <!-- 납부자 구분 명 --> , (GET_CODE_NM('FIM011', P.RTPYR_SE_CD)) AS RTPYR_SE_NM <!-- 납부자 구분 명 -->
, P.RTPYR_NO <!-- 납부자 번호 --> , P.RTPYR_NO <!-- 납부자 번호 -->
@ -282,8 +282,8 @@
, P.RTPYR_EML <!-- 납부자 이메일 --> , P.RTPYR_EML <!-- 납부자 이메일 -->
, P.RTPYR_BRDT <!-- 납부자 생년월일 --> , P.RTPYR_BRDT <!-- 납부자 생년월일 -->
, P.RTPYR_STTS_CD <!-- 납부자 상태 코드 --> , P.RTPYR_STTS_CD <!-- 납부자 상태 코드 -->
FROM TB_CRDN_PAYER_HSTRY CPH FROM TB_CRDN_PAYER_ADDR_HSTRY CPAH
INNER JOIN TB_PAYER P ON (CPH.RTPYR_ID = P.RTPYR_ID) INNER JOIN TB_PAYER P ON (CPAH.RTPYR_ID = P.RTPYR_ID)
</sql> </sql>
<select id="selectPayerHstrys" parameterType="map" resultType="dataobject">/* 납부자 이력 대장 객체 가져오기(payerMapper.selectPayerHstrys) */ <select id="selectPayerHstrys" parameterType="map" resultType="dataobject">/* 납부자 이력 대장 객체 가져오기(payerMapper.selectPayerHstrys) */

Loading…
Cancel
Save