diff --git a/src/main/java/cokr/xit/fims/rent/service/bean/LsctBean.java b/src/main/java/cokr/xit/fims/rent/service/bean/LsctBean.java index 6ef7c570..7228fb6f 100644 --- a/src/main/java/cokr/xit/fims/rent/service/bean/LsctBean.java +++ b/src/main/java/cokr/xit/fims/rent/service/bean/LsctBean.java @@ -5,6 +5,7 @@ import java.util.List; import javax.annotation.Resource; +import org.egovframe.rte.fdl.string.EgovStringUtil; import org.springframework.stereotype.Component; import cokr.xit.base.crypto.bean.XitAria; @@ -13,7 +14,10 @@ import cokr.xit.base.file.service.bean.FileBean; import cokr.xit.cp.CleanParkingQuery; import cokr.xit.cp.dao.CleanParkingMapper; import cokr.xit.fims.crdn.Crdn; +import cokr.xit.fims.crdn.dao.CrdnStngMapper; import cokr.xit.fims.crdn.service.bean.CrdnBean; +import cokr.xit.fims.mngt.VltnQuery; +import cokr.xit.fims.mngt.dao.VltnMapper; import cokr.xit.fims.payer.Payer; import cokr.xit.fims.payer.service.bean.PayerBean; import cokr.xit.fims.rent.Lsct; @@ -54,6 +58,12 @@ public class LsctBean extends AbstractBean { @Resource(name = "cleanParkingMapper") private CleanParkingMapper cleanParkingMapper; + @Resource(name = "vltnMapper") + private VltnMapper vltnMapper; + + @Resource(name = "crdnStngMapper") + private CrdnStngMapper crdnStngMapper; + /**지정한 조건에 따라 단속 대장 목록을 조회하여 반환한다. * 통합플랫폼으로 사용하지 안을 경우 렌트 소스만 사용하기 위해서 TB_CRDN, TB_PAYER에 직접 등록한다. * @param req 임대차계약 대장 조회 조건 @@ -90,6 +100,29 @@ public class LsctBean extends AbstractBean { cpQuery.setSchEntNm(req.getSchEntNm()); List mainList = cleanParkingMapper.selectMainList(cpQuery); + for(DataObject main : mainList) { + VltnQuery vQuery = new VltnQuery() + .setVltnCd(EgovStringUtil.lPad(main.string("MM_LAWGB"), 2, '0')) + .setSggCd(main.string("MM_SGGCODE")) + .setTaskSeCd(main.string("MM_TASKGB")); + List list = vltnMapper.selectVltns(vQuery); + if(list != null && !list.isEmpty()) { + main.set("VLTN_ID", list.get(0).get("VLTN_ID")); + } else { + main.set("VLTN_ID", ""); + } + } + + for(DataObject main : mainList) { + String stdgNm = crdnStngMapper.selectStdgNm(main.string("MM_BDCODE")); + + if(stdgNm != null) { + main.set("CRDN_STDG_NM", stdgNm); + } else { + main.set("CRDN_STDG_NM", ""); + } + } + if (mainList.size() > 0) { for (int iLoop = 0; iLoop < mainList.size(); iLoop++) { // 통합플랫폼 ID에 맞게 20자리로 변경 @@ -296,6 +329,30 @@ public class LsctBean extends AbstractBean { cpQuery.setSchEntNm(req.getSchEntNm()); List mainList = cleanParkingMapper.selectMainList(cpQuery); + for(DataObject main : mainList) { + VltnQuery vQuery = new VltnQuery() + .setVltnCd(EgovStringUtil.lPad(main.string("MM_LAWGB"), 2, '0')) + .setSggCd(main.string("MM_SGGCODE")) + .setTaskSeCd(main.string("MM_TASKGB")); + List list = vltnMapper.selectVltns(vQuery); + if(list != null && !list.isEmpty()) { + main.set("VLTN_ID", list.get(0).get("VLTN_ID")); + } else { + main.set("VLTN_ID", ""); + } + } + + for(DataObject main : mainList) { + String stdgNm = crdnStngMapper.selectStdgNm(main.string("MM_BDCODE")); + + if(stdgNm != null) { + main.set("CRDN_STDG_NM", stdgNm); + } else { + main.set("CRDN_STDG_NM", ""); + } + } + + if (mainList.size() > 0) { for (int iLoop = 0; iLoop < mainList.size(); iLoop++) { // 통합플랫폼 ID에 맞게 20자리로 변경 diff --git a/src/main/resources/sql/mapper/cp/cleanParking-mapper.xml b/src/main/resources/sql/mapper/cp/cleanParking-mapper.xml index f391b3f6..8dd0ea1d 100644 --- a/src/main/resources/sql/mapper/cp/cleanParking-mapper.xml +++ b/src/main/resources/sql/mapper/cp/cleanParking-mapper.xml @@ -11,17 +11,11 @@ , MM_DATE , (CASE WHEN LENGTH(MM_TIME) = 4 THEN CONCAT(MM_TIME, '00') ELSE MM_TIME END) AS MM_TIME , MM_LAWGB - , (SELECT VLTN_ID FROM TB_VLTN X - WHERE X.VLTN_CD = LPAD(MM_LAWGB, 2, '0') - AND X.SGG_CD = MM_SGGCODE - AND X.TASK_SE_CD = MM_TASKGB) AS VLTN_ID , MM_SGNM , MM_SGTEL , MM_SGCONT , MM_SGPOS , MM_BDCODE - , (SELECT TRIM(CONCAT(X.EMD_NM, ' ', X.LI_NM)) FROM TB_STDG X - WHERE X.STDG_CD = MM_BDCODE) AS CRDN_STDG_NM , MM_GPS_X , MM_GPS_Y , MM_TRAC