You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2672 lines
112 KiB
XML
2672 lines
112 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="cfs.fine.dao.FinePmDao">
|
|
<!-- 부과고지 및 납부실적 조회 [FN53] -->
|
|
<resultMap id="findFinePmList-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="year" column="YEAR" />
|
|
<result property="mon" column="MONTH" />
|
|
<result property="division" column="MOTION_ID2" />
|
|
<result property="notifiCnt" column="GOJI_CNT" />
|
|
<result property="notifiPri" column="GOJI_AMT" />
|
|
<result property="paymentCnt" column="NABU_CNT" />
|
|
<result property="paymentPri" column="NABU_AMT" />
|
|
<result property="paymentRate" column="R" />
|
|
<result property="name" column="name" />
|
|
<result property="nonpayCnt" column="NonpayCnt" />
|
|
<result property="nonpayPri" column="NonpayPri" />
|
|
<result property="cancelCnt" column="GAM_CNT" />
|
|
<result property="cancelPri" column="GAM_AMT" />
|
|
<result property="defectCnt" column="DOB_CNT" />
|
|
<result property="defectPri" column="DOB_AMT" />
|
|
</resultMap>
|
|
|
|
<!-- 비부과 대상차량 현황[FN54] -->
|
|
<resultMap id="findFineNonLevyList-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="carNum" column="car_no" />
|
|
<result property="carKind" column="car_type_name" />
|
|
<result property="passDate" column="PADT" />
|
|
<result property="fareOfficeInfo" column="fare_office_full_name" />
|
|
<result property="carRow" column="booth_full_name" />
|
|
<result property="remarks" column="exempt_reason_full_name" />
|
|
<result property="remarksCou" column="remarks" />
|
|
<result property="nonCheck" column="NOTCONFIRM_FULL_NAME" />
|
|
</resultMap>
|
|
<!-- 비부과 대상차량 현황 카운트[FN54] -->
|
|
<resultMap id="findFineNonLevyListCnt-resultMap" type="java.util.Map">
|
|
<result property="servi" column="CODE_O1" />
|
|
<result property="unread" column="CODE_O2" />
|
|
<result property="side" column="CODE_O3" />
|
|
<result property="theft" column="CODE_O4" />
|
|
<result property="free" column="CODE_O5" />
|
|
<result property="thr" column="CODE_O6" />
|
|
<result property="non" column="CODE_O7" />
|
|
<result property="dispari" column="CODE_O8" />
|
|
<result property="emer" column="CODE_O9" />
|
|
<result property="freight" column="CODE_10" />
|
|
<result property="obsta" column="CODE_11" />
|
|
<result property="eve" column="CODE_12" />
|
|
<result property="other" column="CODE_13" />
|
|
<result property="total" column="CODE_14" />
|
|
<result property="low" column="CODE_15" />
|
|
</resultMap>
|
|
|
|
<!-- 비부과 대상차량 현황 카운트[FN56] -->
|
|
<resultMap id="findFineNonTificList-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="conNum" column="CONNUM" />
|
|
<result property="carNum" column="CARNUM" />
|
|
<result property="fareOfficeInfo" column="FARE_OFFICE_ID" />
|
|
<result property="carRow" column="BOOTH_ID" />
|
|
<result property="passDate" column="PADT" />
|
|
<result property="yearMon" column="GROUP_Date" />
|
|
<result property="passTime" column="PATI" />
|
|
<result property="collector" column="NAME" />
|
|
<result property="penalty" column="PENALTY" />
|
|
<result property="notifiCanDate" column="NOTICANDT" />
|
|
<result property="noticeWrongReason" column="NOTICE_WRONG_REASON" />
|
|
</resultMap>
|
|
|
|
<!-- 혼잡통행료 과태료 고지 수납 현황[FN57] -->
|
|
<resultMap id="findFineConfuList-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="sendDate" column="receipt_date" />
|
|
<result property="notifiAgoOne" column="motion12" />
|
|
<result property="notifiOneOne" column="motion13" />
|
|
<result property="notifiTwoOne" column="motion14" />
|
|
<result property="notifiThrOne" column="motion17" />
|
|
<result property="notifiDouOne" column="double_cnt1" />
|
|
<result property="notifiAgoThr" column="motion32" />
|
|
<result property="notifiOneThr" column="motion33" />
|
|
<result property="notifiTwoThr" column="motion34" />
|
|
<result property="notifiThrThr" column="motion37" />
|
|
<result property="notifiDouThr" column="double_cnt3" />
|
|
<result property="passYear1" column="motion_7" />
|
|
<result property="passYear2" column="motion_6" />
|
|
<result property="passYear3" column="motion_5" />
|
|
<result property="passYear4" column="motion_4" />
|
|
<result property="passYear5" column="motion_3" />
|
|
<result property="passYear6" column="motion_2" />
|
|
<result property="passYear7" column="motion_1" />
|
|
<result property="passYear8" column="motion_0" />
|
|
<result property="totalOne" column="sub1" />
|
|
<result property="totalThr" column="sub3" />
|
|
<result property="agoTotal" column="Tot12" />
|
|
<result property="oneTotal" column="Tot13" />
|
|
<result property="twoTotal" column="Tot14" />
|
|
<result property="thrToral" column="Tot17" />
|
|
<result property="douTotal" column="Tot_double" />
|
|
<result property="total" column="TOTAL" />
|
|
<result property="yearToral" column="Year_Total" />
|
|
</resultMap>
|
|
|
|
<!-- 고지년월별 과태료 [FN58] -->
|
|
<resultMap id="findFinePenaltyCnt-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="notifiDate" column="S_DATE" />
|
|
<result property="notifiCnt" column="N_CNT" />
|
|
</resultMap>
|
|
|
|
<!-- 고지년월별 과태료 상세[FN58] -->
|
|
<resultMap id="findFinePenaltyDtl-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="notifi" column="MOTION_ID" />
|
|
<result property="motionNm" column="MOTION_NM" />
|
|
<result property="sendDate" column="S_DATE" />
|
|
<result property="notifiCnt" column="N_CNT" />
|
|
</resultMap>
|
|
|
|
<!-- 고지년월별 과태료 상세-List[FN58] -->
|
|
<resultMap id="findFinePenaltyDtlList-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="carNum" column="CAR_NO" />
|
|
<result property="sendDate" column="S_DATE" />
|
|
<result property="notifi" column="MOTION_ID" />
|
|
<result property="fareOfficeInfo" column="FARE_OFFICE_ID" />
|
|
<result property="carRow" column="BOOTH_ID" />
|
|
<result property="collector" column="OWNER" />
|
|
<result property="passDate" column="PASS_DATE" />
|
|
<result property="penalty" column="LAVY_AMOUNT" />
|
|
<result property="address" column="ADDR" />
|
|
</resultMap>
|
|
|
|
<!-- 혼잡통행료 과테료 미납현황[FN59] -->
|
|
<resultMap id="findFineNonPayCon-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="year" column="year" />
|
|
<result property="mon" column="month" />
|
|
<result property="notifiCnt" column="a_cnt" />
|
|
<result property="notifiPri" column="a_amt" />
|
|
<result property="agoCnt" column="a_ago_cnt" />
|
|
<result property="agoAmt" column="a_ago_amt" />
|
|
<result property="cancelCnt" column="r_cnt" />
|
|
<result property="cancelPri" column="r_amt" />
|
|
<result property="cancelAgoCnt" column="r_ago_cnt" />
|
|
<result property="cancelAgoPri" column="r_ago_amt" />
|
|
<result property="paymentCnt" column="y_cnt" />
|
|
<result property="paymentPri" column="y_amt" />
|
|
<result property="paymentAgoCnt" column="y_ago_cnt" />
|
|
<result property="paymentAgoPri" column="y_ago_amt" />
|
|
<result property="defectCnt" column="d_cnt" />
|
|
<result property="defectPri" column="d_amt" />
|
|
<result property="nonpayCnt" column="n_cnt" />
|
|
<result property="nonpayPri" column="n_amt" />
|
|
</resultMap>
|
|
|
|
<!-- 과태료 수입금 명세 내역 년도 조회[FN60] -->
|
|
<resultMap id="findFineAdList-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="paymentDate" column="day" />
|
|
<result property="penalCnt1" column="cnt1" />
|
|
<result property="penalCnt2" column="cnt2" />
|
|
<result property="penalCnt3" column="cnt3" />
|
|
<result property="penalCnt4" column="cnt4" />
|
|
<result property="penalCnt5" column="cnt5" />
|
|
<result property="penalCnt6" column="cnt6" />
|
|
<result property="penalCnt7" column="cnt7" />
|
|
<result property="penalCnt8" column="cnt8" />
|
|
<result property="penalCnt9" column="cnt9" />
|
|
<result property="penalCnt10" column="cnt10" />
|
|
<result property="penalCnt11" column="cnt11" />
|
|
<result property="penalCnt12" column="cnt12" />
|
|
<result property="penalCnt13" column="cnt13" />
|
|
<result property="penalCnt14" column="cnt14" />
|
|
<result property="penalCnt15" column="cnt15" />
|
|
<result property="penalCnt16" column="cnt16" />
|
|
<result property="penalCnt17" column="cnt17" />
|
|
<result property="penalCnt18" column="cnt18" />
|
|
<result property="penalCnt19" column="cnt19" />
|
|
<result property="penalCnt20" column="cnt20" />
|
|
<result property="penalAmt1" column="amount1" />
|
|
<result property="penalAmt2" column="amount2" />
|
|
<result property="penalAmt3" column="amount3" />
|
|
<result property="penalAmt4" column="amount4" />
|
|
<result property="penalAmt5" column="amount5" />
|
|
<result property="penalAmt6" column="amount6" />
|
|
<result property="penalAmt7" column="amount7" />
|
|
<result property="penalAmt8" column="amount8" />
|
|
<result property="penalAmt9" column="amount9" />
|
|
<result property="penalAmt10" column="amount10" />
|
|
<result property="penalAmt11" column="amount11" />
|
|
<result property="penalAmt12" column="amount12" />
|
|
<result property="penalAmt13" column="amount13" />
|
|
<result property="penalAmt14" column="amount14" />
|
|
<result property="penalAmt15" column="amount15" />
|
|
<result property="penalAmt16" column="amount16" />
|
|
<result property="penalAmt17" column="amount17" />
|
|
<result property="penalAmt18" column="amount18" />
|
|
<result property="penalAmt19" column="amount19" />
|
|
<result property="penalAmt20" column="amount20" />
|
|
</resultMap>
|
|
|
|
<!-- 과태료 수입금 명세 내역 관리[FN61] -->
|
|
<resultMap id="findFineProDtlList-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="year" column="year" />
|
|
<result property="paymentDate" column="receipt_date" />
|
|
<result property="manaNum1" column="mng_no_01" />
|
|
<result property="manaNum2" column="mng_no_02" />
|
|
<result property="manaNum3" column="mng_no_03" />
|
|
<result property="manaNum4" column="mng_no_04" />
|
|
<result property="manaNum5" column="mng_no_05" />
|
|
<result property="manaNum6" column="mng_no_06" />
|
|
<result property="manaNum7" column="mng_no_07" />
|
|
<result property="manaNum8" column="mng_no_08" />
|
|
<result property="manaNum9" column="mng_no_09" />
|
|
<result property="manaNum10" column="mng_no_10" />
|
|
<result property="douCnt" column="mng_cnt" />
|
|
<result property="douAmt" column="mng_amt" />
|
|
</resultMap>
|
|
|
|
<!-- 과태료 수입금 명세 내역 관리[FN62] -->
|
|
<resultMap id="findFineProTotCon-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="sendDate" column="t_year" />
|
|
<result property="paymentOne" column="p_levy_1ho" />
|
|
<result property="paymentThr" column="p_levy_3ho" />
|
|
<result property="penaltyOne" column="p_receipt_1ho" />
|
|
<result property="penaltyThr" column="p_receipt_3ho" />
|
|
<result property="overPayOne" column="p_over_1ho" />
|
|
<result property="overPayThr" column="p_over_3ho" />
|
|
</resultMap>
|
|
|
|
<!-- 과태료 수입금 명세 내역 관리[FN62]Cnt -->
|
|
<resultMap id="findFineProTotConCnt-resultMap" type="java.util.Map">
|
|
<result property="paymentOneTot" column="p_levy_1ho" />
|
|
<result property="paymentThrTot" column="p_levy_3ho" />
|
|
<result property="penaltyOneTot" column="p_receipt_1ho" />
|
|
<result property="penaltyThrTot" column="p_receipt_3ho" />
|
|
<result property="overPayOneTot" column="p_over_1ho" />
|
|
<result property="overPayThrTot" column="p_over_3ho" />
|
|
</resultMap>
|
|
|
|
<!-- 과태료 미징수 현황 [FN063] -->
|
|
<resultMap id="findFineUnCol-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="conNum" column="manageNum" />
|
|
<result property="conti" column="motion_id" />
|
|
<result property="motionNm" column="MOTION_NM" />
|
|
<result property="carNum" column="car_no" />
|
|
<result property="carKind" column="car_type_name" />
|
|
<result property="passDate" column="passdate" />
|
|
<result property="passTime" column="work_times" />
|
|
<result property="collector" column="owner" />
|
|
<result property="adressNum" column="postno" />
|
|
<result property="address" column="address_name" />
|
|
<result property="finalNotice" column="t_notice_date" />
|
|
<result property="penalty" column="lavy_amount" />
|
|
</resultMap>
|
|
|
|
<!-- 과태료 징수 현황 [FN64] -->
|
|
<resultMap id="findFinePanCon-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="conNum" column="seq_no" />
|
|
<result property="conti" column="BEFORE_MOTION_ID" />
|
|
<result property="motionNm" column="MOTION_NM" />
|
|
<result property="carNum" column="car_no" />
|
|
<result property="carKind" column="car_type_name" />
|
|
<result property="passDate" column="passdate" />
|
|
<result property="passTime" column="work_time" />
|
|
<result property="collector" column="owner" />
|
|
<result property="adressNum" column="post_no" />
|
|
<result property="address" column="F_add" />
|
|
<result property="notifiDate" column="SEND_DATE" />
|
|
<result property="penalty" column="lavy_amount" />
|
|
<result property="paymentDate" column="nobbu_date" />
|
|
</resultMap>
|
|
|
|
<!-- 과태료 수입금 명세 내역 년도 조회[FN65] -->
|
|
<resultMap id="findFineMonData-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="year" column="year" />
|
|
<result property="mon" column="month" />
|
|
<result property="motionNm" column="motion_nm" />
|
|
<result property="notifiCnt" column="cnt" />
|
|
<result property="notifiPri" column="lavy_amt" />
|
|
</resultMap>
|
|
|
|
<!-- 과태료 이중수납 내역 및 환불처리[FN66] -->
|
|
<resultMap id="findFineDouCon-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="manageYear" column="manage_year" />
|
|
<result property="manageNum" column="manage_num" />
|
|
<result property="conNum" column="penalty_num" />
|
|
<result property="passDate" column="pass_date" />
|
|
<result property="passTime" column="pass_time" />
|
|
<result property="fareOfficeId" column="fare_office_full_name" />
|
|
<result property="carNum" column="car_no" />
|
|
<result property="douAmt" column="lavy_amount" />
|
|
<result property="paymentDateMax" column="MAX_receipt_date" />
|
|
<result property="paymentDateMin" column="MIN_receipt_date" />
|
|
<result property="payMentMax" column="MAX_RECEIPT_AGENCY" />
|
|
<result property="payMentMin" column="MIN_RECEIPT_AGENCY" />
|
|
<result property="notifiMax" column="max_MOTION_FULL_NAME" />
|
|
<result property="notifiMin" column="min_MOTION_FULL_NAME" />
|
|
<result property="collector" column="OWNER" />
|
|
<result property="adressNum" column="post_num" />
|
|
<result property="address" column="address_name" />
|
|
</resultMap>
|
|
|
|
<!-- 과태료 이중수납 내역 및 환불처리Popup[FN66] -->
|
|
<resultMap id="findFineDouConPop-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="manageYear" column="PENALTY_MANAGE_YEAR" />
|
|
<result property="manageNum" column="PENALTY_SEQNO" />
|
|
<result property="conNum" column="conNum" />
|
|
<result property="sendDate" column="RECEIPT_DATE" />
|
|
<result property="penalty" column="RECEIPT_AMOUNT" />
|
|
<result property="conti" column="MOTION_NM" />
|
|
</resultMap>
|
|
|
|
|
|
<!-- 과태료 이중수납 환불현황[FN67] -->
|
|
<resultMap id="findFineDouRoll-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="year" column="tt_year" />
|
|
<result property="douCnt" column="nn_cnt" />
|
|
<result property="rollCnt" column="r_cnt" />
|
|
<result property="noAction" column="no_action" />
|
|
</resultMap>
|
|
|
|
<!-- 과태료 이중수납 환불현황[FN67]Sec -->
|
|
<resultMap id="findFineDouRollSec-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="year" column="year" />
|
|
<result property="douCnt" column="nn_cnt" />
|
|
<result property="douRate" column="nn_rate" />
|
|
<result property="rollCnt" column="d_cnt" />
|
|
<result property="rollRate" column="d_rate" />
|
|
</resultMap>
|
|
|
|
|
|
<!-- 과태료 환불현황 및 취소[FN68] -->
|
|
<resultMap id="findFineRollCancel-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="manageYear" column="penalty_manage_year" />
|
|
<result property="manageNum" column="PENALTY_SEQNO" />
|
|
<result property="conNum" column="con_Num" />
|
|
<result property="passDate" column="pass_date" />
|
|
<result property="carNum" column="car_no" />
|
|
<result property="collector" column="owner" />
|
|
<result property="paymentDate" column="r_date" />
|
|
<result property="rollDate" column="dou_ret_date" />
|
|
<result property="conti" column="MOTION_NM" />
|
|
<result property="penalty" column="receipt_amount" />
|
|
<result property="retReason" column="dou_ret_remark" />
|
|
<result property="retPerson" column="dou_ret_person" />
|
|
</resultMap>
|
|
|
|
<!-- 과태료 환불현황 및 취소[FN68]Popup -->
|
|
<resultMap id="findFineRollCancelPop-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="manageYear" column="PENALTY_MANAGE_YEAR" />
|
|
<result property="manageNum" column="PENALTY_SEQNO" />
|
|
<result property="conNum" column="conNum" />
|
|
<result property="sendDate" column="RECEIPT_DATE" />
|
|
<result property="penalty" column="RECEIPT_AMOUNT" />
|
|
<result property="conti" column="MOTION_NM" />
|
|
<result property="retPerson" column="DOU_RET_PERSON" />
|
|
<result property="retReason" column="DOU_RET_REMARK" />
|
|
<result property="rollDate" column="DOU_RET_DATE" />
|
|
</resultMap>
|
|
|
|
<!-- 과태료 환불현황 및 취소[FN68]데이터 merge 용 -->
|
|
<resultMap id="findFineRollCheck-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="year" column="yymm" />
|
|
</resultMap>
|
|
|
|
|
|
<!--과태료 납부 비교[FN69] -->
|
|
<resultMap id="findFinePenCompare-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="year" column="PENALTY_MANAGE_YEAR" />
|
|
<result property="fareOfficeInfo" column="FARE_OFFICE_ID" />
|
|
<result property="advanCntOne" column="CNT1" />
|
|
<result property="advanAmtOne" column="AMOUNT1" />
|
|
<result property="afterAdvanCntOne" column="CNT21" />
|
|
<result property="afterAdvanAmtOne" column="AMOUNT21" />
|
|
<result property="additiCntOne" column="OCNT31" />
|
|
<result property="additiAmtOne" column="OAMOUNT31" />
|
|
<result property="afterAdditiCntOne" column="CNT31" />
|
|
<result property="afterAdditiAmtOne" column="AMOUNT31" />
|
|
<result property="normalCntOne" column="CNT0" />
|
|
<result property="normalAmtOne" column="AMOUNT0" />
|
|
</resultMap>
|
|
|
|
<!--가산금 부과별 납부현황[FN70] -->
|
|
<resultMap id="findAddiCon-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="year" column="year" />
|
|
<result property="fareOfficeInfo" column="fare_office_id" />
|
|
<result property="groupCode" column="GROUP_CODE" />
|
|
<result property="elapsedDate" column="ElapsedDate" />
|
|
<result property="additiCnt" column="cnt" />
|
|
<result property="additiAmt" column="lavy_amount" />
|
|
<result property="paymentRate" column="rate" />
|
|
</resultMap>
|
|
|
|
<!--미납금 납부 전망[FN71] -->
|
|
<resultMap id="findNonpayCompl-resultMap" type="cfs.fine.vo.FinePmVO">
|
|
<result property="year" column="year" />
|
|
<result property="passDate" column="month" />
|
|
<result property="nonpayCnt" column="cnt" />
|
|
<result property="penaltyAdd" column="lavy_amount" />
|
|
<result property="payAdd" column="lavy_amount2" />
|
|
<result property="penalty" column="original_amount" />
|
|
</resultMap>
|
|
|
|
|
|
|
|
<!-- 요부과고지 및 납부실적 조회 [FN53] -->
|
|
<select id="findFinePmList" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFinePmList-resultMap">
|
|
SELECT YEAR,
|
|
YEAR || '/' || MONTH MONTH,
|
|
MOTION_ID,
|
|
MOTION_ID2,
|
|
GOJI_CNT,
|
|
GOJI_AMT,
|
|
NABU_CNT,
|
|
NABU_AMT,
|
|
DOB_CNT,
|
|
DOB_AMT,
|
|
R,
|
|
'gy' as name,
|
|
decode(R, 1, GAM_CNT, 0) GAM_CNT,
|
|
decode(R, 1, GAM_AMT, 0) GAM_AMT
|
|
FROM ( SELECT YEAR,
|
|
MONTH,
|
|
MOTION_ID,
|
|
DECODE(MOTION_ID, '1', '차적조회', '2', '사전통지', '3', '1차고지', '4', '2차고지', '5', '민원처리', '7', '압류촉탁', '9', '수납완료') MOTION_ID2,
|
|
SUM(GOJI_CNT) GOJI_CNT,
|
|
SUM(GOJI_AMT) GOJI_AMT,
|
|
SUM(NABU_CNT) NABU_CNT,
|
|
SUM(NABU_AMT) NABU_AMT,
|
|
SUM(DOB_CNT) DOB_CNT,
|
|
SUM(DOB_AMT) DOB_AMT,
|
|
RANK( ) OVER (PARTITION BY YEAR,
|
|
MONTH
|
|
ORDER BY MOTION_ID) R,
|
|
( SELECT COUNT(*)
|
|
FROM PENALTY_DETAIL_INFO_DAMO T
|
|
WHERE A.YEAR = T.YEAR
|
|
AND A.MONTH = T.MONTH
|
|
<if test= "fareOfficeId!=null and !fareOfficeId.equals('')" >
|
|
AND FARE_OFFICE_ID IN(#{fareOfficeId})
|
|
</if>
|
|
AND NOTICE_ID = '99'
|
|
AND NOTICE_WRONG_ID = '01') GAM_CNT,
|
|
( SELECT NVL(SUM(NVL(T.FINE_AMOUNT,
|
|
0) + NVL(T.PASS_AMOUNT,
|
|
0) ),
|
|
0)
|
|
FROM PENALTY_DETAIL_INFO_DAMO T
|
|
WHERE A.YEAR = T.YEAR
|
|
AND A.MONTH = T.MONTH
|
|
<if test= "fareOfficeId!=null and !fareOfficeId.equals('')" >
|
|
AND FARE_OFFICE_ID IN(#{fareOfficeId})
|
|
</if>
|
|
AND NOTICE_ID = '99'
|
|
AND NOTICE_WRONG_ID = '01') GAM_AMT
|
|
FROM ( SELECT YEAR,
|
|
MONTH,
|
|
MOTION_ID,
|
|
COUNT(*) AS GOJI_CNT,
|
|
NVL(SUM(NVL(LAVY_AMOUNT,
|
|
0) ),
|
|
0) AS GOJI_AMT,
|
|
0 NABU_CNT,
|
|
0 NABU_AMT,
|
|
0 GAM_CNT,
|
|
0 GAM_AMT,
|
|
0 DOB_CNT,
|
|
0 DOB_AMT
|
|
FROM ( SELECT A.YEAR,
|
|
A.MONTH,
|
|
A.PENALTY_MANAGE_YEAR,
|
|
A.PENALTY_SEQNO,
|
|
NVL(A.FINE_AMOUNT,
|
|
0) + NVL(A.PASS_AMOUNT,
|
|
0) LAVY_AMOUNT,
|
|
SUBSTR(B.MOTION_ID,
|
|
1,
|
|
1) MOTION_ID
|
|
FROM PENALTY_DETAIL_INFO_DAMO A,
|
|
SEND_INFO B
|
|
WHERE A.PENALTY_MANAGE_YEAR =B.PENALTY_MANAGE_YEAR
|
|
AND A.PENALTY_SEQNO =B.PENALTY_SEQNO
|
|
<if test= "fareOfficeId!=null and !fareOfficeId.equals('')" >
|
|
AND A.FARE_OFFICE_ID IN(#{fareOfficeId})
|
|
</if>
|
|
AND A.PASS_DATE BETWEEN #{inStDate}||'01' AND #{inEdDate}||'31'
|
|
<if test= "!motionId.equals('all')" >
|
|
AND SUBSTR(B.MOTION_ID,
|
|
1,
|
|
1) IN(#{motionId})
|
|
</if>
|
|
AND B.MOTION_ID NOT IN('71',
|
|
'72')
|
|
AND B.MOTION_ID IN('11',
|
|
'13',
|
|
'21',
|
|
'23',
|
|
'25',
|
|
'31',
|
|
'33',
|
|
'35',
|
|
'37',
|
|
'41',
|
|
'43',
|
|
'45',
|
|
'47',
|
|
'49',
|
|
'51',
|
|
'61',
|
|
'71',
|
|
'77',
|
|
'81',
|
|
'91')
|
|
GROUP BY A.YEAR,
|
|
A.MONTH,
|
|
A.PENALTY_MANAGE_YEAR,
|
|
SUBSTR(B.MOTION_ID,
|
|
1,
|
|
1),
|
|
A.PENALTY_SEQNO,
|
|
NVL(A.FINE_AMOUNT,
|
|
0) + NVL(A.PASS_AMOUNT,
|
|
0) )
|
|
GROUP BY YEAR,
|
|
MONTH,
|
|
MOTION_ID
|
|
UNION ALL
|
|
SELECT YEAR,
|
|
MONTH,
|
|
'7' MOTION_ID,
|
|
COUNT(*),
|
|
NVL(SUM(NVL(LAVY_AMOUNT,
|
|
0) ),
|
|
0),
|
|
0 NABU_CNT,
|
|
0 NABU_AMT,
|
|
0 GAM_CNT,
|
|
0 GAM_AMT,
|
|
0 DOB_CNT,
|
|
0 DOB_AMT
|
|
FROM ( SELECT A.YEAR,
|
|
A.MONTH,
|
|
A.PENALTY_MANAGE_YEAR,
|
|
A.PENALTY_SEQNO,
|
|
NVL(A.FINE_AMOUNT,
|
|
0) + NVL(A.PASS_AMOUNT,
|
|
0) LAVY_AMOUNT
|
|
FROM PENALTY_DETAIL_INFO_DAMO A,
|
|
SEIZURE_INFO B
|
|
WHERE A.SEIZURE_MANAGE_YEAR = B.SEIZURE_MANAGE_YEAR
|
|
AND A.SEIZURE_MANAGE_NO = B.SEIZURE_MANAGE_NO
|
|
<if test= "fareOfficeId!=null and !fareOfficeId.equals('')" >
|
|
AND A.FARE_OFFICE_ID IN(#{fareOfficeId})
|
|
</if>
|
|
AND A.PASS_DATE BETWEEN #{inStDate}||'01' AND #{inEdDate}||'31'
|
|
<if test= "!motionId.equals('all')" >
|
|
AND '7' in(#{motionId})
|
|
</if>
|
|
GROUP BY A.YEAR,
|
|
A.MONTH,
|
|
A.PENALTY_MANAGE_YEAR,
|
|
A.PENALTY_SEQNO,
|
|
NVL(A.FINE_AMOUNT,
|
|
0) + NVL(A.PASS_AMOUNT,
|
|
0) )
|
|
GROUP BY YEAR,
|
|
MONTH
|
|
UNION ALL
|
|
SELECT YEAR,
|
|
MONTH,
|
|
MOTION_ID,
|
|
0 GOJI_CNT,
|
|
0 GIJI_AMT,
|
|
COUNT(*) AS N_CNT,
|
|
NVL(SUM(NVL(LAVY_AMOUNT,
|
|
0) ),
|
|
0) AS N_AMOUNT,
|
|
0 GAM_CNT,
|
|
0 GAM_AMT,
|
|
0 DOB_CNT,
|
|
0 DOB_AMT
|
|
FROM ( SELECT A.YEAR,
|
|
A.MONTH,
|
|
SUBSTR(B.RECEIPT_ID,
|
|
1,
|
|
1) MOTION_ID,
|
|
A.PENALTY_MANAGE_YEAR,
|
|
A.PENALTY_SEQNO,
|
|
NVL(A.FINE_AMOUNT,
|
|
0) + NVL(A.PASS_AMOUNT,
|
|
0) LAVY_AMOUNT
|
|
FROM PENALTY_DETAIL_INFO_DAMO A,
|
|
RECEIPT_INFO B
|
|
WHERE A.PENALTY_MANAGE_YEAR =B.PENALTY_MANAGE_YEAR
|
|
AND A.PENALTY_SEQNO =B.PENALTY_SEQNO
|
|
<if test= "fareOfficeId!=null and !fareOfficeId.equals('')" >
|
|
AND A.FARE_OFFICE_ID IN(#{fareOfficeId})
|
|
</if>
|
|
AND A.PASS_DATE BETWEEN #{inStDate}||'01' AND #{inEdDate}||'31'
|
|
<if test= "!motionId.equals('all')" >
|
|
AND SUBSTR(B.RECEIPT_ID,1,1) IN(#{motionId})
|
|
</if>
|
|
AND B.RECEIPT_ID IN('11',
|
|
'13',
|
|
'21',
|
|
'23',
|
|
'25',
|
|
'31',
|
|
'33',
|
|
'35',
|
|
'37',
|
|
'41',
|
|
'43',
|
|
'45',
|
|
'47',
|
|
'49',
|
|
'51',
|
|
'61',
|
|
'71',
|
|
'77',
|
|
'81') )
|
|
GROUP BY YEAR,
|
|
MONTH,
|
|
MOTION_ID
|
|
UNION ALL
|
|
SELECT YEAR,
|
|
MONTH,
|
|
MOTION_ID,
|
|
0 GOJI_CNT,
|
|
0 GOJI_AMT,
|
|
0 NABU_CNT,
|
|
0 NABU_AMT,
|
|
0 GAM_CNT,
|
|
0 GAM_AMT,
|
|
SUM(DOB_CNT) DOB_CNT,
|
|
SUM(DOB_AMT) DOB_AMT
|
|
FROM ( SELECT A.YEAR,
|
|
A.MONTH,
|
|
A.PENALTY_MANAGE_YEAR,
|
|
A.PENALTY_SEQNO,
|
|
SUBSTR(A.BEFORE_MOTION_ID,
|
|
1,
|
|
1) MOTION_ID,
|
|
NVL(A.FINE_AMOUNT,
|
|
0) + NVL(A.PASS_AMOUNT,
|
|
0) DOB_AMT,
|
|
1 DOB_CNT
|
|
FROM PENALTY_DETAIL_INFO_DAMO A
|
|
WHERE 1 = 1
|
|
<if test= "fareOfficeId!=null and !fareOfficeId.equals('')" >
|
|
AND A.FARE_OFFICE_ID IN(#{fareOfficeId})
|
|
</if>
|
|
AND A.PASS_DATE BETWEEN #{inStDate}||'01' AND #{inEdDate}||'31'
|
|
AND A.MOTION_ID NOT IN('11','12','13')
|
|
<if test= "!motionId.equals('all')" >
|
|
AND SUBSTR(a.MOTION_ID,
|
|
1,
|
|
1) IN(#{motionId})
|
|
</if>
|
|
and a.C_LOSS = '1'
|
|
GROUP BY A.YEAR,
|
|
A.MONTH,
|
|
A.PENALTY_MANAGE_YEAR,
|
|
A.PENALTY_SEQNO,
|
|
SUBSTR(A.BEFORE_MOTION_ID,
|
|
1,
|
|
1),
|
|
NVL(A.FINE_AMOUNT,
|
|
0) + NVL(A.PASS_AMOUNT,
|
|
0) )
|
|
GROUP BY YEAR,
|
|
MOTION_ID,
|
|
MONTH) A
|
|
GROUP BY YEAR,
|
|
MONTH,
|
|
MOTION_ID) A
|
|
ORDER BY 1,
|
|
2,
|
|
3
|
|
|
|
</select>
|
|
|
|
<!-- 비부과 대상차량 현황[FN54], 비부과 대상차량 내용 현황[FN055] -->
|
|
<select id="findFineNonLevyList" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineNonLevyList-resultMap">
|
|
SELECT a.car_no car_no,
|
|
a.car_type_name car_type_name,
|
|
a.year||a.month||a.day PADT,
|
|
c.fare_office_full_name fare_office_full_name,
|
|
d.booth_full_name booth_full_name,
|
|
e.exempt_reason_full_name exempt_reason_full_name,
|
|
a.remarks remarks,
|
|
N.NOTCONFIRM_FULL_NAME
|
|
NOTCONFIRM_FULL_NAME
|
|
FROM DEFAULT_FARE_READ_INFO_DAMO a,
|
|
fare_office_code_info c,
|
|
booth_code_info d,
|
|
exempt_reason_code_info e,
|
|
NOTCONFIRM_CODE_INFO N
|
|
WHERE a.fare_office_id = c.fare_office_id
|
|
AND a.fare_office_id = d.fare_office_id
|
|
AND a.booth_id = d.booth_id
|
|
AND
|
|
a.exempt_reason_id = e.exempt_reason_id
|
|
AND A.NOTCONFIRM_ID = N.NOTCONFIRM_ID(+)
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
AND a.fare_office_id like #{fareOfficeId}
|
|
</if>
|
|
AND a.year || a.month || a.day between #{inStDate} AND #{inEdDate}
|
|
AND A.READ_RESULT_ID = '01'
|
|
<if test="rmarksCode != null and !rmarksCode.equals('')">
|
|
AND e.EXEMPT_REASON_ID = #{rmarksCode}
|
|
</if>
|
|
<!-- AND a.cars_data_kbn = '0' -->
|
|
UNION ALL
|
|
SELECT a.car_no,
|
|
a.car_type_name,
|
|
a.year||a.month||a.day ymd,
|
|
c.fare_office_full_name,
|
|
d.booth_full_name,
|
|
e.exempt_reason_full_name,
|
|
a.remarks,
|
|
N.NOTCONFIRM_FULL_NAME
|
|
FROM DEFAULT_FARE_READ_INFO_DAMO a,
|
|
fare_office_code_info c,
|
|
booth_code_info d,
|
|
exempt_reason_code_info e,
|
|
NOTCONFIRM_CODE_INFO N
|
|
WHERE a.fare_office_id = c.fare_office_id
|
|
AND a.fare_office_id = d.fare_office_id
|
|
AND a.booth_id = d.booth_id
|
|
AND
|
|
a.exempt_reason_id = e.exempt_reason_id
|
|
AND A.NOTCONFIRM_ID = N.NOTCONFIRM_ID(+)
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
AND a.fare_office_id like #{fareOfficeId}
|
|
</if>
|
|
AND a.year || a.month || a.day between #{inStDate} AND #{inEdDate}
|
|
AND A.READ_RESULT_ID = '05'
|
|
<if test="rmarksCode != null and !rmarksCode.equals('')">
|
|
AND e.EXEMPT_REASON_ID = #{rmarksCode}
|
|
</if>
|
|
order by fare_office_full_name,booth_full_name,PADT
|
|
</select>
|
|
|
|
<!-- 비부과 대상차량 현황Cnt[FN54] -->
|
|
<select id="findFineNonLevyListCnt" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineNonLevyListCnt-resultMap">
|
|
SELECT MAX(CODE_01) CODE_O1,
|
|
MAX(CODE_02) CODE_O2,
|
|
MAX(CODE_03) CODE_O3,
|
|
MAX(CODE_04) CODE_O4,
|
|
MAX(CODE_05) CODE_O5,
|
|
MAX(CODE_06) CODE_O6,
|
|
MAX(CODE_07) CODE_O7,
|
|
MAX(CODE_08) CODE_O8,
|
|
MAX(CODE_09) CODE_O9,
|
|
MAX(CODE_10) CODE_10,
|
|
MAX(CODE_11) CODE_11,
|
|
MAX(CODE_12) CODE_12,
|
|
MAX(CODE_13) CODE_13,
|
|
MAX(CODE_14) CODE_14,
|
|
MAX(CODE_15) CODE_15
|
|
FROM(
|
|
SELECT COUNT(DECODE(E.EXEMPT_REASON_ID,'01',0)) CODE_01,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'02',0)) CODE_02,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'03',0)) CODE_03,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'04',0)) CODE_04,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'05',0)) CODE_05,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'06',0)) CODE_06,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'07',0)) CODE_07,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'08',0)) CODE_08,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'09',0)) CODE_09,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'10',0)) CODE_10,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'11',0)) CODE_11,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'12',0)) CODE_12,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'13',0)) CODE_13,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'14',0)) CODE_15,
|
|
COUNT(E.EXEMPT_REASON_ID) CODE_14
|
|
FROM
|
|
DEFAULT_FARE_READ_INFO_DAMO a,
|
|
fare_office_code_info c,
|
|
booth_code_info d,
|
|
exempt_reason_code_info e,
|
|
NOTCONFIRM_CODE_INFO N
|
|
WHERE a.fare_office_id
|
|
= c.fare_office_id
|
|
AND a.fare_office_id = d.fare_office_id
|
|
AND a.booth_id = d.booth_id
|
|
AND a.exempt_reason_id = e.exempt_reason_id
|
|
AND
|
|
A.NOTCONFIRM_ID = N.NOTCONFIRM_ID(+)
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
AND a.fare_office_id like #{fareOfficeId}
|
|
</if>
|
|
AND a.year || a.month || a.day between #{inStDate} AND #{inEdDate}
|
|
AND A.READ_RESULT_ID = '01'
|
|
<!-- AND a.cars_data_kbn = '0' -->
|
|
UNION ALL
|
|
SELECT COUNT(DECODE(E.EXEMPT_REASON_ID,'01',1)),
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'03',0)) CODE_02,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'04',0)) CODE_03,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'05',0)) CODE_04,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'05',0)) CODE_05,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'06',0)) CODE_06,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'07',0)) CODE_07,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'08',0)) CODE_08,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'09',0)) CODE_09,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'10',0)) CODE_10,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'11',0)) CODE_11,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'12',0)) CODE_12,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'13',0)) CODE_13,
|
|
COUNT(DECODE(E.EXEMPT_REASON_ID,'14',0)) CODE_15,
|
|
COUNT(E.EXEMPT_REASON_ID) CODE_14
|
|
FROM DEFAULT_FARE_READ_INFO_DAMO a,
|
|
fare_office_code_info c,
|
|
booth_code_info d,
|
|
exempt_reason_code_info e,
|
|
NOTCONFIRM_CODE_INFO N
|
|
WHERE a.fare_office_id = c.fare_office_id
|
|
AND a.fare_office_id =
|
|
d.fare_office_id
|
|
AND a.booth_id = d.booth_id
|
|
AND a.exempt_reason_id = e.exempt_reason_id
|
|
AND A.NOTCONFIRM_ID = N.NOTCONFIRM_ID(+)
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
AND a.fare_office_id like #{fareOfficeId}
|
|
</if>
|
|
AND a.year || a.month || a.day between #{inStDate} AND #{inEdDate}
|
|
AND A.READ_RESULT_ID = '05'
|
|
)
|
|
|
|
</select>
|
|
|
|
<!-- 고지취소 현황[FN56] -->
|
|
<select id="findFineNonTificList" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineNonTificList-resultMap">
|
|
SELECT SUBSTR(A.PENALTY_MANAGE_YEAR||'-'||A.PENALTY_SEQNO,3,11) CONNUM,
|
|
A.CAR_NO CARNUM,
|
|
(select fare_office_full_name from fare_office_code_info T where A.FARE_OFFICE_ID =T.fare_office_id) FARE_OFFICE_ID,
|
|
(select booth_full_name
|
|
from booth_code_info T where A.BOOTH_ID =T.booth_id and A.FARE_OFFICE_ID = T.FARE_OFFICE_ID) BOOTH_ID,
|
|
A.YEAR||'/'||A.MONTH||'/'||A.DAY|| ' '||subStr(A.WORK_TIMES,0,2)||':'||subStr(A.WORK_TIMES,3,2)||':'||subStr(A.WORK_TIMES,5,2) PADT,
|
|
A.YEAR||A.MONTH GROUP_Date,
|
|
A.OWNER NAME,
|
|
A.FINE_AMOUNT PENALTY,
|
|
TO_CHAR(A.NOTICE_WRONG_DATE,'YYYYMMDD') NOTICANDT,
|
|
NOTICE_WRONG_REASON
|
|
FROM PENALTY_DETAIL_INFO_DAMO A
|
|
where notice_id = '99'
|
|
and notice_wrong_id = '01'
|
|
<if test="dtType==1">
|
|
and a.year||a.month between #{inStDate} and #{inEdDate}
|
|
order by A.YEAR||A.MONTH||A.DAY,PADT
|
|
</if>
|
|
<if test="dtType==2">
|
|
and to_char(A.NOTICE_WRONG_DATE,'yyyymm') between #{inStDate} and #{inEdDate}
|
|
order by
|
|
to_char(A.NOTICE_WRONG_DATE,'yyyymmdd'),fare_office_id,BOOTH_ID
|
|
</if>
|
|
|
|
</select>
|
|
|
|
<!-- 혼잡통행료 과테료 소지수납 현황[FN57] -->
|
|
<select id="findFineConfuList" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineConfuList-resultMap">
|
|
<if test="dtType.equals('02')">
|
|
select SUBSTR(receipt_date,0,4)||'/'||SUBSTR(receipt_date,5,2) receipt_date,
|
|
TRIM(TO_CHAR(SUM(motion12),'9,999'))||'('||TRIM(TO_CHAR(SUM(amount12),'999,999'))||')' motion12,
|
|
TRIM(TO_CHAR(SUM(motion13),'9,999'))||'('||TRIM(TO_CHAR(SUM(amount13),'999,999'))||')' motion13,
|
|
TRIM(TO_CHAR(SUM(motion14),'9,999'))||'('||TRIM(TO_CHAR(SUM(amount14),'999,999'))||')' motion14,
|
|
TRIM(TO_CHAR(SUM(motion17),'9,999'))||'('||TRIM(TO_CHAR(SUM(amount17),'999,999'))||')' motion17,
|
|
TRIM(TO_CHAR(SUM(double_cnt1),'9,999'))||'('||TRIM(TO_CHAR(SUM(double_amount1),'999,999'))||')' double_cnt1,
|
|
TRIM(TO_CHAR(SUM(motion32),'9,999'))||'('||TRIM(TO_CHAR(SUM(amount32),'999,999'))||')' motion32,
|
|
TRIM(TO_CHAR(SUM(motion33),'9,999'))||'('||TRIM(TO_CHAR(SUM(amount33),'999,999'))||')' motion33,
|
|
TRIM(TO_CHAR(SUM(motion34),'9,999'))||'('||TRIM(TO_CHAR(SUM(amount34),'999,999'))||')' motion34,
|
|
TRIM(TO_CHAR(SUM(motion37),'9,999'))||'('||TRIM(TO_CHAR(SUM(amount37),'999,999'))||')' motion37,
|
|
TRIM(TO_CHAR(SUM(double_cnt3),'9,999'))||'('||TRIM(TO_CHAR(SUM(double_amount1),'999,999'))||')' double_cnt3,
|
|
TRIM(TO_CHAR(SUM(motion_7),'9,999'))||'('||TRIM(TO_CHAR(SUM(amount_7),'999,999'))||')' motion_7,
|
|
TRIM(TO_CHAR(SUM(motion_6),'9,999'))||'('||TRIM(TO_CHAR(SUM(amount_6),'999,999'))||')' motion_6,
|
|
TRIM(TO_CHAR(SUM(motion_5),'9,999'))||'('||TRIM(TO_CHAR(SUM(amount_5),'999,999'))||')' motion_5,
|
|
TRIM(TO_CHAR(SUM(motion_4),'9,999'))||'('||TRIM(TO_CHAR(SUM(amount_4),'999,999'))||')' motion_4,
|
|
TRIM(TO_CHAR(SUM(motion_3),'9,999'))||'('||TRIM(TO_CHAR(SUM(amount_3),'999,999'))||')' motion_3,
|
|
TRIM(TO_CHAR(SUM(motion_2),'9,999'))||'('||TRIM(TO_CHAR(SUM(amount_2),'999,999'))||')' motion_2,
|
|
TRIM(TO_CHAR(SUM(motion_1),'9,999'))||'('||TRIM(TO_CHAR(SUM(amount_1),'999,999'))||')' motion_1,
|
|
TRIM(TO_CHAR(SUM(motion_0),'9,999'))||'('||TRIM(TO_CHAR(SUM(amount_0),'999,999'))||')' motion_0,
|
|
TRIM(TO_CHAR(SUM(motion12)
|
|
+SUM(motion13)+SUM(motion14) +SUM(motion17)
|
|
,'99,999'))||'('||TRIM(TO_CHAR(SUM(amount12)+SUM(amount13)+SUM(amount14)+SUM(amount17),'999,999'))||')' sub1,
|
|
TRIM(TO_CHAR(SUM(motion32)
|
|
+SUM(motion33)+SUM(motion34) +SUM(motion37)
|
|
,'99,999'))||'('||TRIM(TO_CHAR(SUM(amount32)+SUM(amount33)+SUM(amount34)+SUM(amount37),'999,999'))||')' sub3,
|
|
TRIM(TO_CHAR(SUM(motion12)
|
|
+SUM(motion32) ,'99,999'))||'('||TRIM(TO_CHAR(SUM(amount12)+SUM(amount32),'999,999'))||')' Tot12,
|
|
TRIM(TO_CHAR(SUM(motion13)
|
|
+SUM(motion33) ,'99,999'))||'('||TRIM(TO_CHAR(SUM(amount13)+SUM(amount33),'999,999'))||')' Tot13,
|
|
TRIM(TO_CHAR(SUM(motion14)
|
|
+SUM(motion34) ,'99,999'))||'('||TRIM(TO_CHAR(SUM(amount14)+SUM(amount34),'999,999'))||')' Tot14,
|
|
TRIM(TO_CHAR(SUM(motion17)
|
|
+SUM(motion37) ,'99,999'))||'('||TRIM(TO_CHAR(SUM(amount17)+SUM(amount37),'999,999'))||')' Tot17,
|
|
TRIM(TO_CHAR(SUM(double_cnt1)
|
|
+SUM(double_cnt3) ,'99,999'))||'('||TRIM(TO_CHAR(SUM(double_amount1)+SUM(double_amount3),'999,999'))||')' Tot_double,
|
|
TRIM(TO_CHAR(SUM(motion12) +SUM(motion13)+SUM(motion14) +SUM(motion17)+SUM(motion32) +SUM(motion33)+SUM(motion34) +SUM(motion37)
|
|
,'99,999'))||
|
|
'('||TRIM(TO_CHAR(SUM(amount12)+SUM(amount13)+SUM(amount14)+SUM(amount17)+SUM(amount32)+SUM(amount33)+SUM(amount34)+SUM(amount37),'999,999'))||')'
|
|
TOTAL,
|
|
TRIM(TO_CHAR(SUM(motion_7)+SUM(motion_6)+SUM(motion_5)+SUM(motion_4)+SUM(motion_3)+SUM(motion_2)+SUM(motion_1)+SUM(motion_0),'999,999,999'))||
|
|
'('||TRIM(TO_CHAR(SUM(amount_7)+SUM(amount_6)+SUM(amount_5)+SUM(amount_4)+SUM(amount_3)+SUM(amount_2)+SUM(amount_1)+SUM(amount_0),'999,999,999'))||')'
|
|
Year_Total
|
|
FROM(
|
|
SELECT TO_CHAR(receipt_date,'yyyymm') receipt_date,
|
|
CASE WHEN fare_office_id='01' AND receipt_id LIKE '2%' THEN 1 ELSE 0
|
|
END motion12,
|
|
CASE WHEN fare_office_id='01' AND receipt_id LIKE '2%' THEN receipt_amount/1000 ELSE 0 END amount12,
|
|
CASE WHEN
|
|
fare_office_id='01' AND receipt_id LIKE '3%' THEN 1 ELSE 0 END motion13,
|
|
CASE WHEN fare_office_id='01' AND receipt_id LIKE '3%' THEN
|
|
receipt_amount/1000 ELSE 0 END amount13,
|
|
CASE WHEN fare_office_id='01' AND receipt_id LIKE '4%' THEN 1 ELSE 0 END motion14,
|
|
CASE WHEN
|
|
fare_office_id='01' AND receipt_id LIKE '4%' THEN receipt_amount/1000 ELSE 0 END amount14,
|
|
CASE WHEN fare_office_id='01' AND receipt_id
|
|
LIKE '7%' THEN 1 ELSE 0 END motion17,
|
|
CASE WHEN fare_office_id='01' AND receipt_id LIKE '7%' THEN receipt_amount/1000 ELSE 0 END amount17,
|
|
CASE WHEN fare_office_id='03' AND receipt_id LIKE '2%' THEN 1 ELSE 0 END motion32,
|
|
CASE WHEN fare_office_id='03' AND receipt_id LIKE '2%'
|
|
THEN receipt_amount/1000 ELSE 0 END amount32,
|
|
CASE WHEN fare_office_id='03' AND receipt_id LIKE '3%' THEN 1 ELSE 0 END motion33,
|
|
CASE WHEN
|
|
fare_office_id='03' AND receipt_id LIKE '3%' THEN receipt_amount/1000 ELSE 0 END amount33,
|
|
CASE WHEN fare_office_id='03' AND receipt_id
|
|
LIKE '4%' THEN 1 ELSE 0 END motion34,
|
|
CASE WHEN fare_office_id='03' AND receipt_id LIKE '4%' THEN receipt_amount/1000 ELSE 0 END amount34,
|
|
CASE WHEN fare_office_id='03' AND receipt_id LIKE '7%' THEN 1 ELSE 0 END motion37,
|
|
CASE WHEN fare_office_id='03' AND receipt_id LIKE '7%'
|
|
THEN receipt_amount/1000 ELSE 0 END amount37,
|
|
CASE WHEN RECEIPT_ID LIKE '91' AND FARE_OFFICE_ID= '01' THEN 1 ELSE 0 END double_cnt1,
|
|
CASE
|
|
WHEN RECEIPT_ID LIKE '91' AND FARE_OFFICE_ID= '01' THEN receipt_amount/1000 ELSE 0 END double_amount1,
|
|
CASE WHEN RECEIPT_ID LIKE '91' AND
|
|
FARE_OFFICE_ID= '03' THEN 1 ELSE 0 END double_cnt3,
|
|
CASE WHEN RECEIPT_ID LIKE '91' AND FARE_OFFICE_ID= '03' THEN receipt_amount/1000 ELSE
|
|
0 END double_amount3,
|
|
0 motion_7,0 amount_7,0 motion_6,0 amount_6,0 motion_5,0 amount_5,0 motion_4,0 amount_4,0 motion_3,0 amount_3,0
|
|
motion_2,0 amount_2,0
|
|
motion_1,0 amount_1,0 motion_0,0 amount_0
|
|
FROM PENALTY_DETAIL_INFO_DAMO a, RECEIPT_INFO b
|
|
WHERE A.PENALTY_MANAGE_YEAR =
|
|
B.PENALTY_MANAGE_YEAR
|
|
and A.PENALTY_SEQNO = B.PENALTY_SEQNO
|
|
and b.receipt_date <![CDATA[>= ]]>
|
|
to_date(#{inRadDate}||'0101','yyyymmdd')
|
|
and b.receipt_date <![CDATA[< ]]>
|
|
last_day(to_date(#{inRadDate}||'1231','yyyymmdd')) + 1
|
|
UNION ALL
|
|
select #{inRadDate}||TO_CHAR(receipt_date,'mm')
|
|
receipt_date,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
CASE WHEN B.YEAR <![CDATA[<= ]]>TO_CHAR(TO_NUMBER(#{inRadDate})
|
|
-6) THEN 1 ELSE 0 END motion_7,
|
|
CASE WHEN B.YEAR <![CDATA[<= ]]>TO_CHAR(TO_NUMBER(#{inRadDate})
|
|
-6) THEN receipt_amount/1000 ELSE 0 END amount_7,
|
|
CASE WHEN B.YEAR =TO_CHAR(TO_NUMBER(#{inRadDate}) -6) THEN 1 ELSE 0 END motion_6,
|
|
CASE
|
|
WHEN B.YEAR =TO_CHAR(TO_NUMBER(#{inRadDate}) -6) THEN receipt_amount/1000 ELSE 0 END amount_6,
|
|
CASE WHEN B.YEAR
|
|
=TO_CHAR(TO_NUMBER(#{inRadDate}) -5) THEN 1 ELSE 0 END motion_5,
|
|
CASE WHEN B.YEAR =TO_CHAR(TO_NUMBER(#{inRadDate}) -5) THEN
|
|
receipt_amount/1000 ELSE 0 END amount_5,
|
|
CASE WHEN B.YEAR =TO_CHAR(TO_NUMBER(#{inRadDate}) -4) THEN 1 ELSE 0 END motion_4,
|
|
CASE WHEN B.YEAR
|
|
=TO_CHAR(TO_NUMBER(#{inRadDate}) -4) THEN receipt_amount/1000 ELSE 0 END amount_4,
|
|
CASE WHEN B.YEAR =TO_CHAR(TO_NUMBER(#{inRadDate}) -3)
|
|
THEN 1 ELSE 0 END motion_3,
|
|
CASE WHEN B.YEAR =TO_CHAR(TO_NUMBER(#{inRadDate}) -3) THEN receipt_amount/1000 ELSE 0 END amount_3,
|
|
CASE WHEN
|
|
B.YEAR =TO_CHAR(TO_NUMBER(#{inRadDate}) -2) THEN 1 ELSE 0 END motion_2,
|
|
CASE WHEN B.YEAR =TO_CHAR(TO_NUMBER(#{inRadDate}) -2) THEN
|
|
receipt_amount/1000 ELSE 0 END amount_2,
|
|
CASE WHEN B.YEAR =TO_CHAR(TO_NUMBER(#{inRadDate}) -1) THEN 1 ELSE 0 END motion_1,
|
|
CASE WHEN B.YEAR
|
|
=TO_CHAR(TO_NUMBER(#{inRadDate}) -1) THEN receipt_amount/1000 ELSE 0 END amount_1,
|
|
CASE WHEN B.YEAR =#{inRadDate} THEN 1 ELSE 0 END
|
|
motion_0,
|
|
CASE WHEN B.YEAR =#{inRadDate} THEN receipt_amount/1000 ELSE 0 END amount_0
|
|
FROM RECEIPT_INFO A, PENALTY_DETAIL_INFO_DAMO B
|
|
WHERE
|
|
A.PENALTY_MANAGE_YEAR = B.PENALTY_MANAGE_YEAR
|
|
and A.PENALTY_SEQNO = B.PENALTY_SEQNO
|
|
and a.receipt_date <![CDATA[>= ]]>
|
|
to_date(#{inRadDate}||'0101','yyyymmdd')
|
|
and a.receipt_date <![CDATA[< ]]>
|
|
last_day(to_date(#{inRadDate}||'1231','yyyymmdd')) + 1
|
|
) a
|
|
GROUP BY receipt_date
|
|
</if>
|
|
<if test="dtType.equals('01')">
|
|
select SUBSTR(receipt_date,0,4)||'/'||SUBSTR(receipt_date,5,2)||'/'||SUBSTR(receipt_date,7,2) receipt_date,
|
|
trim(to_char(sum(motion12
|
|
),'9,999'))||'('||trim(to_char(sum(amount12 ),'999,999'))||')' motion12,
|
|
trim(to_char(sum(motion13
|
|
),'9,999'))||'('||trim(to_char(sum(amount13 ),'999,999'))||')' motion13,
|
|
trim(to_char(sum(motion14
|
|
),'9,999'))||'('||trim(to_char(sum(amount14 ),'999,999'))||')' motion14,
|
|
trim(to_char(sum(motion17
|
|
),'9,999'))||'('||trim(to_char(sum(amount17 ),'999,999'))||')' motion17,
|
|
trim(to_char(sum(double_cnt1),'9,999'))||'('||trim(to_char(sum(double_amount1),'999,999'))||')' double_cnt1,
|
|
trim(to_char(sum(motion32
|
|
),'9,999'))||'('||trim(to_char(sum(amount32 ),'999,999'))||')' motion32,
|
|
trim(to_char(sum(motion33
|
|
),'9,999'))||'('||trim(to_char(sum(amount33 ),'999,999'))||')' motion33,
|
|
trim(to_char(sum(motion34
|
|
),'9,999'))||'('||trim(to_char(sum(amount34 ),'999,999'))||')' motion34,
|
|
trim(to_char(sum(motion37
|
|
),'9,999'))||'('||trim(to_char(sum(amount37 ),'999,999'))||')' motion37,
|
|
trim(to_char(sum(double_cnt3),'9,999'))||'('||trim(to_char(sum(double_amount1),'999,999'))||')' double_cnt3,
|
|
trim(to_char(sum(motion_7
|
|
),'9,999'))||'('||trim(to_char(sum(amount_7 ),'999,999'))||')' motion_7,
|
|
trim(to_char(sum(motion_6
|
|
),'9,999'))||'('||trim(to_char(sum(amount_6 ),'999,999'))||')' motion_6,
|
|
trim(to_char(sum(motion_5
|
|
),'9,999'))||'('||trim(to_char(sum(amount_5 ),'999,999'))||')' motion_5,
|
|
trim(to_char(sum(motion_4
|
|
),'9,999'))||'('||trim(to_char(sum(amount_4 ),'999,999'))||')' motion_4,
|
|
trim(to_char(sum(motion_3
|
|
),'9,999'))||'('||trim(to_char(sum(amount_3 ),'999,999'))||')' motion_3,
|
|
trim(to_char(sum(motion_2
|
|
),'9,999'))||'('||trim(to_char(sum(amount_2 ),'999,999'))||')' motion_2,
|
|
trim(to_char(sum(motion_1
|
|
),'9,999'))||'('||trim(to_char(sum(amount_1 ),'999,999'))||')' motion_1,
|
|
trim(to_char(sum(motion_0
|
|
),'9,999'))||'('||trim(to_char(sum(amount_0 ),'999,999'))||')' motion_0,
|
|
trim(to_char(sum(motion12) + sum(motion13) + sum(motion14) +
|
|
sum(motion17),'99,999'))||'('||trim(to_char(sum(amount12)+sum(amount13)+sum(amount14)+sum(amount17),'999,999'))||')' sub1,
|
|
trim(to_char(sum(motion32) + sum(motion33) + sum(motion34) +
|
|
sum(motion37),'99,999'))||'('||trim(to_char(sum(amount32)+sum(amount33)+sum(amount34)+sum(amount37),'999,999'))||')' sub3,
|
|
trim(to_char(sum(motion12) + sum(motion32) ,'99,999'))||'('||trim(to_char(sum(amount12)+sum(amount32),'999,999'))||')' tot12,
|
|
trim(to_char(sum(motion13) + sum(motion33) ,'99,999'))||'('||trim(to_char(sum(amount13)+sum(amount33),'999,999'))||')' tot13,
|
|
trim(to_char(sum(motion14) + sum(motion34) ,'99,999'))||'('||trim(to_char(sum(amount14)+sum(amount34),'999,999'))||')' tot14,
|
|
trim(to_char(sum(motion17) + sum(motion37) ,'99,999'))||'('||trim(to_char(sum(amount17)+sum(amount37),'999,999'))||')' tot17,
|
|
trim(to_char(sum(double_cnt1) +sum(double_cnt3) ,'99,999'))||'('||trim(to_char(sum(double_amount1)+sum(double_amount3),'999,999'))||')'
|
|
tot_double,
|
|
trim(to_char(sum(motion12) +sum(motion13)+sum(motion14) +sum(motion17)+sum(motion32) +sum(motion33)+sum(motion34)
|
|
+sum(motion37) ,'99,999'))||
|
|
'('||trim(to_char(sum(amount12)+sum(amount13)+sum(amount14)+sum(amount17)+sum(amount32)+sum(amount33)+sum(amount34)+sum(amount37),'999,999'))||')'
|
|
total,
|
|
trim(to_char(sum(motion_7)+sum(motion_6)+sum(motion_5)+sum(motion_4)+sum(motion_3)+sum(motion_2)+sum(motion_1)+sum(motion_0),'999,999,999'))||
|
|
'('||trim(to_char(sum(amount_7)+sum(amount_6)+sum(amount_5)+sum(amount_4)+sum(amount_3)+sum(amount_2)+sum(amount_1)+sum(amount_0),'999,999,999'))||')'
|
|
year_total
|
|
from (
|
|
select to_char(receipt_date,'yyyymmdd') receipt_date,
|
|
case when fare_office_id = '01' and receipt_id like '2%' then 1 else
|
|
0 end motion12,
|
|
case when fare_office_id = '01' and receipt_id like '2%' then receipt_amount/1000 else 0 end amount12,
|
|
case when
|
|
fare_office_id = '01' and receipt_id like '3%' then 1 else 0 end motion13,
|
|
case when fare_office_id = '01' and receipt_id like '3%' then
|
|
receipt_amount/1000 else 0 end amount13,
|
|
case when fare_office_id = '01' and receipt_id like '4%' then 1 else 0 end motion14,
|
|
case when
|
|
fare_office_id = '01' and receipt_id like '4%' then receipt_amount/1000 else 0 end amount14,
|
|
case when fare_office_id = '01' and
|
|
receipt_id like '7%' then 1 else 0 end motion17,
|
|
case when fare_office_id = '01' and receipt_id like '7%' then receipt_amount/1000 else 0
|
|
end amount17,
|
|
case when fare_office_id = '03' and receipt_id like '2%' then 1 else 0 end motion32,
|
|
case when fare_office_id = '03' and
|
|
receipt_id like '2%' then receipt_amount/1000 else 0 end amount32,
|
|
case when fare_office_id = '03' and receipt_id like '3%' then 1 else 0
|
|
end motion33,
|
|
case when fare_office_id = '03' and receipt_id like '3%' then receipt_amount/1000 else 0 end amount33,
|
|
case when
|
|
fare_office_id = '03' and receipt_id like '4%' then 1 else 0 end motion34,
|
|
case when fare_office_id = '03' and receipt_id like '4%' then
|
|
receipt_amount/1000 else 0 end amount34,
|
|
case when fare_office_id = '03' and receipt_id like '7%' then 1 else 0 end motion37,
|
|
case when
|
|
fare_office_id = '03' and receipt_id like '7%' then receipt_amount/1000 else 0 end amount37,
|
|
case when fare_office_id = '01' and
|
|
receipt_id like '91' then 1 else 0 end double_cnt1,
|
|
case when fare_office_id = '01' and receipt_id like '91' then receipt_amount/1000 else
|
|
0 end double_amount1,
|
|
case when fare_office_id = '03' and receipt_id like '91' then 1 else 0 end double_cnt3,
|
|
case when fare_office_id =
|
|
'03' and receipt_id like '91' then receipt_amount/1000 else 0 end double_amount3,
|
|
0 motion_7,0 amount_7,0 motion_6,0 amount_6,0 motion_5,0
|
|
amount_5,0 motion_4,0 amount_4,0 motion_3,0 amount_3,0 motion_2,0 amount_2,0
|
|
motion_1,0 amount_1,0 motion_0,0 amount_0
|
|
from
|
|
PENALTY_DETAIL_INFO_DAMO a, receipt_info b
|
|
where a.penalty_manage_year = b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
and
|
|
b.receipt_date <![CDATA[>= ]]>
|
|
to_date(#{inRadDate}||'01','yyyymmdd')
|
|
and b.receipt_date <![CDATA[< ]]>
|
|
last_day(to_date(#{inRadDate}||'01','yyyymmdd')) + 1
|
|
union all
|
|
select #{inRadDate}||to_char(receipt_date,'dd')
|
|
receipt_date,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
case when b.year <![CDATA[<= ]]>
|
|
to_char(to_number(substr(#{inRadDate},1,4)) -6) then 1 else 0 end motion_7,
|
|
case when b.year <![CDATA[<= ]]>
|
|
to_char(to_number(substr(#{inRadDate},1,4)) -6) then receipt_amount/1000 else 0 end amount_7,
|
|
case when b.year =
|
|
to_char(to_number(substr(#{inRadDate},1,4)) -6) then 1 else 0 end motion_6,
|
|
case when b.year = to_char(to_number(substr(#{inRadDate},1,4))
|
|
-6) then receipt_amount/1000 else 0 end amount_6,
|
|
case when b.year = to_char(to_number(substr(#{inRadDate},1,4)) -5) then 1 else 0 end
|
|
motion_5,
|
|
case when b.year = to_char(to_number(substr(#{inRadDate},1,4)) -5) then receipt_amount/1000 else 0 end amount_5,
|
|
case when b.year
|
|
= to_char(to_number(substr(#{inRadDate},1,4)) -4) then 1 else 0 end motion_4,
|
|
case when b.year =
|
|
to_char(to_number(substr(#{inRadDate},1,4)) -4) then receipt_amount/1000 else 0 end amount_4,
|
|
case when b.year =
|
|
to_char(to_number(substr(#{inRadDate},1,4)) -3) then 1 else 0 end motion_3,
|
|
case when b.year = to_char(to_number(substr(#{inRadDate},1,4))
|
|
-3) then receipt_amount/1000 else 0 end amount_3,
|
|
case when b.year = to_char(to_number(substr(#{inRadDate},1,4)) -2) then 1 else 0 end
|
|
motion_2,
|
|
case when b.year = to_char(to_number(substr(#{inRadDate},1,4)) -2) then receipt_amount/1000 else 0 end amount_2,
|
|
case when b.year
|
|
= to_char(to_number(substr(#{inRadDate},1,4)) -1) then 1 else 0 end motion_1,
|
|
case when b.year =
|
|
to_char(to_number(substr(#{inRadDate},1,4)) -1) then receipt_amount/1000 else 0 end amount_1,
|
|
case when b.year = substr(#{inRadDate},1,4)
|
|
then 1 else 0 end motion_0,
|
|
case when b.year = substr(#{inRadDate},1,4) then receipt_amount/1000 else 0 end amount_0
|
|
from receipt_info a,
|
|
PENALTY_DETAIL_INFO_DAMO b
|
|
where a.penalty_manage_year = b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
and a.receipt_date <![CDATA[>= ]]>
|
|
to_date(substr(#{inRadDate},1,6) || '01','yyyymmdd')
|
|
and a.receipt_date <![CDATA[< ]]>
|
|
last_day(to_date(substr(#{inRadDate},1,6) || '01','yyyymmdd')) + 1
|
|
) a
|
|
group by receipt_date
|
|
</if>
|
|
order by receipt_date
|
|
</select>
|
|
|
|
<!-- 고지년월별 과태료 [FN58] -->
|
|
<select id="findFinePenaltyCnt" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFinePenaltyCnt-resultMap">
|
|
SELECT TO_CHAR(SEND_DATE,'YYYYMMDD') AS S_DATE,
|
|
COUNT(*) AS N_CNT
|
|
FROM SEND_INFO A
|
|
WHERE SEND_DATE <![CDATA[>= ]]> TO_DATE(#{inStDate},'YYYYMM')
|
|
AND SEND_DATE <![CDATA[< ]]> ADD_MONTHS(TO_DATE(#{inEdDate},'YYYYMM'),+1)
|
|
GROUP BY SEND_DATE
|
|
ORDER BY SEND_DATE
|
|
</select>
|
|
<!-- 고지년월별 과태료 상세[FN58] -->
|
|
<select id="findFinePenaltyDtl" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFinePenaltyDtl-resultMap">
|
|
SELECT MOTION_ID,NVL((SELECT MOTION_ABB_NAME FROM MOTION_CODE_INFO T WHERE T.MOTION_ID = K.MOTION_ID),'미납') AS MOTION_NM,S_DATE,N_CNT FROM(
|
|
SELECT '91' MOTION_ID,
|
|
TO_CHAR(RECEIPT_DATE,'YYYY-MM') AS S_DATE,
|
|
COUNT(*) AS N_CNT
|
|
FROM SEND_INFO A, RECEIPT_INFO B
|
|
WHERE SEND_DATE = #{notifiDate}
|
|
AND A.PENALTY_MANAGE_YEAR = B.PENALTY_MANAGE_YEAR
|
|
AND A.PENALTY_SEQNO = B.PENALTY_SEQNO
|
|
AND B.DOU_YN = '0'
|
|
GROUP BY
|
|
TO_CHAR(RECEIPT_DATE,'YYYY-MM')
|
|
UNION ALL
|
|
SELECT MOTION_ID,
|
|
'' S_DATE,
|
|
SUM(CASE MOTION_ID WHEN '51' THEN CNT51
|
|
WHEN '53' THEN CNT53
|
|
WHEN '71'
|
|
THEN CNT71
|
|
END) CNT
|
|
FROM (
|
|
SELECT CASE B.MOTION_ID WHEN '51' THEN '51'
|
|
WHEN '52' THEN '51'
|
|
WHEN '53' THEN '53'
|
|
WHEN '54' THEN '53'
|
|
WHEN '71' THEN '71'
|
|
WHEN '72' THEN '71'
|
|
END MOTION_ID,
|
|
CASE WHEN B.MOTION_ID IN ('51','52') THEN 1 END CNT51,
|
|
CASE WHEN B.MOTION_ID IN ('53','54') THEN 1 END CNT53,
|
|
CASE WHEN B.MOTION_ID IN ('71','72') THEN 1 END CNT71
|
|
FROM SEND_INFO A, PENALTY_DETAIL_INFO_DAMO B
|
|
WHERE SEND_DATE = #{notifiDate}
|
|
AND A.PENALTY_MANAGE_YEAR = B.PENALTY_MANAGE_YEAR
|
|
AND A.PENALTY_SEQNO = B.PENALTY_SEQNO
|
|
)
|
|
WHERE MOTION_ID IS NOT NULL
|
|
GROUP BY MOTION_ID
|
|
UNION ALL
|
|
SELECT '00' MOTION_ID,
|
|
'' S_DATE,
|
|
COUNT(*) CNT
|
|
FROM SEND_INFO A, PENALTY_DETAIL_INFO_DAMO B
|
|
WHERE SEND_DATE = #{notifiDate}
|
|
AND A.PENALTY_MANAGE_YEAR = B.PENALTY_MANAGE_YEAR
|
|
AND A.PENALTY_SEQNO = B.PENALTY_SEQNO
|
|
AND NOT EXISTS( SELECT 1 FROM RECEIPT_INFO T
|
|
WHERE A.PENALTY_MANAGE_YEAR = T.PENALTY_MANAGE_YEAR
|
|
AND A.PENALTY_SEQNO = T.PENALTY_SEQNO)
|
|
AND B.MOTION_ID NOT IN ('51','52','53','54','71','72'))K
|
|
</select>
|
|
|
|
<!-- 고지년월별 과태료 상세-List[FN58] -->
|
|
<select id="findFinePenaltyDtlList" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFinePenaltyDtlList-resultMap">
|
|
<if test="notifi.equals('91')">
|
|
SELECT TO_CHAR(RECEIPT_DATE,'YYYYMMDD') AS S_DATE,
|
|
D.CAR_NO,
|
|
D.YEAR||D.MONTH||D.DAY||D.WORK_TIMES PASS_DATE,
|
|
D.FARE_OFFICE_ID,
|
|
(select booth_full_name from booth_code_info T where D.BOOTH_ID =T.booth_id and D.FARE_OFFICE_ID = T.FARE_OFFICE_ID) BOOTH_ID,
|
|
D.OWNER,
|
|
'수납완료'
|
|
MOTION_ID,
|
|
LAVY_AMOUNT,
|
|
F.ADDRESS_NAME||' '||F.ADDRESS_NUMBER ADDR
|
|
FROM SEND_INFO A, RECEIPT_INFO B, PENALTY_DETAIL_INFO_DAMO D,
|
|
DEFAULT_CARS_TRANS_INFO_DAMO F
|
|
WHERE SEND_DATE = to_date(#{notifiDate}, 'yyyymmdd')
|
|
AND A.PENALTY_MANAGE_YEAR=B.PENALTY_MANAGE_YEAR
|
|
AND A.PENALTY_SEQNO = B.PENALTY_SEQNO
|
|
AND A.PENALTY_MANAGE_YEAR=D.PENALTY_MANAGE_YEAR
|
|
AND A.PENALTY_SEQNO = D.PENALTY_SEQNO
|
|
AND D.WORKER_ID = F.WORKER_ID
|
|
AND D.FARE_OFFICE_ID = F.FARE_OFFICE_ID
|
|
AND D.BOOTH_ID = F.BOOTH_ID
|
|
AND D.YEAR = F.YEAR
|
|
AND D.MONTH = F.MONTH
|
|
AND D.DAY = F.DAY
|
|
AND D.WORK_TIMES = F.WORK_TIMES
|
|
AND D.SEQNO = F.SEQNO
|
|
AND B.DOU_YN = '0'
|
|
AND B.RECEIPT_DATE = TO_DATE(#{sendDate},'YYYY-MM')
|
|
ORDER BY B.RECEIPT_DATE
|
|
</if>
|
|
<if test="notifi.equals('00')">
|
|
SELECT ''S_DATE,
|
|
B.CAR_NO,
|
|
'미납' MOTION_ID,
|
|
FARE_OFFICE_ID,
|
|
(select booth_full_name from booth_code_info T where B.BOOTH_ID =T.booth_id and B.FARE_OFFICE_ID = T.FARE_OFFICE_ID) BOOTH_ID,
|
|
B.OWNER,
|
|
YEAR||MONTH||DAY||WORK_TIMES PASS_DATE,
|
|
LAVY_AMOUNT,
|
|
H.ADDRESS_NAME||' '||H.ADDRESS_NUMBER ADDR
|
|
FROM SEND_INFO A, PENALTY_DETAIL_INFO_DAMO B, PENALTY_HEAD_INFO_DAMO H
|
|
WHERE SEND_DATE =
|
|
to_date(#{notifiDate}, 'yyyymmdd')
|
|
AND A.PENALTY_MANAGE_YEAR=B.PENALTY_MANAGE_YEAR
|
|
AND A.PENALTY_SEQNO = B.PENALTY_SEQNO
|
|
AND H.CAR_NO=B.CAR_NO
|
|
AND H.ENC_RESIDENT_NO = B.ENC_RESIDENT_NO
|
|
AND NOT EXISTS( SELECT 1 FROM RECEIPT_INFO T WHERE
|
|
A.PENALTY_MANAGE_YEAr=T.PENALTY_MANAGE_YEAr
|
|
AND A.PENALTY_SEQNO = T.PENALTY_SEQNO)
|
|
AND B.MOTION_ID NOT IN ('51','52','53','54','71','72')
|
|
group by b.car_no,b.MOTION_ID,FARE_OFFICE_ID,BOOTH_ID,B.OWNER,YEAR||MONTH||DAY||WORK_TIMES,LAVY_AMOUNT,H.ADDRESS_NAME||' '||H.ADDRESS_NUMBER
|
|
</if>
|
|
<if test="!notifi.equals('91') and !notifi.equals('00')">
|
|
SELECT DISTINCT ''S_DATE,
|
|
B.CAR_NO,
|
|
YEAR||MONTH||DAY||WORK_TIMES PASS_DATE,
|
|
FARE_OFFICE_ID,
|
|
(select booth_full_name from booth_code_info T where B.BOOTH_ID =T.booth_id and B.FARE_OFFICE_ID = T.FARE_OFFICE_ID) BOOTH_ID,
|
|
B.OWNER,
|
|
(SELECT MOTION_FULL_NAME FROM MOTION_CODE_INFO T WHERE MOTION_ID = SUBSTR(b.motion_id,1,1)||'1') MOTION_ID,
|
|
LAVY_AMOUNT,
|
|
H.ADDRESS_NAME||' '||H.ADDRESS_NUMBER ADDR
|
|
FROM SEND_INFO A, PENALTY_DETAIL_INFO_DAMO B,
|
|
PENALTY_HEAD_INFO_DAMO H
|
|
WHERE SEND_DATE = to_date(#{notifiDate}, 'yyyymmdd')
|
|
AND A.PENALTY_MANAGE_YEAR=B.PENALTY_MANAGE_YEAR
|
|
AND A.PENALTY_SEQNO = B.PENALTY_SEQNO
|
|
AND B.MOTION_ID IN ('51','52','53','54','71','72')
|
|
AND B.MOTION_ID LIKE SUBSTR(#{notifi},1,1)||'%'
|
|
AND H.CAR_NO=B.CAR_NO
|
|
AND H.ENC_RESIDENT_NO = B.ENC_RESIDENT_NO
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 혼잡통행료 과테료 미납현황[FN59] -->
|
|
<select id="findFineNonPayCon" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineNonPayCon-resultMap">
|
|
<if test="dtType.equals('01')">
|
|
select c.year,c.month
|
|
,c.ct a_cnt,c.amt a_amt
|
|
,NVL(cc.ct,0) a_ago_cnt,NVL(cc.amt,0) a_ago_amt
|
|
,NVL(d.ct,0) r_cnt,NVL(d.amt,0) r_amt
|
|
,NVL(dd.ct,0) r_ago_cnt,NVL(dd.amt,0) r_ago_amt
|
|
,NVL(a.ct,0) y_cnt,NVL(a.amt,0) y_amt
|
|
,NVL(aa.ct,0) y_ago_cnt,NVL(aa.amt,0) y_ago_amt
|
|
,NVL(e.ct,0) d_cnt,NVL(e.amt,0) d_amt
|
|
,NVL(b.ct,0) n_cnt,NVL(b.amt,0) n_amt from
|
|
(select year,month,count(*)
|
|
ct,nvl(sum(nvl(lavy_amount,0)),0) amt from PENALTY_DETAIL_INFO_DAMO a, send_info b where a.penalty_manage_year =
|
|
b.penalty_manage_year
|
|
and
|
|
a.penalty_seqno = b.penalty_seqno and RECEIPT_YN = '1' and b.motion_id = '21'
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
and a.fare_office_id like #{fareOfficeId}
|
|
</if>
|
|
and notice_id <![CDATA[<> ]]>
|
|
'99' group by year,month) a,
|
|
(select to_char(to_date(year||month,'yyyymm')+31,'yyyymm') year,count(*) ct,nvl(sum(nvl(lavy_amount,0)),0)
|
|
amt from PENALTY_DETAIL_INFO_DAMO a,
|
|
send_info b where a.penalty_manage_year = b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno and
|
|
RECEIPT_YN = '1' and b.motion_id = '21'
|
|
and year||month between #{inStDate} AND #{inEdDate}
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
and a.fare_office_id like #{fareOfficeId}
|
|
</if>
|
|
and notice_id <![CDATA[<> ]]>
|
|
'99' group by year,month) aa,
|
|
(select year,month,count(*)ct,nvl(sum(nvl(lavy_amount,0)),0) amt from PENALTY_DETAIL_INFO_DAMO a, send_info b
|
|
where a.penalty_manage_year =
|
|
b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno and RECEIPT_YN = '0'
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
and a.fare_office_id like #{fareOfficeId}
|
|
</if>
|
|
and b.motion_id = '21'
|
|
and notice_id <![CDATA[<> ]]>
|
|
'99' group by year,month) b,
|
|
(select a.year,a.month,a.year||a.month yemon,count(*) ct, nvl(sum(nvl(lavy_amount,0)),0) amt
|
|
from
|
|
PENALTY_DETAIL_INFO_DAMO a,
|
|
send_info b
|
|
where a.penalty_manage_year = b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
and
|
|
a.year||a.month between #{inStDate} AND #{inEdDate}
|
|
and b.motion_id = '21'
|
|
group by a.year,a.month) c,
|
|
(select
|
|
to_char(to_date(year||month,'yyyymm')+31,'yyyymm') year,count(*) ct, nvl(sum(nvl(lavy_amount,0)),0) amt
|
|
from PENALTY_DETAIL_INFO_DAMO a,
|
|
send_info b
|
|
where a.penalty_manage_year = b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
and a.year||a.month between
|
|
#{inStDate} AND #{inEdDate}
|
|
and b.motion_id = '21'
|
|
group by a.year,a.month) cc,
|
|
(select a.year,a.month,count(*)
|
|
ct,nvl(sum(nvl(lavy_amount,0)),0) amt
|
|
from PENALTY_DETAIL_INFO_DAMO a,
|
|
send_info b
|
|
where a.penalty_manage_year = b.penalty_manage_year
|
|
and
|
|
a.penalty_seqno = b.penalty_seqno
|
|
and a.year||a.month between #{inStDate} AND #{inEdDate}
|
|
and a.motion_id = '52'
|
|
and b.motion_id = '21'
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
and a.fare_office_id like #{fareOfficeId}
|
|
</if>
|
|
and notice_id = '99'
|
|
and notice_wrong_id = '01'
|
|
group by year,month) d,
|
|
(select to_char(to_date(year||month,'yyyymm')+31,'yyyymm')
|
|
year,count(*) ct,nvl(sum(nvl(lavy_amount,0)),0) amt
|
|
from PENALTY_DETAIL_INFO_DAMO a,
|
|
send_info b
|
|
where a.penalty_manage_year =
|
|
b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
and a.year||a.month between #{inStDate} AND #{inEdDate}
|
|
and a.motion_id = '52'
|
|
and b.motion_id = '21'
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
and a.fare_office_id like #{fareOfficeId}
|
|
</if>
|
|
and notice_id = '99'
|
|
and notice_wrong_id = '01'
|
|
group by year,month) dd,
|
|
(select year,month,count(*) ct,nvl(sum(nvl(lavy_amount,0)),0) amt
|
|
from PENALTY_DETAIL_INFO_DAMO
|
|
where year||month between #{inStDate} AND #{inEdDate}
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
and fare_office_id like #{fareOfficeId}
|
|
</if>
|
|
and motion_id not in ('91', '52')
|
|
and c_loss = '1'
|
|
group by year,month) e
|
|
where c.year= b.year(+)
|
|
and c.month = b.month(+)
|
|
and c.year =
|
|
a.year(+)
|
|
and c.month = a.month(+)
|
|
and c.year = d.year(+)
|
|
and c.month = d.month(+)
|
|
and c.year = e.year(+)
|
|
and c.month = e.month(+)
|
|
and c.yemon
|
|
= aa.year(+)
|
|
and c.yemon = cc.year(+)
|
|
and c.yemon = dd.year(+)
|
|
order by c.year,c.month
|
|
</if>
|
|
<if test="dtType.equals('02')">
|
|
select c.year,c.month
|
|
,c.ct a_cnt,c.amt a_amt
|
|
,NVL(d.ct,0) r_cnt,NVL(d.amt,0) r_amt
|
|
,NVL(dd.ct,0) r_ago_cnt,NVL(dd.amt,0) r_ago_amt
|
|
,NVL(a.ct,0) y_cnt,NVL(a.amt,0) y_amt
|
|
,NVL(aa.ct,0) y_ago_cnt,NVL(aa.amt,0) y_ago_amt
|
|
,NVL(e.ct,0) d_cnt,NVL(e.amt,0) d_amt
|
|
,NVL(b.ct,0)
|
|
n_cnt,NVL(b.amt,0) n_amt from
|
|
(select to_Char(send_date,'yyyy') year,to_Char(send_date,'mm') month,count(*)
|
|
ct,nvl(sum(nvl(lavy_amount,0)),0) amt from PENALTY_DETAIL_INFO_DAMO a,
|
|
send_info b where a.penalty_manage_year = b.penalty_manage_year
|
|
and
|
|
a.penalty_seqno = b.penalty_seqno and RECEIPT_YN = '1' and b.motion_id = '21'
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
and a.fare_office_id like #{fareOfficeId}
|
|
</if>
|
|
and notice_id <![CDATA[<> ]]>
|
|
'99' group by to_Char(send_date,'yyyy') ,to_Char(send_date,'mm')) a,
|
|
(select to_char(send_date+31,'yyyymm') year,count(*)
|
|
ct,nvl(sum(nvl(lavy_amount,0)),0) amt from PENALTY_DETAIL_INFO_DAMO a, send_info b where
|
|
a.penalty_manage_year = b.penalty_manage_year
|
|
and
|
|
a.penalty_seqno = b.penalty_seqno and RECEIPT_YN = '1' and b.motion_id = '21'
|
|
and to_Char(send_date,'yyyy') between #{inStDate} AND
|
|
#{inEdDate}
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
and a.fare_office_id like #{fareOfficeId}
|
|
</if>
|
|
and notice_id <![CDATA[<> ]]>
|
|
'99' group by to_Char(send_date+31,'yyyymm')) aa,
|
|
(select to_Char(send_date,'yyyy') year,to_Char(send_date,'mm')
|
|
month,count(*)ct,nvl(sum(nvl(lavy_amount,0)),0) amt from PENALTY_DETAIL_INFO_DAMO a,
|
|
send_info b where a.penalty_manage_year =
|
|
b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno and RECEIPT_YN = '0'
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
and a.fare_office_id like #{fareOfficeId}
|
|
</if>
|
|
and b.motion_id = '21'
|
|
and notice_id <![CDATA[<> ]]>
|
|
'99' group by to_Char(send_date,'yyyy'),to_Char(send_date,'mm')) b,
|
|
(select to_Char(send_date,'yyyy') year,to_Char(send_date,'mm')
|
|
month,to_Char(send_date,'yyyymm') yemon,count(*) ct,
|
|
nvl(sum(nvl(lavy_amount,0)),0) amt
|
|
from PENALTY_DETAIL_INFO_DAMO a,
|
|
send_info b
|
|
where
|
|
a.penalty_manage_year = b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
and a.year||a.month between #{inStDate} AND #{inEdDate}
|
|
and b.motion_id = '21'
|
|
group by to_Char(send_date,'yyyy'),to_Char(send_date,'mm'),to_Char(send_date,'yyyymm')) c,
|
|
(select
|
|
to_Char(send_date,'yyyy') year,to_Char(send_date,'mm') month,count(*) ct,nvl(sum(nvl(lavy_amount,0)),0) amt
|
|
from PENALTY_DETAIL_INFO_DAMO a,
|
|
send_info b
|
|
where a.penalty_manage_year = b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
and to_Char(send_date,'yyyymm')
|
|
between #{inStDate} AND #{inEdDate}
|
|
and a.motion_id = '52'
|
|
and b.motion_id = '21'
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
and a.fare_office_id like #{fareOfficeId}
|
|
</if>
|
|
and notice_id = '99'
|
|
and notice_wrong_id = '01'
|
|
group by to_Char(send_date,'yyyy'),to_Char(send_date,'mm')) d,
|
|
(select
|
|
to_char(send_date+31,'yyyymm') year,count(*) ct,nvl(sum(nvl(lavy_amount,0)),0) amt
|
|
from PENALTY_DETAIL_INFO_DAMO a,
|
|
send_info b
|
|
where
|
|
a.penalty_manage_year = b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
and to_char(send_date,'yyyymm') between #{inStDate} AND
|
|
#{inEdDate}
|
|
and a.motion_id = '52'
|
|
and b.motion_id = '21'
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
and a.fare_office_id like #{fareOfficeId}
|
|
</if>
|
|
and notice_id = '99'
|
|
and notice_wrong_id = '01'
|
|
group by to_char(send_date+31,'yyyymm')) dd,
|
|
(select to_Char(send_date,'yyyy')
|
|
year,to_Char(send_date,'mm') month,count(*) ct,nvl(sum(nvl(lavy_amount,0)),0) amt
|
|
from PENALTY_DETAIL_INFO_DAMO a,send_info b
|
|
where
|
|
a.penalty_manage_year = b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
and to_Char(send_date,'yyyymm') between #{inStDate} AND
|
|
#{inEdDate}
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
and a.fare_office_id like #{fareOfficeId}
|
|
</if>
|
|
and a.motion_id not in ('91', '52')
|
|
and c_loss = '1'
|
|
group by to_Char(send_date,'yyyy'),to_Char(send_date,'mm')) e
|
|
where c.year= b.year(+)
|
|
and c.month = b.month(+)
|
|
and c.year = a.year(+)
|
|
and c.month = a.month(+)
|
|
and c.year = d.year(+)
|
|
and c.month = d.month(+)
|
|
and c.year =
|
|
e.year(+)
|
|
and c.month = e.month(+)
|
|
and c.yemon = aa.year(+)
|
|
and c.yemon = dd.year(+)
|
|
order by c.year,c.month
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 과태료 수입금 명세 내역 년도 조회[FN60] -->
|
|
<select id="findFineAdList" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineAdList-resultMap">
|
|
select substr(ymd,5,4) day,
|
|
sum(case when t_year = to_char(to_number(to_char(sysdate,'yyyy')) - 0) then cnt else 0 end) cnt1,
|
|
sum(case when
|
|
t_year = to_char(to_number(to_char(sysdate,'yyyy')) - 1) then cnt else 0 end) cnt2,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 2) then cnt else 0 end) cnt3,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 3) then cnt else 0 end) cnt4,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 4) then cnt else 0 end) cnt5,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 5) then cnt else 0 end) cnt6,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 6) then cnt else 0 end) cnt7,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 7) then cnt else 0 end) cnt8,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 8) then cnt else 0 end) cnt9,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 9) then cnt else 0 end) cnt10,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 10) then cnt else 0 end) cnt11,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 11) then cnt else 0 end) cnt12,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 12) then cnt else 0 end) cnt13,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 13) then cnt else 0 end) cnt14,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 14) then cnt else 0 end) cnt15,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 15) then cnt else 0 end) cnt16,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 16) then cnt else 0 end) cnt17,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 17) then cnt else 0 end) cnt18,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 18) then cnt else 0 end) cnt19,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 19) then cnt else 0 end) cnt20,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 0) then amount/1000 else 0 end) amount1,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 1) then amount/1000 else 0 end) amount2,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 2) then amount/1000 else 0 end) amount3,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 3) then amount/1000 else 0 end) amount4,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 4) then amount/1000 else 0 end) amount5,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 5) then amount/1000 else 0 end) amount6,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 6) then amount/1000 else 0 end) amount7,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 7) then amount/1000 else 0 end) amount8,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 8) then amount/1000 else 0 end) amount9,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 9) then amount/1000 else 0 end) amount10,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 10) then amount/1000 else 0 end) amount11,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 11) then amount/1000 else 0 end) amount12,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 12) then amount/1000 else 0 end) amount13,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 13) then amount/1000 else 0 end) amount14,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 14) then amount/1000 else 0 end) amount15,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 15) then amount/1000 else 0 end) amount16,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 16) then amount/1000 else 0 end) amount17,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 17) then amount/1000 else 0 end) amount18,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 18) then amount/1000 else 0 end) amount19,
|
|
sum(case when t_year =
|
|
to_char(to_number(to_char(sysdate,'yyyy')) - 19) then amount/1000 else 0 end) amount20
|
|
from (
|
|
select substr(ymd,1,4) t_year, ymd, 0 cnt, 0
|
|
amount
|
|
from (
|
|
select distinct to_char(to_date(to_char(to_number(to_char(sysdate,'yyyy'))-19)||'0101', 'yyyymmdd') + no - 1, 'yyyymmdd') ymd
|
|
from ( select level no
|
|
from dual
|
|
connect by level <![CDATA[<= ]]>
|
|
to_date(to_char(sysdate,'yyyy')||'1231', 'yyyymmdd')
|
|
- to_date(to_char(to_number(to_char(sysdate,'yyyy'))-19)||'0101', 'yyyymmdd') + 1
|
|
)
|
|
)
|
|
where substr(ymd,5,2) like substr(#{inRadDate},5,2)
|
|
<if test="dtType==1">
|
|
union all
|
|
select
|
|
decode('1' , '1', b.year,to_char(c.send_date,'yyyy')) as t_year,to_char(a.receipt_date,'yyyymmdd')ymd,
|
|
count(*) as cnt,
|
|
nvl(sum(nvl(a.receipt_amount,0)),0) as amount
|
|
from receipt_info a,
|
|
PENALTY_DETAIL_INFO_DAMO b,
|
|
( select penalty_manage_year, penalty_seqno,
|
|
max(send_date) send_date, max(motion_id) motion_id
|
|
from send_info t
|
|
where #{dtType} = '1'
|
|
group by penalty_manage_year, penalty_seqno
|
|
) c
|
|
where a.penalty_manage_year = b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
and a.penalty_manage_year = c.penalty_manage_year
|
|
and a.penalty_seqno = c.penalty_seqno
|
|
and a.receipt_date <![CDATA[>= ]]>
|
|
to_date(#{inRadDate} || '01', 'yyyymmdd')
|
|
and a.receipt_date <![CDATA[< ]]>
|
|
last_day(to_date(#{inRadDate} || '01', 'yyyymmdd')) + 1
|
|
and a.dou_yn = '0'
|
|
group by decode('1' , '1', b.year,to_char(send_date,'yyyy')),
|
|
to_char(a.receipt_date,'yyyymmdd')
|
|
)
|
|
</if>
|
|
<if test="dtType!=1">
|
|
union all
|
|
select
|
|
decode('2' , '1', b.year,to_char(c.send_date,'yyyy')) as t_year,to_char(a.receipt_date,'yyyymmdd')ymd,
|
|
count(*) as cnt,
|
|
nvl(sum(nvl(a.receipt_amount,0)),0) as amount
|
|
from receipt_info a,
|
|
PENALTY_DETAIL_INFO_DAMO b,
|
|
( select penalty_manage_year, penalty_seqno,
|
|
max(send_date) send_date, max(motion_id) motion_id
|
|
from send_info t
|
|
where ( ( #{dtType} = '1' )
|
|
or ( #{dtType} = '3' and motion_id = '31' )
|
|
or ( #{dtType} = '2' and motion_id = '21' )
|
|
or ( #{dtType} = '4' and motion_id = '41' )
|
|
)
|
|
group by penalty_manage_year, penalty_seqno
|
|
) c
|
|
where a.penalty_manage_year = b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
and a.penalty_manage_year = c.penalty_manage_year
|
|
and a.penalty_seqno = c.penalty_seqno
|
|
and a.receipt_date <![CDATA[>= ]]>
|
|
to_date(#{inRadDate} || '01', 'yyyymmdd')
|
|
and a.receipt_date <![CDATA[< ]]>
|
|
last_day(to_date(#{inRadDate} || '01', 'yyyymmdd')) + 1
|
|
and a.dou_yn = '0'
|
|
group by decode('2' , '1', b.year,to_char(send_date,'yyyy')),
|
|
to_char(a.receipt_date,'yyyymmdd')
|
|
)
|
|
</if>
|
|
group by substr(ymd,5,4)
|
|
order by 1
|
|
</select>
|
|
|
|
<!-- 과태료 수입금 명세 내역 관리[FN61] -->
|
|
<select id="findFineProDtlList" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineProDtlList-resultMap">
|
|
select a.year
|
|
, a.receipt_date
|
|
, max(a.mng_no_01) mng_no_01
|
|
, max(a.mng_no_02) mng_no_02
|
|
, max(a.mng_no_03) mng_no_03
|
|
, max(a.mng_no_04)
|
|
mng_no_04
|
|
, max(a.mng_no_05) mng_no_05
|
|
, max(a.mng_no_06) mng_no_06
|
|
, max(a.mng_no_07) mng_no_07
|
|
, max(a.mng_no_08) mng_no_08
|
|
,
|
|
max(a.mng_no_09) mng_no_09
|
|
, max(a.mng_no_10) mng_no_10
|
|
, decode(a.mng_no, 0, a.mng_cnt, 0) mng_cnt
|
|
, decode(a.mng_no, 0, a.mng_amt, 0)
|
|
mng_amt
|
|
from (
|
|
select a.year
|
|
, a.receipt_date
|
|
, decode(mod(rn, 10), 1, mng_no, '') mng_no_01
|
|
, decode(mod(rn, 10), 2, mng_no, '') mng_no_02
|
|
,
|
|
decode(mod(rn, 10), 3, mng_no, '') mng_no_03
|
|
, decode(mod(rn, 10), 4, mng_no, '') mng_no_04
|
|
, decode(mod(rn, 10), 5, mng_no, '') mng_no_05
|
|
,
|
|
decode(mod(rn, 10), 6, mng_no, '') mng_no_06
|
|
, decode(mod(rn, 10), 7, mng_no, '') mng_no_07
|
|
, decode(mod(rn, 10), 8, mng_no, '') mng_no_08
|
|
,
|
|
decode(mod(rn, 10), 9, mng_no, '') mng_no_09
|
|
, decode(mod(rn, 10), 0, mng_no, '') mng_no_10
|
|
, count(1) over (partition by a.year,
|
|
a.receipt_date order by 1) mng_cnt
|
|
, sum(receipt_amount) over (partition by a.year, a.receipt_date order by 1) mng_amt
|
|
, trunc(rn / 10) -
|
|
decode(mod(rn, 10), 0, 1, 0) mng_no
|
|
from (
|
|
select d.year,
|
|
to_char(r.receipt_date,'yyyymmdd') receipt_date,
|
|
d.penalty_manage_year,
|
|
d.penalty_seqno,
|
|
fun_get_penalty_amt(d.penalty_manage_year, d.penalty_seqno, to_char(sysdate, 'yyyymmdd'), '') lavy_amount
|
|
, row_number()
|
|
over (partition by d.year, to_char(r.receipt_date,'yyyymmdd') order by d.year, to_char(r.receipt_date,'yyyymmdd'),
|
|
d.penalty_manage_year,
|
|
d.penalty_seqno) rn
|
|
, substr(d.penalty_manage_year, 3, 2) || '-' || to_char(d.penalty_seqno) mng_no
|
|
, r.receipt_amount
|
|
from
|
|
PENALTY_DETAIL_INFO_DAMO d,
|
|
receipt_info r
|
|
where d.penalty_manage_year = r.penalty_manage_year
|
|
and d.penalty_seqno = r.penalty_seqno
|
|
and d.year <![CDATA[>= ]]>
|
|
#{inStDate}
|
|
and d.year <![CDATA[<= ]]>
|
|
#{inEdDate}
|
|
and to_char(r.receipt_date,'yyyymm') = #{inRadDate}
|
|
and r.dou_ret_yn = '0'
|
|
) a
|
|
) a
|
|
group by a.year
|
|
, a.receipt_date
|
|
, a.mng_cnt
|
|
,
|
|
a.mng_amt
|
|
, a.mng_no
|
|
order by a.year
|
|
, a.receipt_date
|
|
, a.mng_no
|
|
</select>
|
|
|
|
<!-- 과태료 수입금 명세 내역 관리[FN62] -->
|
|
<select id="findFineProTotCon" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineProTotCon-resultMap">
|
|
<if test="dtType==1">
|
|
SELECT A.YEAR||'/'||A.MONTH||'/'||A.DAY as t_year,
|
|
SUM(A.v_levy_amount1) as p_levy_1ho,
|
|
SUM(A.v_levy_amount3) as p_levy_3ho,
|
|
SUM(A.v_receipt_amount1) as p_receipt_1ho,
|
|
SUM(A.v_receipt_amount3) as p_receipt_3ho,
|
|
SUM(A.v_overfare1) as p_over_1ho,
|
|
SUM(A.v_overfare3)
|
|
as p_over_3ho
|
|
FROM (
|
|
SELECT T.YEAR, T.MONTH, T.DAY,
|
|
nvl(nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_CARD_BEFORE_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_CARD_AFTER_INCOME, 0)),0)
|
|
+
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_COUPON_SALE, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_CARD_BEFORE_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_CARD_AFTER_INCOME,
|
|
0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_COUPON_SALE, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_K_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_K_CARD_SUN_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_K_CARD_WHO_INCOME, 0)),0)
|
|
+
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_K_COUPON_SALE_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_K_CASH_INCOME, 0)),0)
|
|
+
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_K_CARD_SUN_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_K_CARD_WHO_INCOME,
|
|
0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_K_COUPON_SALE_INCOME, 0)),0) -
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_REPAY_AMOUNT,
|
|
0)),0) -
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_REPAY_AMOUNT, 0)),0),0) as v_levy_amount1,
|
|
nvl(nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_CARD_BEFORE_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_CARD_AFTER_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_COUPON_SALE, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_CARD_BEFORE_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_CARD_AFTER_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_COUPON_SALE, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_K_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_K_CARD_SUN_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_K_CARD_WHO_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_K_COUPON_SALE_INCOME,
|
|
0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_K_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_K_CARD_SUN_INCOME,
|
|
0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_K_CARD_WHO_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03',
|
|
OUT_K_COUPON_SALE_INCOME, 0)),0) -
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_REPAY_AMOUNT, 0)),0) -
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03',
|
|
OUT_REPAY_AMOUNT, 0)),0),0) as v_levy_amount3,
|
|
0 as v_receipt_amount1,
|
|
0 as v_receipt_amount3,
|
|
0 as
|
|
v_overfare1,
|
|
0 as v_overfare3
|
|
FROM day_adjust_info T
|
|
WHERE T.YEAR = #{year}
|
|
and T.MONTH = #{mon}
|
|
GROUP BY T.YEAR, T.MONTH,
|
|
T.DAY
|
|
UNION
|
|
SELECT to_char(R.RECEIPT_DATE, 'yyyy'), to_char(R.RECEIPT_DATE, 'mm'), to_char(R.RECEIPT_DATE, 'dd'),
|
|
0 as v_levy_amount1,
|
|
0 as v_levy_amount3,
|
|
SUM(decode(D.FARE_OFFICE_ID, '01', R.RECEIPT_AMOUNT, 0)) as v_receipt_amount1,
|
|
SUM(decode(D.FARE_OFFICE_ID, '03', R.RECEIPT_AMOUNT, 0)) as v_receipt_amount3,
|
|
0 as v_overfare1,
|
|
0 as v_overfare3
|
|
FROM PENALTY_DETAIL_INFO_DAMO D,
|
|
RECEIPT_INFO R
|
|
WHERE D.PENALTY_MANAGE_YEAR = R.PENALTY_MANAGE_YEAR
|
|
AND D.PENALTY_SEQNO = R.PENALTY_SEQNO
|
|
and
|
|
to_char(R.RECEIPT_DATE, 'yyyy') = #{year}
|
|
and to_char(R.RECEIPT_DATE, 'mm') = #{mon}
|
|
and r.dou_yn = '0'
|
|
GROUP BY to_char(R.RECEIPT_DATE,
|
|
'yyyy'), to_char(R.RECEIPT_DATE, 'mm'), to_char(R.RECEIPT_DATE, 'dd')
|
|
UNION
|
|
SELECT O.YEAR, O.MONTH, O.DAY,
|
|
0 as v_levy_amount1,
|
|
0
|
|
as v_levy_amount3,
|
|
0 as v_receipt_amount1,
|
|
0 as v_receipt_amount3,
|
|
SUM(decode(O.FARE_OFFICE_ID, '01',
|
|
O.OVERFARE_AMOUNT, 0)) as v_overfare1,
|
|
SUM(decode(O.FARE_OFFICE_ID, '03', O.OVERFARE_AMOUNT, 0)) as v_overfare3
|
|
FROM
|
|
OVERFARE_INFO_DAMO O
|
|
WHERE O.YEAR = #{year}
|
|
AND O.MONTH = #{mon}
|
|
AND O.OVERFARE_KBN = '1'
|
|
AND O.REFUND_KBN = '0'
|
|
and o.delete_yn = '0'
|
|
GROUP BY
|
|
O.YEAR, O.MONTH, O.DAY
|
|
) A
|
|
GROUP BY A.YEAR, A.MONTH, A.DAY
|
|
ORDER BY A.YEAR, A.MONTH
|
|
</if>
|
|
<if test="dtType==2">
|
|
SELECT A.YEAR||'/'||A.MONTH as t_year,
|
|
SUM(A.v_levy_amount1) as p_levy_1ho,
|
|
SUM(A.v_levy_amount3) as p_levy_3ho,
|
|
SUM(A.v_receipt_amount1) as p_receipt_1ho,
|
|
SUM(A.v_receipt_amount3) as p_receipt_3ho,
|
|
SUM(A.v_overfare1) as p_over_1ho,
|
|
SUM(A.v_overfare3)
|
|
as p_over_3ho
|
|
FROM (
|
|
SELECT T.YEAR, T.MONTH,
|
|
nvl(nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_CARD_BEFORE_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_CARD_AFTER_INCOME, 0)),0)
|
|
+
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_COUPON_SALE, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_CARD_BEFORE_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_CARD_AFTER_INCOME,
|
|
0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_COUPON_SALE, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_K_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_K_CARD_SUN_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_K_CARD_WHO_INCOME, 0)),0)
|
|
+
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_K_COUPON_SALE_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_K_CASH_INCOME, 0)),0)
|
|
+
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_K_CARD_SUN_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_K_CARD_WHO_INCOME,
|
|
0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_K_COUPON_SALE_INCOME, 0)),0) -
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_REPAY_AMOUNT,
|
|
0)),0) -
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_REPAY_AMOUNT, 0)),0),0) as v_levy_amount1,
|
|
nvl(nvl(SUM(decode(T.FARE_OFFICE_ID, '03',
|
|
IN_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_CARD_BEFORE_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03',
|
|
IN_CARD_AFTER_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_COUPON_SALE, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03',
|
|
OUT_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_CARD_BEFORE_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03',
|
|
OUT_CARD_AFTER_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_COUPON_SALE, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03',
|
|
IN_K_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_K_CARD_SUN_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03',
|
|
IN_K_CARD_WHO_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_K_COUPON_SALE_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID,
|
|
'03', OUT_K_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_K_CARD_SUN_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID,
|
|
'03', OUT_K_CARD_WHO_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_K_COUPON_SALE_INCOME, 0)),0) -
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_REPAY_AMOUNT, 0)),0) -
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_REPAY_AMOUNT, 0)),0),0) as
|
|
v_levy_amount3,
|
|
0 as v_receipt_amount1,
|
|
0 as v_receipt_amount3,
|
|
0 as v_overfare1,
|
|
0 as v_overfare3
|
|
FROM day_adjust_info T
|
|
WHERE T.YEAR =
|
|
#{year}
|
|
GROUP BY T.YEAR, T.MONTH
|
|
UNION
|
|
SELECT to_char(R.RECEIPT_DATE, 'yyyy'), to_char(R.RECEIPT_DATE, 'mm'),
|
|
0 as v_levy_amount1,
|
|
0 as
|
|
v_levy_amount3,
|
|
SUM(decode(D.FARE_OFFICE_ID, '01', R.RECEIPT_AMOUNT, 0)) as v_receipt_amount1,
|
|
SUM(decode(D.FARE_OFFICE_ID, '03',
|
|
R.RECEIPT_AMOUNT, 0)) as v_receipt_amount3,
|
|
0 as v_overfare1,
|
|
0 as v_overfare3
|
|
FROM PENALTY_DETAIL_INFO_DAMO D,
|
|
RECEIPT_INFO R
|
|
WHERE
|
|
D.PENALTY_MANAGE_YEAR = R.PENALTY_MANAGE_YEAR
|
|
AND D.PENALTY_SEQNO = R.PENALTY_SEQNO
|
|
and to_char(R.RECEIPT_DATE, 'yyyy') = #{year}
|
|
and
|
|
r.dou_yn = '0'
|
|
GROUP BY to_char(R.RECEIPT_DATE, 'yyyy'), to_char(R.RECEIPT_DATE, 'mm')
|
|
UNION
|
|
SELECT O.YEAR, O.MONTH,
|
|
0 as v_levy_amount1,
|
|
0 as
|
|
v_levy_amount3,
|
|
0 as v_receipt_amount1,
|
|
0 as v_receipt_amount3,
|
|
SUM(decode(O.FARE_OFFICE_ID, '01', O.OVERFARE_AMOUNT, 0)) as v_overfare1,
|
|
SUM(decode(O.FARE_OFFICE_ID, '03', O.OVERFARE_AMOUNT, 0)) as v_overfare3
|
|
FROM OVERFARE_INFO_DAMO O
|
|
WHERE O.YEAR = #{year}
|
|
AND O.OVERFARE_KBN =
|
|
'1'
|
|
AND O.REFUND_KBN = '0'
|
|
and o.delete_yn = '0'
|
|
GROUP BY O.YEAR, O.MONTH
|
|
) A
|
|
GROUP BY A.YEAR, A.MONTH
|
|
ORDER BY A.YEAR, A.MONTH
|
|
</if>
|
|
</select>
|
|
|
|
<!-- 혼잡통행료 수입금 총괄현황 누계[FN62] -->
|
|
<select id="findFineProTotConCnt" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineProTotConCnt-resultMap">
|
|
SELECT A.YEAR as t_year,
|
|
SUM(A.v_levy_amount1) as p_levy_1ho,
|
|
SUM(A.v_levy_amount3) as p_levy_3ho,
|
|
SUM(A.v_receipt_amount1) as p_receipt_1ho,
|
|
SUM(A.v_receipt_amount3) as p_receipt_3ho,
|
|
SUM(A.v_overfare1) as p_over_1ho,
|
|
SUM(A.v_overfare3) as p_over_3ho
|
|
FROM (
|
|
SELECT T.YEAR,
|
|
nvl(nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_CARD_BEFORE_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_CARD_AFTER_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_COUPON_SALE, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_CARD_BEFORE_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_CARD_AFTER_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_COUPON_SALE, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_K_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_K_CARD_SUN_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_K_CARD_WHO_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_K_COUPON_SALE_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_K_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_K_CARD_SUN_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_K_CARD_WHO_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_K_COUPON_SALE_INCOME, 0)),0) -
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', IN_REPAY_AMOUNT, 0)),0) -
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '01', OUT_REPAY_AMOUNT, 0)),0),0) as v_levy_amount1,
|
|
nvl(nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_CARD_BEFORE_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_CARD_AFTER_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_COUPON_SALE, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_CARD_BEFORE_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_CARD_AFTER_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_COUPON_SALE, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_K_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_K_CARD_SUN_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_K_CARD_WHO_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_K_COUPON_SALE_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_K_CASH_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_K_CARD_SUN_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_K_CARD_WHO_INCOME, 0)),0) +
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_K_COUPON_SALE_INCOME, 0)),0) -
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', IN_REPAY_AMOUNT, 0)),0) -
|
|
nvl(SUM(decode(T.FARE_OFFICE_ID, '03', OUT_REPAY_AMOUNT, 0)),0),0) as v_levy_amount3,
|
|
0 as v_receipt_amount1,
|
|
0 as v_receipt_amount3,
|
|
0 as v_overfare1,
|
|
0 as v_overfare3
|
|
FROM day_adjust_info T
|
|
WHERE T.YEAR = #{year}
|
|
AND T.MONTH <![CDATA[<= ]]>
|
|
#{mon}
|
|
GROUP BY T.YEAR
|
|
UNION
|
|
SELECT to_char(R.RECEIPT_DATE, 'yyyy'),
|
|
0 as v_levy_amount1,
|
|
0 as v_levy_amount3,
|
|
SUM(decode(D.FARE_OFFICE_ID, '01', R.RECEIPT_AMOUNT, 0)) as v_receipt_amount1,
|
|
SUM(decode(D.FARE_OFFICE_ID, '03', R.RECEIPT_AMOUNT, 0)) as v_receipt_amount3,
|
|
0 as v_overfare1,
|
|
0 as v_overfare3
|
|
FROM PENALTY_DETAIL_INFO_DAMO D,
|
|
RECEIPT_INFO R
|
|
WHERE D.PENALTY_MANAGE_YEAR = R.PENALTY_MANAGE_YEAR
|
|
AND D.PENALTY_SEQNO = R.PENALTY_SEQNO
|
|
and to_char(R.RECEIPT_DATE, 'yyyy') = #{year}
|
|
AND to_char(R.RECEIPT_DATE, 'MM') <![CDATA[<= ]]>
|
|
#{mon}
|
|
and r.dou_yn = '0'
|
|
GROUP BY to_char(R.RECEIPT_DATE, 'yyyy'), to_char(R.RECEIPT_DATE, 'mm')
|
|
UNION
|
|
SELECT O.YEAR,
|
|
0 as v_levy_amount1,
|
|
0 as v_levy_amount3,
|
|
0 as v_receipt_amount1,
|
|
0 as v_receipt_amount3,
|
|
SUM(decode(O.FARE_OFFICE_ID, '01', O.OVERFARE_AMOUNT, 0)) as v_overfare1,
|
|
SUM(decode(O.FARE_OFFICE_ID, '03', O.OVERFARE_AMOUNT, 0)) as v_overfare3
|
|
FROM OVERFARE_INFO_DAMO O
|
|
WHERE O.YEAR = #{year}
|
|
AND O.MONTH <![CDATA[<= ]]>
|
|
#{mon}
|
|
AND O.OVERFARE_KBN = '1'
|
|
AND O.REFUND_KBN = '0'
|
|
and o.delete_yn = '0'
|
|
GROUP BY O.YEAR
|
|
) A
|
|
GROUP BY A.YEAR
|
|
ORDER BY A.YEAR
|
|
</select>
|
|
|
|
<!-- 과태료 미징수 현황[FN63] -->
|
|
<select id="findFineUnCol" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineUnCol-resultMap">
|
|
SELECT SUBSTR(a.penalty_manage_year,3,2)||'-'||a.penalty_seqno manageNum,
|
|
a.motion_id,
|
|
( SELECT MOTION_FULL_NAME FROM MOTION_CODE_INFO T
|
|
WHERE a.motion_id = T.MOTION_ID) MOTION_NM,
|
|
a.car_no,
|
|
b.car_type_name,
|
|
a.year||'/'||a.month||'/'||a.day||' '||SUBSTR(a.work_times,1,2)||':'||SUBSTR(a.work_times,3,2)||':'||SUBSTR(a.work_times,5,2) passdate,
|
|
b.owner,
|
|
b.post_no1||'-'||b.post_no2
|
|
postno,
|
|
b.address_name||b.address_number address_name,
|
|
to_char(a.notice_date,'yyyy/mm/dd') as t_notice_date,
|
|
FUN_GET_PENALTY_AMT (a.PENALTY_MANAGE_YEAR, a.PENALTY_SEQNO, TO_CHAR (SYSDATE, 'YYYYMMDD'), a.MOTION_ID) as lavy_amount
|
|
FROM
|
|
PENALTY_HEAD_INFO_DAMO b,
|
|
PENALTY_DETAIL_INFO_DAMO a
|
|
WHERE b.car_no = a.car_no
|
|
AND b.ENC_RESIDENT_NO = a.ENC_RESIDENT_NO
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
AND a.fare_office_id = #{fareOfficeId}
|
|
</if>
|
|
AND a.year||a.month||a.day between #{inStDate} AND #{inEdDate}
|
|
<if test="!motionId.equals('all')">
|
|
AND a.motion_id like #{motionId}||'%'
|
|
</if>
|
|
<if test="selCarNum!=null and !selCarNum.equals('')">
|
|
AND a.car_no like #{selCarNum}||'%'
|
|
</if>
|
|
and a.notice_id <![CDATA[<> ]]>
|
|
'99'
|
|
and (a.notice_wrong_id <![CDATA[<> ]]>
|
|
'01' or a.notice_wrong_id is null)
|
|
and a.receipt_yn = '0'
|
|
<if test="defectYn!=null and defectYn==1">
|
|
and a.c_loss NOT IN #{defectYn}
|
|
</if>
|
|
order by passdate
|
|
</select>
|
|
|
|
<!-- 과태료 징수 현황 [FN64] -->
|
|
<select id="findFinePanCon" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFinePanCon-resultMap">
|
|
SELECT substr(b.penalty_manage_year, 3, 2)|| '-' ||to_char(b.penalty_seqno) as seq_no,
|
|
b.BEFORE_MOTION_ID,
|
|
( SELECT MOTION_FULL_NAME FROM
|
|
MOTION_CODE_INFO T WHERE B.BEFORE_MOTION_ID = T.MOTION_ID) MOTION_NM,
|
|
b.car_no, a.car_type_name,
|
|
DGUARD.DECRYPT('ENC','COL',A.ENC_RESIDENT_NO) AS RESIDENT_NO,
|
|
A.CAR_NO,
|
|
b.year||'/'|| b.month ||'/'||b.day||' '||SUBSTR(b.work_times,1,2)||':'||SUBSTR(b.work_times,3,2)||':'||SUBSTR(b.work_times,5,2) passdate,
|
|
a.owner, a.post_no1 ||'-'|| a.post_no2
|
|
as post_no,
|
|
a.address_name || A.ADDRESS_NUMBER AS F_add,
|
|
TO_CHAR(S.SEND_DATE,'YYYYMMDD') SEND_DATE,
|
|
b.lavy_amount,
|
|
TO_CHAR(R.receipt_date,'yyyymmdd') as nobbu_date
|
|
FROM PENALTY_HEAD_INFO_DAMO a,
|
|
PENALTY_DETAIL_INFO_DAMO b,
|
|
RECEIPT_INFO R,
|
|
SEND_INFO S
|
|
WHERE a.car_no = b.car_no
|
|
AND a.ENC_RESIDENT_NO = b.ENC_RESIDENT_NO
|
|
AND B.PENALTY_MANAGE_YEAR = R.PENALTY_MANAGE_YEAR(+)
|
|
AND B.PENALTY_SEQNO = R.PENALTY_SEQNO(+)
|
|
AND B.PENALTY_MANAGE_YEAR = S.PENALTY_MANAGE_YEAR(+)
|
|
AND B.PENALTY_SEQNO = S.PENALTY_SEQNO(+)
|
|
AND B.BEFORE_MOTION_ID = S.MOTION_ID(+)
|
|
and B.motion_id = '91'
|
|
AND B.RECEIPT_YN = '1'
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
AND B.fare_office_id = #{fareOfficeId}
|
|
</if>
|
|
<if test="!motionId.equals('all')">
|
|
AND B.before_motion_id like #{motionId}||'%'
|
|
</if>
|
|
<if test="selCarNum!=null and !selCarNum.equals('')">
|
|
AND B.car_no like #{selCarNum}||'%'
|
|
</if>
|
|
AND B.year || b.month || b.day BETWEEN #{inStDate} AND #{inEdDate}
|
|
AND S.SEND_DATE IS NOT NULL
|
|
order by passdate
|
|
</select>
|
|
<!-- 월별 실적 현황[FN65] -->
|
|
<select id="findFineMonData" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineMonData-resultMap">
|
|
WITH TMP_DATE AS (
|
|
select * from(
|
|
SELECT distinct TO_CHAR(TO_DATE('100001','YYYYMM') + (LEVEL-1),'YYYYMM') AS DATES
|
|
FROM DUAL CONNECT BY LEVEL <![CDATA[<= ]]>
|
|
(TO_DATE('999912','YYYYMM') - TO_DATE('100001','YYYYMM') + 1)
|
|
order by DATES)
|
|
where dates between #{inStDate} and #{inEdDate}
|
|
), TMP_KBN AS (
|
|
SELECT '사전통지발송'AS motion_NM ,'21' AS motion_id FROM DUAL
|
|
UNION SELECT '1차고지발송','31' AS motion_id FROM DUAL
|
|
UNION SELECT '2차고지발송','41' AS motion_id FROM DUAL
|
|
)
|
|
SELECT SUBSTR(TB.DATES,0,4) year,SUBSTR(TB.DATES,5,2) month,TB.motion_nm, TB.motion_id, NVL(TA.CNT,0) cnt, NVL(TA.lavy_amt,0) lavy_amt
|
|
FROM
|
|
(
|
|
select a.year||a.month yenth
|
|
,( SELECT MOTION_FULL_NAME FROM MOTION_CODE_INFO T WHERE b.motion_id = T.MOTION_ID) MOTION_NM
|
|
, count(a.year) cnt
|
|
, sum(a.pass_amount + a.fine_amount) lavy_amt
|
|
from PENALTY_DETAIL_INFO_DAMO a
|
|
, send_info b
|
|
where a.year || a.month between #{inStDate} and #{inEdDate}
|
|
and a.penalty_manage_year = b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
and a.fare_office_id = ( #{fareOfficeId} )
|
|
</if>
|
|
group by a.year, a.month,b.motion_id
|
|
) TA
|
|
, (SELECT * FROM TMP_DATE, TMP_KBN) TB
|
|
WHERE TB.DATES = TA.yenth(+)
|
|
and TB.motion_NM = TA.motion_NM(+)
|
|
and ( (#{motionId} = 'all' and Tb.motion_id in ('21','31','41') )
|
|
or ( #{motionId} = '02' and Tb.motion_id in ('21') )
|
|
or ( #{motionId} = '03' and Tb.motion_id in ('31') )
|
|
or ( #{motionId} = '04' and Tb.motion_id in ('41') )
|
|
)
|
|
ORDER BY year,month,motion_id,cnt desc,lavy_amt desc
|
|
</select>
|
|
|
|
<!--과태료 이중수납 내역 및 환불 [FN66] -->
|
|
<select id="findFineDouCon" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineDouCon-resultMap">
|
|
SELECT SUBSTR(A.PENALTY_MANAGE_YEAR,3,2)||'-'||A.PENALTY_SEQNO PENALTY_NUM,
|
|
A.PENALTY_MANAGE_YEAR AS MANAGE_YEAR,
|
|
A.PENALTY_SEQNO AS
|
|
MANAGE_NUM,
|
|
A.YEAR||'/'|| A.MONTH||'/'||A.DAY||' '||SUBSTR(A.WORK_TIMES,0,2)||':'||SUBSTR(A.WORK_TIMES,3,2)||':'||SUBSTR(A.WORK_TIMES,5,2) PASS_DATE,
|
|
A.FARE_OFFICE_FULL_NAME, A.CAR_NO,
|
|
A.LAVY_AMOUNT,
|
|
DGUARD.DECRYPT('ENC','COL',A.ENC_RESIDENT_NO) AS RESIDENT_NO,
|
|
B.MAX_RECEIPT_DATE,B.MAX_RECEIPT_AGENCY,B.MAX_MOTION_FULL_NAME,
|
|
B.MIN_RECEIPT_DATE,B.MIN_RECEIPT_AGENCY,B.MIN_MOTION_FULL_NAME,
|
|
C.OWNER,
|
|
C.POST_NO POST_NUM,
|
|
C.ADDRESS_NAME||C.ADDRESS_NUMBER ADDRESS_NAME
|
|
FROM ( SELECT B.PENALTY_MANAGE_YEAR,
|
|
B.PENALTY_SEQNO,
|
|
B.WORKER_ID,
|
|
B.FARE_OFFICE_ID,
|
|
B.BOOTH_ID,
|
|
B.SEQNO,
|
|
B.YEAR, B.MONTH, B.DAY,
|
|
B.WORK_TIMES,
|
|
C.FARE_OFFICE_FULL_NAME, B.CAR_NO, B.LAVY_AMOUNT,
|
|
B.ENC_RESIDENT_NO
|
|
FROM PENALTY_DETAIL_INFO_DAMO B,
|
|
RECEIPT_INFO A,
|
|
FARE_OFFICE_CODE_INFO C
|
|
WHERE B.PENALTY_MANAGE_YEAR = A.PENALTY_MANAGE_YEAR
|
|
AND B.PENALTY_SEQNO = A.PENALTY_SEQNO
|
|
AND B.FARE_OFFICE_ID = C.FARE_OFFICE_ID
|
|
<if test="dtType==1">
|
|
AND b.PASS_DATE between #{inStDate} AND #{inEdDate}
|
|
</if>
|
|
<if test="dtType==2">
|
|
AND A.RECEIPT_DATE BETWEEN TO_DATE(#{inStDate},'YYYYMMDD') AND TO_DATE(#{inEdDate},'YYYYMMDD')+1
|
|
</if>
|
|
and b.motion_id = '91'
|
|
and b.receipt_yn = '1'
|
|
AND b.double_receipt_yn = '1'
|
|
GROUP BY b.penalty_manage_year, b.penalty_seqno, b.fare_office_id, b.year, b.month,b.worker_id,
|
|
b.day,
|
|
b.work_times,
|
|
b.booth_id,
|
|
b.seqno,
|
|
c.fare_office_full_name,
|
|
b.car_no,
|
|
b.lavy_amount,
|
|
B.ENC_RESIDENT_NO
|
|
) a,
|
|
(select PENALTY_MANAGE_YEAR, PENALTY_SEQNO
|
|
,to_char(max(receipt_date)keep(dense_rank first order by receipt_date desc),'yyyymmdd') MAX_receipt_date
|
|
,max(RECEIPT_AGENCY)keep(dense_rank first order by receipt_date desc) MAX_RECEIPT_AGENCY
|
|
,max(b.MOTION_FULL_NAME)keep(dense_rank first
|
|
order by receipt_date desc) max_MOTION_FULL_NAME
|
|
,to_char(min(receipt_date)keep(dense_rank first order by receipt_date ),'yyyymmdd')
|
|
MIN_receipt_date
|
|
,min(RECEIPT_AGENCY)keep(dense_rank first order by receipt_date ) MIN_RECEIPT_AGENCY
|
|
,min(b.MOTION_FULL_NAME)keep(dense_rank first order by receipt_date ) min_MOTION_FULL_NAME
|
|
from receipt_info a,MOTION_CODE_INFO b
|
|
where
|
|
dou_yn = '1'
|
|
AND RECEIPT_ID = b.MOTION_ID
|
|
group by PENALTY_MANAGE_YEAR,PENALTY_SEQNO) b,
|
|
DEFAULT_CARS_TRANS_INFO_DAMO c
|
|
where a.penalty_manage_year = b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
and a.worker_id = c.worker_id
|
|
and a.fare_office_id = c.fare_office_id
|
|
and a.booth_id = c.booth_id
|
|
and a.year = c.year
|
|
and a.month = c.month
|
|
and a.day = c.day
|
|
and a.work_times = c.work_times
|
|
and a.seqno = c.seqno
|
|
</select>
|
|
|
|
<!--과태료 이중수납 내역 및 환불 Popup[FN66] -->
|
|
<select id="findFineDouConPop" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineDouConPop-resultMap">
|
|
SELECT PENALTY_MANAGE_YEAR,
|
|
PENALTY_SEQNO,
|
|
SUBSTR(A.PENALTY_MANAGE_YEAR,3,2)||'-'||A.PENALTY_SEQNO conNum,
|
|
to_char(A.RECEIPT_DATE,'yyyymmdd') RECEIPT_DATE,
|
|
A.RECEIPT_AMOUNT,
|
|
A.RECEIPT_AGENCY,
|
|
A.RECEIPT_ID,
|
|
( SELECT MOTION_FULL_NAME FROM MOTION_CODE_INFO T WHERE A.RECEIPT_ID = T.MOTION_ID) MOTION_NM,
|
|
A.RECEIPT_PROCESS_KBN,
|
|
A.OCR_RECEIPT_YN,
|
|
A.RECEIPT_KBN,
|
|
A.RECEIPT_SIDO,
|
|
A.RECEIPT_KIGWAN,
|
|
A.RECEIPT_DONG,
|
|
A.RECEIPT_ACCOUNT,
|
|
A.RECEIPT_GWAMOK,
|
|
A.RECEIPT_SEMOK,
|
|
A.CREATE_DATE,
|
|
A.CREATER,
|
|
A.UPDATE_DATE,
|
|
A.UPDATER,
|
|
A.DOU_RET_YN,
|
|
A.DOU_RET_DATE,
|
|
A.DOU_RET_REMARK,
|
|
A.DOU_RET_PERSON
|
|
FROM
|
|
RECEIPT_INFO A
|
|
WHERE A.PENALTY_MANAGE_YEAR = #{manageYear}
|
|
AND A.PENALTY_SEQNO = #{manageNum}
|
|
</select>
|
|
|
|
<update id="updateFineDouConPop" parameterType="cfs.fine.vo.FinePmVO">
|
|
update PENALTY_DETAIL_INFO_DAMO
|
|
set double_receipt_yn = '0',
|
|
double_receipt_date = null,
|
|
update_date = sysdate,
|
|
updater = #{sessionUserNm}
|
|
where penalty_manage_year = #{manageYear}
|
|
and penalty_seqno = #{manageNum}
|
|
</update>
|
|
|
|
<update id="updateFineDouConPopSec" parameterType="cfs.fine.vo.FinePmVO">
|
|
update receipt_info
|
|
set dou_yn = '0',
|
|
dou_ret_yn = '1',
|
|
dou_ret_remark=#{retReason},
|
|
dou_ret_person=#{retPerson},
|
|
dou_ret_date=to_char(sysdate,'yyyymmdd'),
|
|
updater=#{sessionUserNm},
|
|
update_date=sysdate
|
|
where penalty_manage_year
|
|
= #{manageYear}
|
|
and penalty_seqno = #{manageNum}
|
|
and to_char(receipt_date,'yyyymmdd') = #{sendDate}
|
|
and dou_ret_yn = '0'
|
|
and dou_yn = '1'
|
|
</update>
|
|
|
|
<update id="mergeFineDouConPop" parameterType="cfs.fine.vo.FinePmVO">
|
|
MERGE INTO double_receipt_return_info a
|
|
USING PENALTY_DETAIL_INFO_DAMO b
|
|
ON (b.year||month =
|
|
a.yymm
|
|
and b.penalty_manage_year= #{manageYear}
|
|
and b.penalty_seqno= #{manageNum})
|
|
WHEN MATCHED THEN
|
|
update set
|
|
return_count = return_count + 1,
|
|
update_date = sysdate,
|
|
updater = #{sessionUserNm}
|
|
WHEN NOT MATCHED THEN
|
|
insert (yymm, return_count, remarks,
|
|
create_date, creater,
|
|
update_date, updater)
|
|
values((year||month), 1, #{retReason}, sysdate, #{sessionUserNm}, sysdate, #{sessionUserNm}) where
|
|
penalty_manage_year= #{manageYear} and penalty_seqno=
|
|
#{manageNum}
|
|
</update>
|
|
|
|
|
|
<!--과태료 이중수납 환불현황[FN67] -->
|
|
<select id="findFineDouRoll" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineDouRoll-resultMap">
|
|
select aa.t_year||'/'||aa.t_month as tt_year
|
|
,count(n_cnt) as nn_cnt
|
|
,max(r_cnt) as r_cnt
|
|
,count(n_cnt)-max(r_cnt) as no_action
|
|
from
|
|
(SELECT a.penalty_manage_year, a.penalty_seqno, a.year
|
|
as t_year, a.month as t_month, count(*) n_cnt,nvl(max(c.return_count),0) r_cnt
|
|
FROM PENALTY_DETAIL_INFO_DAMO a,
|
|
receipt_info b,
|
|
double_receipt_return_info c
|
|
WHERE a.penalty_manage_year = b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
and a.year||month = c.yymm(+)
|
|
and a.PASS_DATE between #{inStDate}||'01' and #{inEdDate}||'31'
|
|
group by a.penalty_manage_year, a.penalty_seqno, a.year, a.month
|
|
having count(*) > 1) aa
|
|
group by aa.t_year, aa.t_month
|
|
order by t_year
|
|
</select>
|
|
|
|
<!--과태료 이중수납 환불현황[FN67]Sec -->
|
|
<select id="findFineDouRollSec" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineDouRollSec-resultMap">
|
|
select aa.t_year as year, NVL(count(n_cnt),0) as
|
|
nn_cnt,round(NVL(count(n_cnt)/12,0),2) as nn_rate,NVL(max(bb.d_cnt),0) as
|
|
d_cnt,round(NVL(max(bb.d_cnt)/12,0),2) as d_rate
|
|
from
|
|
(SELECT
|
|
a.penalty_manage_year, a.penalty_seqno, a.year as t_year, count(*) n_cnt
|
|
FROM PENALTY_DETAIL_INFO_DAMO a,
|
|
receipt_info b
|
|
WHERE
|
|
a.penalty_manage_year = b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
and a.year between #{inStDate} and #{inEdDate}
|
|
group by
|
|
a.penalty_manage_year, a.penalty_seqno, a.year
|
|
having count(*) > 1) aa,( select SUBSTR(YYMM,0,4) d_year,SUM(return_count) d_cnt from
|
|
double_receipt_return_info
|
|
group by SUBSTR(YYMM,0,4)) bb
|
|
where
|
|
aa.t_year = bb.d_year(+)
|
|
group by aa.t_year
|
|
</select>
|
|
|
|
<!--과태료 환불현황 및 취소[FN68] -->
|
|
<select id="findFineRollCancel" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineRollCancel-resultMap">
|
|
select a.penalty_manage_year,
|
|
a.penalty_seqno,
|
|
subStr(a.penalty_manage_year,3,4)||'-'||a.penalty_seqno as con_Num,
|
|
a.year||a.month||a.day
|
|
pass_date,
|
|
a.car_no,
|
|
a.owner,
|
|
to_char(b.receipt_date, 'yyyymmdd') as r_date,
|
|
b.dou_ret_date,
|
|
b.receipt_id,
|
|
( SELECT MOTION_FULL_NAME FROM
|
|
MOTION_CODE_INFO T WHERE b.RECEIPT_ID = T.MOTION_ID) MOTION_NM,
|
|
b.receipt_amount,
|
|
b.dou_ret_remark,
|
|
b.dou_ret_person
|
|
from PENALTY_DETAIL_INFO_DAMO a,
|
|
receipt_info b
|
|
where a.penalty_manage_year = b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
<if test="dtType==2">
|
|
and a.PASS_DATE between #{inStDate}||'01' and #{inEdDate}||'31'
|
|
</if>
|
|
<if test="dtType==1">
|
|
and dou_ret_date between #{inStDate}||'01' and #{inEdDate}||'31'
|
|
</if>
|
|
and a.car_no like #{carNum}||'%'
|
|
and b.dou_ret_yn = '1'
|
|
</select>
|
|
|
|
<!--과태료 환불현황 및 취소[FN68]Popup -->
|
|
<select id="findFineRollCancelPop" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineRollCancelPop-resultMap">
|
|
SELECT PENALTY_MANAGE_YEAR,
|
|
PENALTY_SEQNO,
|
|
SUBSTR(A.PENALTY_MANAGE_YEAR,3,2)||'-'||A.PENALTY_SEQNO conNum,
|
|
to_char(A.RECEIPT_DATE,'yyyymmdd') RECEIPT_DATE,
|
|
A.RECEIPT_AMOUNT,
|
|
A.RECEIPT_AGENCY,
|
|
A.RECEIPT_ID,
|
|
( SELECT MOTION_FULL_NAME FROM MOTION_CODE_INFO T WHERE A.RECEIPT_ID = T.MOTION_ID) MOTION_NM,
|
|
A.RECEIPT_PROCESS_KBN,
|
|
A.OCR_RECEIPT_YN,
|
|
A.RECEIPT_KBN,
|
|
A.RECEIPT_SIDO,
|
|
A.RECEIPT_KIGWAN,
|
|
A.RECEIPT_DONG,
|
|
A.RECEIPT_ACCOUNT,
|
|
A.RECEIPT_GWAMOK,
|
|
A.RECEIPT_SEMOK,
|
|
A.CREATE_DATE,
|
|
A.CREATER,
|
|
A.UPDATE_DATE,
|
|
A.UPDATER,
|
|
A.DOU_RET_YN,
|
|
A.DOU_RET_DATE,
|
|
A.DOU_RET_REMARK,
|
|
A.DOU_RET_PERSON
|
|
FROM
|
|
RECEIPT_INFO A
|
|
WHERE A.PENALTY_MANAGE_YEAR = #{manageYear}
|
|
AND A.PENALTY_SEQNO = #{manageNum}
|
|
AND DOU_RET_YN ='1'
|
|
</select>
|
|
|
|
<!--과태료 환불현황 및 취소[FN68]Merge Check -->
|
|
<select id="findFineRollCheck" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFineRollCheck-resultMap">
|
|
select yymm from double_receipt_return_info
|
|
where
|
|
yymm=(select year||month
|
|
from PENALTY_DETAIL_INFO_DAMO
|
|
where penalty_manage_year=#{manageYear}
|
|
and penalty_seqno=#{manageNum})
|
|
order by yymm desc
|
|
</select>
|
|
|
|
<update id="updateRollCancelPop" parameterType="cfs.fine.vo.FinePmVO">
|
|
update PENALTY_DETAIL_INFO_DAMO
|
|
set double_receipt_yn = '1',
|
|
double_receipt_date = (SELECT
|
|
RECEIPT_DATE
|
|
FROM RECEIPT_INFO
|
|
WHERE PENALTY_MANAGE_YEAR = #{manageYear}
|
|
AND PENALTY_SEQNO = #{manageNum}
|
|
AND DOU_RET_YN ='1'),
|
|
update_date = sysdate,
|
|
updater = #{sessionUserNm}
|
|
where penalty_manage_year = #{manageYear}
|
|
and penalty_seqno = #{manageNum}
|
|
</update>
|
|
|
|
<update id="updateRollCancelPopSec" parameterType="cfs.fine.vo.FinePmVO">
|
|
update receipt_info
|
|
set dou_yn = '1',
|
|
dou_ret_yn = '0',
|
|
dou_ret_remark='',
|
|
dou_ret_person='',
|
|
dou_ret_date='',
|
|
updater=#{sessionUserNm},
|
|
update_date=sysdate
|
|
where penalty_manage_year = #{manageYear}
|
|
and penalty_seqno = #{manageNum}
|
|
and to_char(receipt_date,'yyyymmdd') = #{sendDate}
|
|
and dou_ret_yn = '1'
|
|
and dou_yn = '1'
|
|
</update>
|
|
|
|
<update id="mergeRollCancelPop" parameterType="cfs.fine.vo.FinePmVO">
|
|
update double_receipt_return_info
|
|
set return_count = return_count - 1,
|
|
update_date =
|
|
sysdate,
|
|
updater = #{sessionUserNm}
|
|
where yymm =(select year||month
|
|
from PENALTY_DETAIL_INFO_DAMO
|
|
where penalty_manage_year = #{manageYear}
|
|
and penalty_seqno = #{manageNum})
|
|
|
|
</update>
|
|
|
|
<delete id="mergeRollCancelPopDel" parameterType="cfs.fine.vo.FinePmVO">
|
|
delete double_receipt_return_info where yymm = (select year||month
|
|
from
|
|
PENALTY_DETAIL_INFO_DAMO
|
|
where penalty_manage_year = #{manageYear}
|
|
and penalty_seqno = #{manageNum})
|
|
|
|
</delete>
|
|
|
|
<update id="FineupdateSec" parameterType="cfs.fine.vo.FinePmVO">
|
|
update receipt_info set dou_ret_remark = #{retReason},
|
|
update_date = sysdate,
|
|
updater = #{sessionUserNm}
|
|
where dou_ret_yn='1'
|
|
and penalty_manage_year = #{manageYear}
|
|
and penalty_seqno = #{manageNum}
|
|
</update>
|
|
|
|
|
|
<!--과태료 납부 비교[FN69] -->
|
|
<select id="findFinePenCompare" parameterType="cfs.fine.vo.FinePmVO" resultMap="findFinePenCompare-resultMap">
|
|
SELECT B.PENALTY_MANAGE_YEAR
|
|
, B.FARE_OFFICE_ID
|
|
, SUM(CASE WHEN RECEIPT_DT <![CDATA[<= ]]>
|
|
END21 THEN 1 ELSE 0 END) CNT1
|
|
, SUM(CASE WHEN RECEIPT_DT <![CDATA[<= ]]>
|
|
END21 THEN B.FINE_AMOUNT + B.PASS_AMOUNT ELSE 0 END) AMOUNT1
|
|
, SUM(CASE WHEN RECEIPT_DT <![CDATA[<= ]]>
|
|
END21 THEN 1 ELSE 0 END) CNT21
|
|
, SUM(CASE WHEN RECEIPT_DT <![CDATA[<= ]]>
|
|
END21 THEN RECEIPT_AMOUNT ELSE 0 END) AMOUNT21
|
|
, SUM(CASE WHEN RECEIPT_DT <![CDATA[> ]]>
|
|
END31 THEN 1 ELSE 0 END) OCNT31
|
|
, SUM(CASE WHEN RECEIPT_DT <![CDATA[> ]]>
|
|
END31 THEN B.FINE_AMOUNT + B.PASS_AMOUNT ELSE 0 END) OAMOUNT31
|
|
, SUM(CASE WHEN RECEIPT_DT <![CDATA[> ]]>
|
|
END31 THEN 1 ELSE 0 END) CNT31
|
|
, SUM(CASE WHEN RECEIPT_DT <![CDATA[> ]]>
|
|
END31 THEN RECEIPT_AMOUNT ELSE 0 END) AMOUNT31
|
|
, SUM(CASE WHEN RECEIPT_DT <![CDATA[> ]]>
|
|
END21 AND RECEIPT_DT <![CDATA[<= ]]>
|
|
END31 THEN 1 ELSE 0 END) CNT0
|
|
, SUM(CASE WHEN RECEIPT_DT <![CDATA[> ]]>
|
|
END21 AND RECEIPT_DT <![CDATA[<= ]]>
|
|
END31 THEN RECEIPT_AMOUNT ELSE 0 END) AMOUNT0
|
|
FROM PENALTY_STEP_INFO A
|
|
, PENALTY_DETAIL_INFO_DAMO B
|
|
WHERE A.PENALTY_MANAGE_YEAR =
|
|
B.PENALTY_MANAGE_YEAR
|
|
AND A.PENALTY_SEQNO = B.PENALTY_SEQNO
|
|
AND ( (#{dtType} = '1' AND A.YEAR||A.MONTH||A.DAY BETWEEN #{inStDate} AND
|
|
#{inEdDate})
|
|
OR (#{dtType} = '2' AND A.RECEIPT_DT BETWEEN #{inStDate} AND #{inEdDate})
|
|
)
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
AND B.FARE_OFFICE_ID IN #{fareOfficeId}
|
|
</if>
|
|
GROUP BY B.PENALTY_MANAGE_YEAR, B.FARE_OFFICE_ID
|
|
</select>
|
|
|
|
<!--가산금 부과별 납부현황[FN70] -->
|
|
<select id="findAddiCon" parameterType="cfs.fine.vo.FinePmVO" resultMap="findAddiCon-resultMap">
|
|
select year,
|
|
fare_office_id,
|
|
year||fare_office_id as GROUP_CODE,
|
|
trunc(( sum(datediff) / sum(cnt) ) / 30, 1) as ElapsedDate,
|
|
sum(cnt) as cnt,
|
|
sum(lavy_amount) as lavy_amount,
|
|
( select to_number(col2) from code_detail_info
|
|
where code_id = '03'
|
|
and sub_cd = '02'
|
|
and trim(sub_nm) = (
|
|
select max(sub_nm)
|
|
from code_detail_info
|
|
where code_id = '03'
|
|
and sub_cd = '02'
|
|
and sub_nm <![CDATA[<= ]]>
|
|
to_char(sysdate,'yyyymmdd'))
|
|
) as rate
|
|
from (
|
|
select b.penalty_manage_year
|
|
, b.penalty_seqno
|
|
, decode(#{dtType}, '1', b.year,
|
|
to_char(a.receipt_date,'yyyy')) year
|
|
, b.fare_office_id
|
|
, a.receipt_date
|
|
- ( select min(x.delivery_date) from send_info x
|
|
where x.penalty_manage_year = b.penalty_manage_year
|
|
and x.penalty_seqno = b.penalty_seqno
|
|
and x.motion_id in ('21','23','25','27')
|
|
and x.send_no = ( select max(send_no) from send_info y
|
|
where x.penalty_manage_year = y.penalty_manage_year
|
|
and x.penalty_seqno = y.penalty_seqno
|
|
and x.motion_id = y.motion_id
|
|
) group by x.penalty_seqno
|
|
) datediff
|
|
, 1 cnt
|
|
, a.receipt_amount lavy_amount
|
|
, row_number() over (partition by
|
|
b.penalty_manage_year, b.penalty_seqno order by 1) rn
|
|
from receipt_info a, PENALTY_DETAIL_INFO_DAMO b
|
|
where a.penalty_manage_year =
|
|
b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
and ( (#{dtType} = '1' and b.year || b.month || b.day between #{inStDate} and
|
|
#{inEdDate})
|
|
or (#{dtType} = '2' and ( a.receipt_date <![CDATA[>= ]]>
|
|
to_date(#{inStDate}, 'yyyymmdd')
|
|
and a.receipt_date <![CDATA[< ]]>
|
|
to_date(#{inEdDate}, 'yyyymmdd') ) )
|
|
)
|
|
and b.motion_id = '91'
|
|
<if test="fareOfficeId!=null and !fareOfficeId.equals('')">
|
|
and b.fare_office_id in (#{fareOfficeId})
|
|
</if>
|
|
)
|
|
where rn = 1
|
|
group by year, fare_office_id
|
|
order by year desc
|
|
</select>
|
|
|
|
<!--미납금 납부 전망[FN71] -->
|
|
<select id="findNonpayCompl" parameterType="cfs.fine.vo.FinePmVO" resultMap="findNonpayCompl-resultMap">
|
|
select year
|
|
, month
|
|
, count(1) cnt
|
|
, sum(lavy_amount ) lavy_amount
|
|
, sum(lavy_amount2 ) lavy_amount2
|
|
, sum(original_amount) original_amount
|
|
from (
|
|
select a.year
|
|
, a.month
|
|
, b.fare_office_id
|
|
, a.motion_id
|
|
, receipt_amount
|
|
, case when b.motion_id <![CDATA[<= ]]>
|
|
'30' then fun_get_penalty_amt(a.penalty_manage_year, a.penalty_seqno, #{inRadDate},'21')
|
|
else b.fine_amount + b.pass_amount
|
|
end
|
|
original_amount
|
|
, case when b.motion_id <![CDATA[<= ]]>
|
|
'30' then fun_get_penalty_amt(a.penalty_manage_year, a.penalty_seqno, #{inRadDate},'21')
|
|
else fun_get_penalty_amt(a.penalty_manage_year,
|
|
a.penalty_seqno, #{inRadDate},'')
|
|
end lavy_amount
|
|
, case when b.motion_id <![CDATA[<= ]]>
|
|
'30' then 0
|
|
else fun_get_penalty_amt(a.penalty_manage_year, a.penalty_seqno, #{inRadDate},'') - ( b.fine_amount + b.pass_amount )
|
|
end
|
|
lavy_amount2
|
|
, b.notice_id
|
|
, b.notice_wrong_id
|
|
from penalty_step_info a, PENALTY_DETAIL_INFO_DAMO b
|
|
where 1 = 1
|
|
and a.penalty_manage_year =
|
|
b.penalty_manage_year
|
|
and a.penalty_seqno = b.penalty_seqno
|
|
and b.motion_id not in ('91','71','51','53','20')
|
|
and not ( b.notice_id = '99'
|
|
and b.notice_wrong_id = '01' )
|
|
and a.year || a.month || a.day between #{inStDate} and #{inEdDate}
|
|
)
|
|
group by year, month
|
|
</select>
|
|
|
|
|
|
|
|
</mapper> |