클린파킹 자료 조회 쿼리 이동

main
이범준 2 months ago
parent 9ab0eadd56
commit c6b9fa1342

@ -6,4 +6,59 @@ public class CleanParkingQuery extends CmmnQuery {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String schEntNm; // 기업 명
private String schVhrno; // 차량번호
private String schCrdnYmdFrom; // 단속 일자 시작
private String schCrdnYmdTo; // 단속 일자 종료
private String[] omJnos; // 소유주 번호s
private String omJno; // 소유주 번호
public String getSchEntNm() {
return ifEmpty(schEntNm, () -> null);
}
public void setSchEntNm(String schEntNm) {
this.schEntNm = schEntNm;
}
public String getSchVhrno() {
return ifEmpty(schVhrno, () -> null);
}
public void setSchVhrno(String schVhrno) {
this.schVhrno = schVhrno;
}
public String getSchCrdnYmdFrom() {
return ifEmpty(schCrdnYmdFrom, () -> null);
}
public void setSchCrdnYmdFrom(String schCrdnYmdFrom) {
this.schCrdnYmdFrom = schCrdnYmdFrom;
}
public String getSchCrdnYmdTo() {
return ifEmpty(schCrdnYmdTo, () -> null);
}
public void setSchCrdnYmdTo(String schCrdnYmdTo) {
this.schCrdnYmdTo = schCrdnYmdTo;
}
public String[] getOmJnos() {
return ifEmpty(omJnos, () -> null);
}
public void setOmJnos(String... omJnos) {
this.omJnos = omJnos;
}
public String getOmJno() {
return ifEmpty(omJno, () -> null);
}
public void setOmJno(String omJno) {
this.omJno = omJno;
}
} }

@ -11,6 +11,10 @@ import cokr.xit.foundation.data.DataObject;
@Mapper("cleanParkingMapper") @Mapper("cleanParkingMapper")
public interface CleanParkingMapper extends AbstractMapper { public interface CleanParkingMapper extends AbstractMapper {
List<DataObject> selectList(CleanParkingQuery query); /**
* @param req
* @return
*/
List<DataObject> selectMainList(CleanParkingQuery req);
} }

