납부자 등록 시 우편번호, 건물관리번호 설정

main
mjkhan21 1 year ago
parent 15091e3d7f
commit 368de1f0bd

@ -104,4 +104,15 @@ public interface PayerMapper extends AbstractMapper {
default int delete(String... rtpyrIds) { default int delete(String... rtpyrIds) {
return !isEmpty(rtpyrIds) ? deletePayer(params().set("rtpyrIds", rtpyrIds)) : 0; return !isEmpty(rtpyrIds) ? deletePayer(params().set("rtpyrIds", rtpyrIds)) : 0;
} }
/** , .
* @param params
* <ul><li>roadNmCd - </li>
* <li>udgdSeCd - </li>
* <li>bmno - </li>
* <li>bsno - </li>
* </ul>
* @return ,
*/
DataObject selectAddrInfo(Map<String, Object> params);
} }

@ -65,6 +65,17 @@ public class PayerBean extends AbstractComponent {
* </ul> * </ul>
*/ */
public boolean create(Payer payer) { public boolean create(Payer payer) {
DataObject params = new DataObject()
.set("roadNmCd", payer.getRoadNmCd())
.set("udgdSeCd", payer.getUdgdSeCd())
.set("bmno", payer.getBmno())
.set("bsno", payer.getBsno());
DataObject info = payerMapper.selectAddrInfo(params);
if (info != null) {
payer.setAddrSeCd("02");
payer.setZip(info.string("ZIP"));
payer.setBldgMngNo(info.string("BLDG_MNG_NO"));
}
return payerMapper.insert(payer); return payerMapper.insert(payer);
} }

@ -291,6 +291,15 @@ UPDATE TB_PAYER SET
, MDFR = #{modifiedBy} <!-- 수정자 --> , MDFR = #{modifiedBy} <!-- 수정자 -->
WHERE RTPYR_ID = #{rtpyrId}</update> WHERE RTPYR_ID = #{rtpyrId}</update>
<select id="selectAddrInfo" parameterType="map" resultType="dataobject">/* 우편번호, 건물관리번호 조회(payerMapper.selectAddrInfo) */
SELECT ZIP, BLDG_MNG_NO
FROM TB_ROAD_ADDR
WHERE ROAD_NM_CD = #{roadNmCd}
AND UDGD_SE_CD = #{udgdSeCd}
AND BMNO = #{bmno}
AND BSNO = #{bsno}
</select>
<update id="deletePayer" parameterType="map">/* 납부자 대장 삭제(payerMapper.deletePayer) */ <update id="deletePayer" parameterType="map">/* 납부자 대장 삭제(payerMapper.deletePayer) */
UPDATE TB_PAYER UPDATE TB_PAYER
SET USE_YN = 'N' SET USE_YN = 'N'

Loading…
Cancel
Save