쿼리 복원

main
이범준 2 months ago
parent 2d5ffa2337
commit 4340c5fb44

@ -1,20 +1,12 @@
package cokr.xit.cp.dao; package cokr.xit.cp.dao;
import java.util.List;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper; import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.cp.CleanParkingQuery;
import cokr.xit.foundation.component.AbstractMapper; import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject;
@Mapper("cleanParkingMapper") @Mapper("cleanParkingMapper")
public interface CleanParkingMapper extends AbstractMapper { public interface CleanParkingMapper extends AbstractMapper {
/**
* @param req
* @return
*/
List<DataObject> selectMainList(CleanParkingQuery req);
} }

@ -23,6 +23,12 @@ import cokr.xit.foundation.data.DataObject;
@Mapper("lsctMapper") @Mapper("lsctMapper")
public interface LsctMapper extends AbstractMapper { public interface LsctMapper extends AbstractMapper {
/**
* @param req
* @return
*/
List<DataObject> selectMainList(RentQuery req);
/** /**
* @param req * @param req
* @return * @return

@ -5,19 +5,13 @@ import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.egovframe.rte.fdl.string.EgovStringUtil;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import cokr.xit.base.crypto.bean.XitAria; import cokr.xit.base.crypto.bean.XitAria;
import cokr.xit.base.file.FileInfo; import cokr.xit.base.file.FileInfo;
import cokr.xit.base.file.service.bean.FileBean; 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.Crdn;
import cokr.xit.fims.crdn.dao.CrdnStngMapper;
import cokr.xit.fims.crdn.service.bean.CrdnBean; 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.Payer;
import cokr.xit.fims.payer.service.bean.PayerBean; import cokr.xit.fims.payer.service.bean.PayerBean;
import cokr.xit.fims.rent.Lsct; import cokr.xit.fims.rent.Lsct;
@ -55,15 +49,6 @@ public class LsctBean extends AbstractBean {
@Resource(name = "payerBean") @Resource(name = "payerBean")
private PayerBean payerBean; private PayerBean payerBean;
@Resource(name = "cleanParkingMapper")
private CleanParkingMapper cleanParkingMapper;
@Resource(name = "vltnMapper")
private VltnMapper vltnMapper;
@Resource(name = "crdnStngMapper")
private CrdnStngMapper crdnStngMapper;
/** . /** .
* TB_CRDN, TB_PAYER . * TB_CRDN, TB_PAYER .
* @param req * @param req
@ -89,39 +74,7 @@ public class LsctBean extends AbstractBean {
} }
// 연계 View 테이블 조회 // 연계 View 테이블 조회
CleanParkingQuery cpQuery = new CleanParkingQuery(); List<DataObject> mainList = lsctMapper.selectMainList(req);
cpQuery.setSggCd(req.getSggCd());
cpQuery.setTaskSeCd(req.getTaskSeCd());
cpQuery.setSchCrdnYmdFrom(req.getSchCrdnYmdFrom());
cpQuery.setSchCrdnYmdTo(req.getSchCrdnYmdTo());
cpQuery.setSchVhrno(req.getSchVhrno());
cpQuery.setOmJnos(req.getOmJnos());
cpQuery.setOmJno(req.getOmJno());
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) { if (mainList.size() > 0) {
for (int iLoop = 0; iLoop < mainList.size(); iLoop++) { for (int iLoop = 0; iLoop < mainList.size(); iLoop++) {
@ -318,40 +271,7 @@ public class LsctBean extends AbstractBean {
} }
// 연계 View 테이블 조회 // 연계 View 테이블 조회
CleanParkingQuery cpQuery = new CleanParkingQuery(); List<DataObject> mainList = lsctMapper.selectMainList(req);
cpQuery.setSggCd(req.getSggCd());
cpQuery.setTaskSeCd(req.getTaskSeCd());
cpQuery.setSchCrdnYmdFrom(req.getSchCrdnYmdFrom());
cpQuery.setSchCrdnYmdTo(req.getSchCrdnYmdTo());
cpQuery.setSchVhrno(req.getSchVhrno());
cpQuery.setOmJnos(req.getOmJnos());
cpQuery.setOmJno(req.getOmJno());
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) { if (mainList.size() > 0) {
for (int iLoop = 0; iLoop < mainList.size(); iLoop++) { for (int iLoop = 0; iLoop < mainList.size(); iLoop++) {

@ -2,104 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cokr.xit.cp.dao.CleanParkingMapper"> <mapper namespace="cokr.xit.cp.dao.CleanParkingMapper">
<select id="selectMainList" parameterType="map" resultType="dataobject">/* 연계뷰 단속 목록 조회(cleanParkingMapper.selectMainList) */
SELECT MM_CODE
, MM_SGGCODE
, MM_TASKGB
, MM_DLGB
, MM_INGB
, MM_DATE
, (CASE WHEN LENGTH(MM_TIME) = 4 THEN CONCAT(MM_TIME, '00') ELSE MM_TIME END) AS MM_TIME
, MM_LAWGB
, MM_SGNM
, MM_SGTEL
, MM_SGCONT
, MM_SGPOS
, MM_BDCODE
, MM_GPS_X
, MM_GPS_Y
, MM_TRAC
, MM_SNO
, MM_IMAGECNT
, MM_IMAGEGB
, MM_CARNO
, MM_VHMNO
, MM_CARGB
, MM_CARKIND
, MM_OMCODE
, MM_SDATE
, MM_EDATE
, MM_KEUM1
, MM_KEUM2
, MM_SUKEUM
, MM_MINUS_KEUM
, MM_ADD_KEUM
, MM_RECALL
, MM_INUSER
, MM_INDT
, MM_STATE
, MM_STATE_DT
, MM_CARCHECK
, MM_PRECODE
, MM_ETC
, MM_VIDEOFILENM
, MM_SAFEZONE
, MM_VIORCNT
, (CASE WHEN LENGTH(MM_TIME2) = 4 THEN CONCAT(MM_TIME2, '00') ELSE MM_TIME2 END) AS MM_TIME2
, MM_CARNAME
, MM_CARCOLOR
, MM_CARFUEL
, MM_TRANSMIT_SGG
, MM_TRANSMIT_TEAM
, OM_CODE
, OM_SGGCODE
, OM_NAME
, OM_NO1
, OM_JNO
, OM_NOGB
, OM_JUSO
, OM_BUNJI
, OM_ZIP
, OM_DORO_CODE
, OM_BLD_POSITION
, OM_BLD_NO1
, OM_BLD_NO2
, OM_BLD_ADMNO
, OM_INGB
, OM_INDT
, OM_BDCODE
, MC_LVY_KEY
, (CASE WHEN MC_LVY_KEY IS NOT NULL THEN 'Y' ELSE 'N' END) AS NIS_LINK_YN
FROM VW_CP_MAIN
<where>
<if test="schCrdnYmdFrom != null">
AND MM_DATE <![CDATA[>=]]> #{schCrdnYmdFrom} <!-- 단속 일자 시작 -->
</if>
<if test="schCrdnYmdTo != null">
AND MM_DATE <![CDATA[<=]]> #{schCrdnYmdTo} <!-- 단속 일자 종료 -->
</if>
<if test="schVhrno != null">
AND MM_CARNO = #{schVhrno} <!-- 차량번호 -->
</if>
<if test="omJnos != null">
AND OM_JNO IN ( <!-- 납부자 번호s -->
<foreach collection="omJnos" item="omJno" separator=","> #{omJno} </foreach>
)
</if>
<if test="omJno != null">
AND OM_JNO = #{omJno} <!-- 납부자 번호 -->
</if>
<if test="schEntNm != null">
AND OM_NAME = #{schEntNm} <!-- 납부자 명 -->
</if>
<if test="sggCd != null">
AND MM_SGGCODE = #{sggCd} <!-- 시군구 코드 -->
</if>
<if test="taskSeCd != null">
AND MM_TASKGB = #{taskSeCd} <!-- 업무 구분 코드 -->
</if>
</where>
<include refid="utility.orderBy" />
</select>
</mapper> </mapper>

@ -42,7 +42,111 @@
<result property="delRsn" column="DEL_RSN" /> <!-- 삭제 사유 --> <result property="delRsn" column="DEL_RSN" /> <!-- 삭제 사유 -->
</resultMap> </resultMap>
<select id="selectMainList" parameterType="map" resultType="dataobject">/* 연계뷰 단속 목록 조회(lsctMapper.selectMainList) */
SELECT MM_CODE
, MM_SGGCODE
, MM_TASKGB
, MM_DLGB
, MM_INGB
, 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
, MM_SNO
, MM_IMAGECNT
, MM_IMAGEGB
, MM_CARNO
, MM_VHMNO
, MM_CARGB
, MM_CARKIND
, MM_OMCODE
, MM_SDATE
, MM_EDATE
, MM_KEUM1
, MM_KEUM2
, MM_SUKEUM
, MM_MINUS_KEUM
, MM_ADD_KEUM
, MM_RECALL
, MM_INUSER
, MM_INDT
, MM_STATE
, MM_STATE_DT
, MM_CARCHECK
, MM_PRECODE
, MM_ETC
, MM_VIDEOFILENM
, MM_SAFEZONE
, MM_VIORCNT
, (CASE WHEN LENGTH(MM_TIME2) = 4 THEN CONCAT(MM_TIME2, '00') ELSE MM_TIME2 END) AS MM_TIME2
, MM_CARNAME
, MM_CARCOLOR
, MM_CARFUEL
, MM_TRANSMIT_SGG
, MM_TRANSMIT_TEAM
, OM_CODE
, OM_SGGCODE
, OM_NAME
, OM_NO1
, OM_JNO
, OM_NOGB
, OM_JUSO
, OM_BUNJI
, OM_ZIP
, OM_DORO_CODE
, OM_BLD_POSITION
, OM_BLD_NO1
, OM_BLD_NO2
, OM_BLD_ADMNO
, OM_INGB
, OM_INDT
, OM_BDCODE
, MC_LVY_KEY
, (CASE WHEN MC_LVY_KEY IS NOT NULL THEN 'Y' ELSE 'N' END) AS NIS_LINK_YN
FROM VW_CP_MAIN
<where>
<if test="schCrdnYmdFrom != null">
AND MM_DATE <![CDATA[>=]]> #{schCrdnYmdFrom} <!-- 단속 일자 시작 -->
</if>
<if test="schCrdnYmdTo != null">
AND MM_DATE <![CDATA[<=]]> #{schCrdnYmdTo} <!-- 단속 일자 종료 -->
</if>
<if test="schVhrno != null">
AND MM_CARNO = #{schVhrno} <!-- 차량번호 -->
</if>
<if test="omJnos != null">
AND OM_JNO IN ( <!-- 납부자 번호s -->
<foreach collection="omJnos" item="omJno" separator=","> #{omJno} </foreach>
)
</if>
<if test="omJno != null">
AND OM_JNO = #{omJno} <!-- 납부자 번호 -->
</if>
<if test="schEntNm != null">
AND OM_NAME = #{schEntNm} <!-- 납부자 명 -->
</if>
<if test="sggCd != null">
AND MM_SGGCODE = #{sggCd} <!-- 시군구 코드 -->
</if>
<if test="taskSeCd != null">
AND MM_TASKGB = #{taskSeCd} <!-- 업무 구분 코드 -->
</if>
</where>
<include refid="utility.orderBy" />
</select>
<select id="selectCrdnInfo" parameterType="string" resultType="dataobject">/* 단속 객체 가져오기(lsctMapper.selectCrdnInfo) */ <select id="selectCrdnInfo" parameterType="string" resultType="dataobject">/* 단속 객체 가져오기(lsctMapper.selectCrdnInfo) */
SELECT CRDN_ID <!-- 단속 ID --> SELECT CRDN_ID <!-- 단속 ID -->

Loading…
Cancel
Save