From 115b5daf011b209654b9ab1fbad137d801c4c68b Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Tue, 18 Jul 2023 15:21:56 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8F=99=EC=A0=81=20=EA=B2=80=EC=83=89=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=EC=9C=A0=ED=8B=B8=EB=A6=AC=ED=8B=B0=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cokr/xit/fims/crdn/CrdnQuery.java | 21 ++++++++ .../sql/mapper/fims/crdn/crdn01-mapper.xml | 51 +++++++------------ .../sql/mapper/fims/dynamicSearch.xml | 29 +++++++++++ .../WEB-INF/jsp/fims/crdn/crdn01010-main.jsp | 25 +++++---- .../WEB-INF/jsp/fims/crdn/crdn06030-main.jsp | 6 ++- .../WEB-INF/jsp/fims/crdn/crdn06040-main.jsp | 6 ++- .../js/fims/framework/cmm/initGrid.js | 7 ++- 7 files changed, 98 insertions(+), 47 deletions(-) create mode 100644 src/main/resources/sql/mapper/fims/dynamicSearch.xml diff --git a/src/main/java/cokr/xit/fims/crdn/CrdnQuery.java b/src/main/java/cokr/xit/fims/crdn/CrdnQuery.java index 698ac617..8ef84e2b 100644 --- a/src/main/java/cokr/xit/fims/crdn/CrdnQuery.java +++ b/src/main/java/cokr/xit/fims/crdn/CrdnQuery.java @@ -16,6 +16,9 @@ public class CrdnQuery extends QueryRequest { private static final long serialVersionUID = 1L; + private String mainOption; + private String subOption; + private String grid; private String thisDay; private String currentUserId; @@ -43,6 +46,24 @@ public class CrdnQuery extends QueryRequest { private String crdnInptSeCd; private String cvlcptPrcsCd; + public String getMainOption() { + return ifEmpty(mainOption, () -> null); + } + + public T setMainOption(String mainOption) { + this.mainOption = mainOption; + return self(); + } + + public String getSubOption() { + return ifEmpty(subOption, () -> null); + } + + public T setSubOption(String subOption) { + this.subOption = subOption; + return self(); + } + public String getGrid() { return ifEmpty(grid, () -> null); } diff --git a/src/main/resources/sql/mapper/fims/crdn/crdn01-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/crdn01-mapper.xml index 6d8a1b24..62847169 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn01-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn01-mapper.xml @@ -172,41 +172,26 @@ SELECT C.CRDN_ID AND C.CRDN_STTS_CD = '01' - -AND FN_GET_CODE_NM('FIM026', C.CRDN_REG_SE_CD) LIKE CONCAT('%', #{term}, '%') - - -AND CC.CVLCPT_APLCNT_NM LIKE CONCAT('%', #{term}, '%') - - -AND CC.CVLCPT_PRCS_PIC_NM LIKE CONCAT('%', #{term}, '%') - - -AND CC.CVLCPT_PRCS_PIC_TELNO LIKE CONCAT('%', #{term}, '%') - - -AND CC.CVLCPT_RCPT_YMD = REPLACE(#{term},'-','') - - -AND SUBSTR(CC.CVLCPT_PRCS_PRNMNT_DT,1,8) = REPLACE(#{term},'-','') - - -AND C.CRDN_YMD = REPLACE(#{term},'-','') - - -AND C.ATCH_FILE_CNT = #{term} - - -AND (SELECT VLTN_ARTCL FROM TB_VLTN_INFO WHERE VLTN_ID = C.VLTN_ID) LIKE CONCAT('%', #{term}, '%') - - -AND CC.CVLCPT_RCPT_NO LIKE CONCAT('%', #{term}, '%') - - -AND C.VHRNO LIKE CONCAT('%', #{term}, '%') + + + + C.CRDN_REG_SE_CD + CC.CVLCPT_APLCNT_NM + CC.CVLCPT_PRCS_PIC_NM + CC.CVLCPT_PRCS_PIC_TELNO + CC.CVLCPT_RCPT_YMD + CC.CVLCPT_PRCS_PRNMNT_DT + C.CRDN_YMD + C.ATCH_FILE_CNT + CC.CVLCPT_RCPT_NO + C.VHRNO + + #{term} - + +AND (SELECT VLTN_ARTCL FROM TB_VLTN_INFO WHERE VLTN_ID = C.VLTN_ID) LIKE CONCAT('%', #{term}, '%') + diff --git a/src/main/resources/sql/mapper/fims/dynamicSearch.xml b/src/main/resources/sql/mapper/fims/dynamicSearch.xml new file mode 100644 index 00000000..d613d91e --- /dev/null +++ b/src/main/resources/sql/mapper/fims/dynamicSearch.xml @@ -0,0 +1,29 @@ + + + + + + AND FN_GET_CODE_NM(#{subOption}, + AND + AND SUBSTR( + + + + ) LIKE CONCAT('%', + + = + LIKE CONCAT('%', + + ,1,8) = REPLACE( + + + + , '%') + + + , '%') + + ,'-','') + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01010-main.jsp index 45d31054..c5066f4e 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn01010-main.jsp @@ -49,6 +49,8 @@
+ +
@@ -77,19 +79,20 @@ - + - - - - - - - - + + + + + + + + - - + + diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06030-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06030-main.jsp index 08a6af82..17e1906e 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06030-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06030-main.jsp @@ -32,6 +32,8 @@
+ +
@@ -57,7 +59,9 @@ - + diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06040-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06040-main.jsp index 05726420..33b92a1a 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06040-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06040-main.jsp @@ -46,6 +46,8 @@
+ +
@@ -70,7 +72,9 @@ - + diff --git a/src/main/webapp/resources/js/fims/framework/cmm/initGrid.js b/src/main/webapp/resources/js/fims/framework/cmm/initGrid.js index 94ba9742..bb77a6d3 100644 --- a/src/main/webapp/resources/js/fims/framework/cmm/initGrid.js +++ b/src/main/webapp/resources/js/fims/framework/cmm/initGrid.js @@ -1,12 +1,17 @@ -function searchFromGridTitle(byValue, byOutputValue){ +function searchFromGridTitle(byValue, byOutputValue, mainOption, subOption){ var trDataset = event.target.parentElement.dataset; var byElementId = trDataset.by; var byOutputElementId = trDataset.byOutput; + var mainOptionElementId = trDataset.mainOption; + var subOptionElementId = trDataset.subOption; document.getElementById(byElementId).value = snakeToCamel(byValue); document.getElementById(byOutputElementId).value = byOutputValue + " 검색"; + + document.getElementById(mainOptionElementId).value = mainOption; + document.getElementById(subOptionElementId).value = subOption; }