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

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

@ -6,4 +6,59 @@ public class CleanParkingQuery extends CmmnQuery {
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")
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 cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.rent.Lsct;
import cokr.xit.fims.rent.RentQuery;
import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject;
/** DAO
*
@ -23,12 +23,6 @@ import cokr.xit.fims.rent.RentQuery;
@Mapper("lsctMapper")
public interface LsctMapper extends AbstractMapper {
/**
* @param req
* @return
*/
List<DataObject> selectMainList(RentQuery req);
/**
* @param req
* @return

@ -10,6 +10,8 @@ import org.springframework.stereotype.Component;
import cokr.xit.base.crypto.bean.XitAria;
import cokr.xit.base.file.FileInfo;
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.service.bean.CrdnBean;
import cokr.xit.fims.payer.Payer;
@ -49,6 +51,9 @@ public class LsctBean extends AbstractBean {
@Resource(name = "payerBean")
private PayerBean payerBean;
@Resource(name = "cleanParkingMapper")
private CleanParkingMapper cleanParkingMapper;
/** .
* TB_CRDN, TB_PAYER .
* @param req
@ -74,7 +79,16 @@ public class LsctBean extends AbstractBean {
}
// 연계 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) {
for (int iLoop = 0; iLoop < mainList.size(); iLoop++) {
@ -271,7 +285,16 @@ public class LsctBean extends AbstractBean {
}
// 연계 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) {
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">
<mapper namespace="cokr.xit.cp.dao.CleanParkingMapper">
<select id="selectList" parameterType="cokr.xit.cp.CleanParkingQuery" resultType="dataObject">
/* 클린파킹 단속자료 목록 조회(cleanParkingMapper.selectList) */
<include refid="utility.paging-prefix"/>
SELECT 'ECA' AS MM_TASKGB
, MAIN.MM_CODE AS MM_CODE
, MAIN.MM_SGGCODE AS MM_SGGCODE
, MAIN.MM_DLGB AS MM_DLGB
, MAIN.MM_INGB AS MM_INGB
, MAIN.MM_DATE AS MM_DATE
, MAIN.MM_TIME AS MM_TIME
, MAIN.MM_LAWGB AS MM_LAWGB
, MAIN.MM_SGNM AS MM_SGNM
, MAIN.MM_SGTEL AS MM_SGTEL
, MAIN.MM_SGCONT AS MM_SGCONT
, MAIN.MM_SGPOS AS MM_SGPOS
, MAIN.MM_BDCODE AS MM_BDCODE
, MAIN.MM_GPS_X AS MM_GPS_X
, MAIN.MM_GPS_Y AS MM_GPS_Y
, MAIN.MM_TRAC AS MM_TRAC
, MAIN.MM_SNO AS MM_SNO
, MAIN.MM_IMAGECNT AS MM_IMAGECNT
, MAIN.MM_IMAGEGB AS MM_IMAGEGB
, MAIN.MM_CARNO AS MM_CARNO
, MAIN.MM_VHMNO AS MM_VHMNO
, MAIN.MM_CARGB AS MM_CARGB
, MAIN.MM_CARKIND AS MM_CARKIND
, MAIN.MM_OMCODE AS MM_OMCODE
, MAIN.MM_SDATE AS MM_SDATE
, MAIN.MM_EDATE AS MM_EDATE
, MAIN.MM_KEUM1 AS MM_KEUM1
, MAIN.MM_KEUM2 AS MM_KEUM2
, MAIN.MM_SUKEUM AS MM_SUKEUM
, MAIN.MM_MINUS_KEUM AS MM_MINUS_KEUM
, MAIN.MM_ADD_KEUM AS MM_ADD_KEUM
, MAIN.MM_RECALL AS MM_RECALL
, MAIN.MM_INUSER AS MM_INUSER
, MAIN.MM_INDT AS MM_INDT
, MAIN.MM_STATE AS MM_STATE
, MAIN.MM_STATE_DT AS MM_STATE_DT
, MAIN.MM_CARCHECK AS MM_CARCHECK
, MAIN.MM_PRECODE AS MM_PRECODE
, MAIN.MM_ETC AS MM_ETC
, MAIN.MM_VIDEOFILENM AS MM_VIDEOFILENM
, MAIN.MM_SAFEZONE AS MM_SAFEZONE
, MAIN.MM_VIORCNT AS MM_VIORCNT
, MAIN.MM_TIME2 AS MM_TIME2
, MAIN.MM_CARNAME AS MM_CARNAME
, MAIN.MM_CARCOLOR AS MM_CARCOLOR
, MAIN.MM_CARFUEL AS MM_CARFUEL
, MAIN.MM_TRANSMIT_SGG AS MM_TRANSMIT_SGG
, MAIN.MM_TRANSMIT_TEAM AS MM_TRANSMIT_TEAM
, OWNE.OM_CODE AS OM_CODE
, OWNE.OM_SGGCODE AS OM_SGGCODE
, OWNE.OM_NAME AS OM_NAME
, OWNE.OM_NO1 AS OM_NO1
, OWNE.OM_JNO AS OM_JNO
, OWNE.OM_NOGB AS OM_NOGB
, OWNE.OM_JUSO AS OM_JUSO
, OWNE.OM_BUNJI AS OM_BUNJI
, OWNE.OM_ZIP AS OM_ZIP
, OWNE.OM_DORO_CODE AS OM_DORO_CODE
, OWNE.OM_BLD_POSITION AS OM_BLD_POSITION
, OWNE.OM_BLD_NO1 AS OM_BLD_NO1
, OWNE.OM_BLD_NO2 AS OM_BLD_NO2
, OWNE.OM_BLD_ADMNO AS OM_BLD_ADMNO
, OWNE.OM_INGB AS OM_INGB
, OWNE.OM_INDT AS OM_INDT
, OWNE.OM_BDCODE AS OM_BDCODE
, MATC.MC_CODE AS MC_CODE
, MATC.MC_LVY_KEY AS MC_LVY_KEY
, MATC.MC_ACC_YEAR AS MC_ACC_YEAR
, MATC.MC_LVY_NO AS MC_LVY_NO
FROM (
(
cp_main_pt_eca MAIN
JOIN cp_owner_pt_eca OWNE ON (MAIN.MM_OMCODE = OWNE.OM_CODE)
<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
, (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>
)
LEFT JOIN (
SELECT cp_match_pt_eca.MC_CODE AS MC_CODE
, cp_match_pt_eca.MC_MMCODE AS MC_MMCODE
, cp_match_pt_eca.MC_LVY_KEY AS MC_LVY_KEY
, cp_match_pt_eca.MC_ACC_YEAR AS MC_ACC_YEAR
, cp_match_pt_eca.MC_LVY_NO AS MC_LVY_NO
, ROW_NUMBER() OVER (PARTITION BY cp_match_pt_eca.MC_MMCODE ORDER BY cp_match_pt_eca.MC_INDT DESC) AS RN
FROM cp_match_pt_eca
) MATC ON (MATC.MC_MMCODE = MAIN.MM_CODE AND MATC.RN = 1)
)
WHERE 1=1
<include refid="utility.sortBy" />
<include refid="utility.paging-suffix"/>
</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>

@ -42,111 +42,7 @@
<result property="delRsn" column="DEL_RSN" /> <!-- 삭제 사유 -->
</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 CRDN_ID <!-- 단속 ID -->

Loading…
Cancel
Save