@ -4,11 +4,11 @@ import java.util.List;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper; import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.rent.Lsct; import cokr.xit.fims.rent.Lsct;
import cokr.xit.fims.rent.RentQuery; import cokr.xit.fims.rent.RentQuery;
import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject;
/** DAO /** DAO
* *
@ -23,12 +23,6 @@ import cokr.xit.fims.rent.RentQuery;
@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

@ -10,6 +10,8 @@ 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.service.bean.CrdnBean; import cokr.xit.fims.crdn.service.bean.CrdnBean;
import cokr.xit.fims.payer.Payer; import cokr.xit.fims.payer.Payer;
@ -49,6 +51,9 @@ public class LsctBean extends AbstractBean {
@Resource(name = "payerBean") @Resource(name = "payerBean")
private PayerBean payerBean; private PayerBean payerBean;
@Resource(name = "cleanParkingMapper")
private CleanParkingMapper cleanParkingMapper;
/** . /** .
* TB_CRDN, TB_PAYER . * TB_CRDN, TB_PAYER .
* @param req * @param req
@ -74,7 +79,16 @@ public class LsctBean extends AbstractBean {
} }
// 연계 View 테이블 조회 // 연계 View 테이블 조회
List<DataObject> mainList = lsctMapper.selectMainList(req); CleanParkingQuery cpQuery = new CleanParkingQuery();
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);
if (mainList.size() > 0) { if (mainList.size() > 0) {
for (int iLoop = 0; iLoop < mainList.size(); iLoop++) { for (int iLoop = 0; iLoop < mainList.size(); iLoop++) {
@ -271,7 +285,16 @@ public class LsctBean extends AbstractBean {
} }
// 연계 View 테이블 조회 // 연계 View 테이블 조회
List<DataObject> mainList = lsctMapper.selectMainList(req); CleanParkingQuery cpQuery = new CleanParkingQuery();
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);
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,96 +2,110 @@
<!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="selectList" parameterType="cokr.xit.cp.CleanParkingQuery" resultType="dataObject"> <select id="selectMainList" parameterType="map" resultType="dataobject">/* 연계뷰 단속 목록 조회(cleanParkingMapper.selectMainList) */
/* 클린파킹 단속자료 목록 조회(cleanParkingMapper.selectList) */ SELECT MM_CODE
<include refid="utility.paging-prefix"/> , MM_SGGCODE
SELECT 'ECA' AS MM_TASKGB , MM_TASKGB
, MAIN.MM_CODE AS MM_CODE , MM_DLGB
, MAIN.MM_SGGCODE AS MM_SGGCODE , MM_INGB
, MAIN.MM_DLGB AS MM_DLGB , MM_DATE
, MAIN.MM_INGB AS MM_INGB , (CASE WHEN LENGTH(MM_TIME) = 4 THEN CONCAT(MM_TIME, '00') ELSE MM_TIME END) AS MM_TIME
, MAIN.MM_DATE AS MM_DATE , MM_LAWGB
, MAIN.MM_TIME AS MM_TIME , (SELECT VLTN_ID FROM TB_VLTN X
, MAIN.MM_LAWGB AS MM_LAWGB WHERE X.VLTN_CD = LPAD(MM_LAWGB, 2, '0')
, MAIN.MM_SGNM AS MM_SGNM AND X.SGG_CD = MM_SGGCODE
, MAIN.MM_SGTEL AS MM_SGTEL AND X.TASK_SE_CD = MM_TASKGB) AS VLTN_ID
, MAIN.MM_SGCONT AS MM_SGCONT , MM_SGNM
, MAIN.MM_SGPOS AS MM_SGPOS , MM_SGTEL
, MAIN.MM_BDCODE AS MM_BDCODE , MM_SGCONT
, MAIN.MM_GPS_X AS MM_GPS_X , MM_SGPOS
, MAIN.MM_GPS_Y AS MM_GPS_Y , MM_BDCODE
, MAIN.MM_TRAC AS MM_TRAC , (SELECT TRIM(CONCAT(X.EMD_NM, ' ', X.LI_NM)) FROM TB_STDG X
, MAIN.MM_SNO AS MM_SNO WHERE X.STDG_CD = MM_BDCODE) AS CRDN_STDG_NM
, MAIN.MM_IMAGECNT AS MM_IMAGECNT , MM_GPS_X
, MAIN.MM_IMAGEGB AS MM_IMAGEGB , MM_GPS_Y
, MAIN.MM_CARNO AS MM_CARNO , MM_TRAC
, MAIN.MM_VHMNO AS MM_VHMNO , MM_SNO
, MAIN.MM_CARGB AS MM_CARGB , MM_IMAGECNT
, MAIN.MM_CARKIND AS MM_CARKIND , MM_IMAGEGB
, MAIN.MM_OMCODE AS MM_OMCODE , MM_CARNO
, MAIN.MM_SDATE AS MM_SDATE , MM_VHMNO
, MAIN.MM_EDATE AS MM_EDATE , MM_CARGB
, MAIN.MM_KEUM1 AS MM_KEUM1 , MM_CARKIND
, MAIN.MM_KEUM2 AS MM_KEUM2 , MM_OMCODE
, MAIN.MM_SUKEUM AS MM_SUKEUM , MM_SDATE
, MAIN.MM_MINUS_KEUM AS MM_MINUS_KEUM , MM_EDATE
, MAIN.MM_ADD_KEUM AS MM_ADD_KEUM , MM_KEUM1
, MAIN.MM_RECALL AS MM_RECALL , MM_KEUM2
, MAIN.MM_INUSER AS MM_INUSER , MM_SUKEUM
, MAIN.MM_INDT AS MM_INDT , MM_MINUS_KEUM
, MAIN.MM_STATE AS MM_STATE , MM_ADD_KEUM
, MAIN.MM_STATE_DT AS MM_STATE_DT , MM_RECALL
, MAIN.MM_CARCHECK AS MM_CARCHECK , MM_INUSER
, MAIN.MM_PRECODE AS MM_PRECODE , MM_INDT
, MAIN.MM_ETC AS MM_ETC , MM_STATE
, MAIN.MM_VIDEOFILENM AS MM_VIDEOFILENM , MM_STATE_DT
, MAIN.MM_SAFEZONE AS MM_SAFEZONE , MM_CARCHECK
, MAIN.MM_VIORCNT AS MM_VIORCNT , MM_PRECODE
, MAIN.MM_TIME2 AS MM_TIME2 , MM_ETC
, MAIN.MM_CARNAME AS MM_CARNAME , MM_VIDEOFILENM
, MAIN.MM_CARCOLOR AS MM_CARCOLOR , MM_SAFEZONE
, MAIN.MM_CARFUEL AS MM_CARFUEL , MM_VIORCNT
, MAIN.MM_TRANSMIT_SGG AS MM_TRANSMIT_SGG , (CASE WHEN LENGTH(MM_TIME2) = 4 THEN CONCAT(MM_TIME2, '00') ELSE MM_TIME2 END) AS MM_TIME2
, MAIN.MM_TRANSMIT_TEAM AS MM_TRANSMIT_TEAM , MM_CARNAME
, OWNE.OM_CODE AS OM_CODE , MM_CARCOLOR
, OWNE.OM_SGGCODE AS OM_SGGCODE , MM_CARFUEL
, OWNE.OM_NAME AS OM_NAME , MM_TRANSMIT_SGG
, OWNE.OM_NO1 AS OM_NO1 , MM_TRANSMIT_TEAM
, OWNE.OM_JNO AS OM_JNO , OM_CODE
, OWNE.OM_NOGB AS OM_NOGB , OM_SGGCODE
, OWNE.OM_JUSO AS OM_JUSO , OM_NAME
, OWNE.OM_BUNJI AS OM_BUNJI , OM_NO1
, OWNE.OM_ZIP AS OM_ZIP , OM_JNO
, OWNE.OM_DORO_CODE AS OM_DORO_CODE , OM_NOGB
, OWNE.OM_BLD_POSITION AS OM_BLD_POSITION , OM_JUSO
, OWNE.OM_BLD_NO1 AS OM_BLD_NO1 , OM_BUNJI
, OWNE.OM_BLD_NO2 AS OM_BLD_NO2 , OM_ZIP
, OWNE.OM_BLD_ADMNO AS OM_BLD_ADMNO , OM_DORO_CODE
, OWNE.OM_INGB AS OM_INGB , OM_BLD_POSITION
, OWNE.OM_INDT AS OM_INDT , OM_BLD_NO1
, OWNE.OM_BDCODE AS OM_BDCODE , OM_BLD_NO2
, MATC.MC_CODE AS MC_CODE , OM_BLD_ADMNO
, MATC.MC_LVY_KEY AS MC_LVY_KEY , OM_INGB
, MATC.MC_ACC_YEAR AS MC_ACC_YEAR , OM_INDT
, MATC.MC_LVY_NO AS MC_LVY_NO , OM_BDCODE
FROM ( , MC_LVY_KEY
( , (CASE WHEN MC_LVY_KEY IS NOT NULL THEN 'Y' ELSE 'N' END) AS NIS_LINK_YN
cp_main_pt_eca MAIN FROM VW_CP_MAIN
JOIN cp_owner_pt_eca OWNE ON (MAIN.MM_OMCODE = OWNE.OM_CODE) <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>
) )
LEFT JOIN ( </if>
SELECT cp_match_pt_eca.MC_CODE AS MC_CODE <if test="omJno != null">
, cp_match_pt_eca.MC_MMCODE AS MC_MMCODE AND OM_JNO = #{omJno} <!-- 납부자 번호 -->
, cp_match_pt_eca.MC_LVY_KEY AS MC_LVY_KEY </if>
, cp_match_pt_eca.MC_ACC_YEAR AS MC_ACC_YEAR <if test="schEntNm != null">
, cp_match_pt_eca.MC_LVY_NO AS MC_LVY_NO AND OM_NAME = #{schEntNm} <!-- 납부자 명 -->
, ROW_NUMBER() OVER (PARTITION BY cp_match_pt_eca.MC_MMCODE ORDER BY cp_match_pt_eca.MC_INDT DESC) AS RN </if>
FROM cp_match_pt_eca <if test="sggCd != null">
) MATC ON (MATC.MC_MMCODE = MAIN.MM_CODE AND MATC.RN = 1) AND MM_SGGCODE = #{sggCd} <!-- 시군구 코드 -->
) </if>
WHERE 1=1 <if test="taskSeCd != null">
<include refid="utility.sortBy" /> AND MM_TASKGB = #{taskSeCd} <!-- 업무 구분 코드 -->
<include refid="utility.paging-suffix"/> </if>
</select> </where>
<include refid="utility.orderBy" />
</select>
</mapper> </mapper>

@ -42,111 +42,7 @@
<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