diff --git a/src/main/resources/sql/mapper/fims/rent/lsctMpng-mapper.xml b/src/main/resources/sql/mapper/fims/rent/lsctMpng-mapper.xml index cf126ceb..b754973d 100644 --- a/src/main/resources/sql/mapper/fims/rent/lsctMpng-mapper.xml +++ b/src/main/resources/sql/mapper/fims/rent/lsctMpng-mapper.xml @@ -666,12 +666,13 @@ , P.RTPYR_NO , P.RTPYR_NM , LM.LSCT_MPNG_ID - , (CASE WHEN LM.DMND_YN = 'Y' AND LM.CHG_APRV_STTS_CD = 'RQ' THEN '기타(요청중)' - WHEN LM.DMND_YN = 'Y' AND LM.CHG_APRV_STTS_CD = 'RT' THEN '기타(요청취소)' - WHEN LM.DMND_YN = 'Y' AND LM.CHG_APRV_STTS_CD = 'AP' THEN '기타(승인)' - WHEN LM.DMND_YN = 'Y' AND LM.CHG_APRV_STTS_CD = 'UA' THEN '기타(미승인)' - WHEN LM.DMND_YN = 'N' AND LM.LSCT_MPNG_ID IS NOT NULL THEN '계약서등록' - ELSE '대상' + , (CASE WHEN LM.LSCT_MPNG_ID IS NOT NULL AND LM.DMND_YN = 'Y' AND LM.CHG_APRV_STTS_CD = 'RQ' THEN '승인요청(요청중)' + WHEN LM.LSCT_MPNG_ID IS NOT NULL AND LM.DMND_YN = 'Y' AND LM.CHG_APRV_STTS_CD = 'RT' THEN '승인요청(요청취소)' + WHEN LM.LSCT_MPNG_ID IS NOT NULL AND LM.DMND_YN = 'Y' AND LM.CHG_APRV_STTS_CD = 'AP' THEN '승인요청(승인)' + WHEN LM.LSCT_MPNG_ID IS NOT NULL AND LM.DMND_YN = 'Y' AND LM.CHG_APRV_STTS_CD = 'UA' THEN '승인요청(미승인)' + WHEN LM.LSCT_MPNG_ID IS NOT NULL AND LM.DMND_YN = 'N' THEN '계약서등록' + WHEN LM.LSCT_MPNG_ID IS NULL AND C.CRDN_STTS_CD BETWEEN '11' AND '45' THEN '대상' + ELSE CONCAT('기타', '(', GET_CODE_NM('FIM010',C.CRDN_STTS_CD), ')') END) AS TRGT_STTS_NM , LM.LSCT_ID , (CASE WHEN LM.ENT_ID IS NULL THEN (SELECT RE.ENT_ID FROM TB_RENT_ENT RE WHERE RE.ENT_REG_NO = P.RTPYR_NO) @@ -730,16 +731,21 @@ + + AND C.CRDN_STTS_CD BETWEEN '11' AND '45' + AND LM.LSCT_MPNG_ID IS NULL + - AND LM.LSCT_MPNG_ID IS NOT NULL - AND LM.DMND_YN = 'N' + AND LM.LSCT_MPNG_ID IS NOT NULL + AND LM.DMND_YN = 'N' - - AND LM.LSCT_MPNG_ID IS NULL + + AND LM.LSCT_MPNG_ID IS NOT NULL + AND LM.DMND_YN = 'Y' - AND LM.LSCT_MPNG_ID IS NOT NULL - AND LM.DMND_YN = 'Y' + AND C.CRDN_STTS_CD NOT BETWEEN '11' AND '45' + AND LM.LSCT_MPNG_ID IS NULL @@ -823,13 +829,12 @@ , LM.MDFCN_DT , LM.MDFR , (SELECT USER_NM FROM TB_USER X WHERE X.USER_ID = LM.MDFR) AS MDFR_NM - , (CASE WHEN LM.DMND_YN = 'N' AND LM.CHG_APRV_STTS_CD IS NULL AND C.NXRP_CRDN_LINK_YN = 'N' THEN '대상' - WHEN LM.DMND_YN = 'N' AND LM.CHG_APRV_STTS_CD = 'RT' AND C.NXRP_CRDN_LINK_YN = 'N' THEN '요청취소' - WHEN LM.DMND_YN = 'Y' AND LM.CHG_APRV_STTS_CD = 'RQ' AND C.NXRP_CRDN_LINK_YN = 'N' THEN '요청중' - WHEN LM.DMND_YN = 'Y' AND LM.CHG_APRV_STTS_CD = 'AP' AND C.NXRP_CRDN_LINK_YN = 'N' THEN '승인' - WHEN LM.DMND_YN = 'Y' AND LM.CHG_APRV_STTS_CD = 'UA' AND C.NXRP_CRDN_LINK_YN = 'N' THEN '미승인' - WHEN C.NXRP_CRDN_LINK_YN = 'Y' THEN '기타(세외수입)' - ELSE '기타' + , (CASE WHEN LM.DMND_YN = 'Y' AND LM.CHG_APRV_STTS_CD = 'AP' THEN '승인' + WHEN LM.DMND_YN = 'Y' AND LM.CHG_APRV_STTS_CD = 'UA' THEN '미승인' + WHEN LM.DMND_YN = 'Y' AND LM.CHG_APRV_STTS_CD = 'RQ' AND C.CRDN_STTS_CD BETWEEN '11' AND '45' THEN '요청중' + WHEN LM.DMND_YN = 'N' AND LM.CHG_APRV_STTS_CD = 'RT' AND C.CRDN_STTS_CD BETWEEN '11' AND '45' THEN '요청취소' + WHEN LM.DMND_YN = 'N' AND LM.CHG_APRV_STTS_CD IS NULL AND C.CRDN_STTS_CD BETWEEN '11' AND '45' THEN '대상' + ELSE CONCAT('기타', '(', GET_CODE_NM('FIM010',C.CRDN_STTS_CD), ')') END) AS TRGT_STTS_NM , RE.ENT_SE_CD , (GET_CODE_NM('FIM088', RE.ENT_SE_CD)) AS ENT_SE_NM @@ -912,33 +917,31 @@ - - AND LM.DMND_YN = 'N' - AND LM.CHG_APRV_STTS_CD IS NULL - AND C.NXRP_CRDN_LINK_YN = 'N' + + AND LM.DMND_YN = 'Y' + AND LM.CHG_APRV_STTS_CD = 'AP' - - AND LM.DMND_YN = 'N' - AND LM.CHG_APRV_STTS_CD = 'RT' - AND C.NXRP_CRDN_LINK_YN = 'N' + + AND LM.DMND_YN = 'Y' + AND LM.CHG_APRV_STTS_CD = 'UA' - AND LM.DMND_YN = 'Y' + AND LM.DMND_YN = 'Y' AND LM.CHG_APRV_STTS_CD = 'RQ' - AND C.NXRP_CRDN_LINK_YN = 'N' + AND C.CRDN_STTS_CD BETWEEN '11' AND '45' - - AND LM.DMND_YN = 'Y' - AND LM.CHG_APRV_STTS_CD = 'AP' - AND C.NXRP_CRDN_LINK_YN = 'N' + + AND LM.DMND_YN = 'N' + AND LM.CHG_APRV_STTS_CD = 'RT' + AND C.CRDN_STTS_CD BETWEEN '11' AND '45' - - AND LM.DMND_YN = 'Y' - AND LM.CHG_APRV_STTS_CD = 'UA' - AND C.NXRP_CRDN_LINK_YN = 'N' + + AND LM.DMND_YN = 'N' + AND LM.CHG_APRV_STTS_CD IS NULL + AND C.CRDN_STTS_CD BETWEEN '11' AND '45' - AND C.NXRP_CRDN_LINK_YN = 'Y' + AND C.CRDN_STTS_CD NOT BETWEEN '11' AND '45'