쿼리 수정

main
이범준 2 months ago
parent c6b9fa1342
commit 2d5ffa2337

@ -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<DataObject> 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<DataObject> 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<DataObject> 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<DataObject> 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자리로 변경

@ -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

Loading…
Cancel
Save