From 98295e3b6ef6a9ac6cdd2e845d700cde87eee418 Mon Sep 17 00:00:00 2001 From: jjh Date: Tue, 5 Dec 2023 15:36:57 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8F=99=EC=A0=81=EA=B2=80=EC=83=89=EC=8B=9C?= =?UTF-8?q?=20=EC=BF=BC=EB=A6=AC=20=EC=A0=95=EB=A0=AC(ORDER=20BY)=20?= =?UTF-8?q?=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cokr/xit/fims/cmmn/CmmnUtil.java | 32 +++++++++++++++++++ .../fims/epst/service/bean/EpostGdccBean.java | 10 ++++-- .../fims/excl/service/bean/LevyExclBean.java | 9 +++++- .../sql/mapper/fims/excl/levyExcl-mapper.xml | 9 +++--- 4 files changed, 53 insertions(+), 7 deletions(-) diff --git a/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java b/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java index e616e16b..3737a8be 100644 --- a/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java +++ b/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java @@ -17,6 +17,7 @@ import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -321,4 +322,35 @@ public class CmmnUtil { String numStr = Integer.toString(number); return convertNumberToHangul(numStr); } + + /** 카멜케이스 문자열을 스네이크케이스 문자열로 변경한다. + * @param String + * @return String + */ + public static String convertCamelCaseToSnakeCase(String camelCase) { + Pattern pattern = Pattern.compile("([a-z])([A-Z])"); + Matcher matcher = pattern.matcher(camelCase); + + String convert = matcher.replaceAll(matchResult -> { + return String.format("%s_%s", matchResult.group(1), matchResult.group(2)); + }); + + return convert.toUpperCase(); + } + + /** 스네이크케이스 문자열을 카멜케이스 문자열로 변경한다. + * @param String + * @return String + */ + public static String convertSnakeCaseToCamelCase(String snakeCase) { + Pattern compile = Pattern.compile("([a-z])_([a-z])"); + Matcher matcher = compile.matcher(snakeCase.toLowerCase()); + + String convert = matcher.replaceAll(matchResult -> { + return String.format("%s%s", matchResult.group(1).toLowerCase(), matchResult.group(2).toUpperCase()); + }); + + return convert; + } + } diff --git a/src/main/java/cokr/xit/fims/epst/service/bean/EpostGdccBean.java b/src/main/java/cokr/xit/fims/epst/service/bean/EpostGdccBean.java index 1e1edca6..63041923 100644 --- a/src/main/java/cokr/xit/fims/epst/service/bean/EpostGdccBean.java +++ b/src/main/java/cokr/xit/fims/epst/service/bean/EpostGdccBean.java @@ -8,7 +8,7 @@ import org.springframework.stereotype.Component; import cokr.xit.foundation.AbstractComponent; import cokr.xit.foundation.data.DataObject; - +import cokr.xit.fims.cmmn.CmmnUtil; import cokr.xit.fims.epst.EpostGdcc; import cokr.xit.fims.epst.EpostQuery; import cokr.xit.fims.epst.dao.EpostGdccMapper; @@ -35,11 +35,17 @@ public class EpostGdccBean extends AbstractComponent { * @return 전자우편 안내문 목록 */ public List getEpostGdccList(EpostQuery req) { + // 사용 여부 확인 if (req.getUseYN() == null) { req.setUseYN("Y"); } + // 정렬 확인 if (req.getOrderBy() == null) { - req.setOrderBy("REG_DT"); + if (req.getBy() == null) { + req.setOrderBy("REG_DT"); + } else { + req.setOrderBy(CmmnUtil.convertCamelCaseToSnakeCase(req.getBy())); + } } return epostGdccMapper.selectEpostGdccList(req); diff --git a/src/main/java/cokr/xit/fims/excl/service/bean/LevyExclBean.java b/src/main/java/cokr/xit/fims/excl/service/bean/LevyExclBean.java index 0c76bbf9..7d35a4bf 100644 --- a/src/main/java/cokr/xit/fims/excl/service/bean/LevyExclBean.java +++ b/src/main/java/cokr/xit/fims/excl/service/bean/LevyExclBean.java @@ -6,6 +6,7 @@ import javax.annotation.Resource; import org.springframework.stereotype.Component; +import cokr.xit.fims.cmmn.CmmnUtil; import cokr.xit.fims.cmmn.CrdnSttsHstry; import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean; import cokr.xit.fims.crdn.Crdn; @@ -41,11 +42,17 @@ public class LevyExclBean extends AbstractComponent { * @return 부과제외 대장 목록 */ public List getLevyExclList(LevyExclQuery req) { + // 삭제 여부 확인 if (req.getDelYn() == null) { req.setDelYn("N"); } + // 정렬 확인 if (req.getOrderBy() == null) { - req.setOrderBy("REG_DT"); + if (req.getBy() == null) { + req.setOrderBy("REG_DT"); + } else { + req.setOrderBy(CmmnUtil.convertCamelCaseToSnakeCase(req.getBy())); + } } return levyExclMapper.selectLevyExclList(req); diff --git a/src/main/resources/sql/mapper/fims/excl/levyExcl-mapper.xml b/src/main/resources/sql/mapper/fims/excl/levyExcl-mapper.xml index 072c9966..902cbcc9 100644 --- a/src/main/resources/sql/mapper/fims/excl/levyExcl-mapper.xml +++ b/src/main/resources/sql/mapper/fims/excl/levyExcl-mapper.xml @@ -8,7 +8,6 @@ ============================ --> - @@ -77,12 +76,12 @@ , CC.CVLCPT_RCPT_NO /* 민원 접수 번호 */ , CC.CVLCPT_PRCS_CD /* 민원 처리 코드 */ , CC.CVLCPT_PRCS_CMPTN_DT /* 민원 처리 완료 일시 */ + , (CONCAT(C.CRDN_YMD, C.CRDN_TM)) AS CRDN_YMD_TM /* 단속 일시 */ , (SELECT GET_CODE_NM('FIM054', LE.TASK_SE_CD) FROM DUAL) AS TASK_SE_NM /* 업무 구분 명 */ , (SELECT GET_CODE_NM('FIM021', LE.LEVY_EXCL_SE_CD) FROM DUAL) AS LEVY_EXCL_SE_NM /* 부과 제외 구분 명 */ , (SELECT GET_CODE_NM('FIM022', LE.LEVY_EXCL_RSN_CD) FROM DUAL) AS LEVY_EXCL_RSN_NM /* 부과 제외 사유 명 */ , (SELECT GET_CODE_NM('FIM026', C.CRDN_REG_SE_CD) FROM DUAL) AS CRDN_REG_SE_NM /* 단속 등록 구분 명 */ , (SELECT GET_CODE_NM('FIM003', C.CRDN_INPT_SE_CD) FROM DUAL) AS CRDN_INPT_SE_NM /* 단속 입력 구분 명 */ - , (CONCAT(C.CRDN_YMD, C.CRDN_TM)) AS CRDN_YMD_TM /* 단속 일시 */ , (SELECT GET_CODE_NM('FIM010', C.CRDN_STTS_CD) FROM DUAL) AS CRDN_STTS_NM /* 단속 상태 명 */ , (SELECT GET_CODE_NM('FIM002', CA.CRDN_SE_CD) FROM DUAL) AS CRDN_SE_NM /* 단속 구분 명 */ , (SELECT GET_CODE_NM('FIM007', CA.CRDN_SPAREA_CD) FROM DUAL) AS CRDN_SPAREA_NM /* 단속 특별구역 명 */ @@ -132,7 +131,6 @@ AND LE.DEL_YN = #{delYn} /* 삭제 여부 */ AND C.DEL_YN = 'N' /* 단속 삭제 여부 */ - @@ -221,8 +219,11 @@ P.RTPYR_NM P.RTPYR_NO P.RTPYR_BRDT - CC.CVLCPT_RCPT_NO CC.CVLCPT_RCPT_YMD + CC.CVLCPT_APLY_NO + CC.CVLCPT_RCPT_NO + CC.CVLCPT_PRCS_CD + CC.CVLCPT_PRCS_CMPTN_DT #{term}