From 4db7b366e9c33da8defcfa9908acd2de51793963 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Fri, 7 Jul 2023 12:59:30 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8B=A8=EC=86=8D=EC=9E=90=EB=A3=8C=20?= =?UTF-8?q?=EC=88=98=EA=B8=B0=20=EC=9E=85=EB=A0=A5=20SQL=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cokr/xit/fims/crdn/Crdn.java | 5 + .../cokr/xit/fims/crdn/dao/Crdn05Mapper.java | 22 +++ .../xit/fims/crdn/service/Crdn05Service.java | 10 ++ .../fims/crdn/service/bean/Crdn05Bean.java | 15 +- .../crdn/service/bean/Crdn05ServiceBean.java | 10 ++ .../xit/fims/crdn/web/Crdn05Controller.java | 2 +- .../sql/mapper/fims/crdn/crdn05-mapper.xml | 153 ++++++++++++++++++ .../WEB-INF/jsp/fims/crdn/crdn05030-info.jsp | 6 +- .../WEB-INF/jsp/fims/crdn/crdn06020-main.jsp | 4 +- 9 files changed, 221 insertions(+), 6 deletions(-) diff --git a/src/main/java/cokr/xit/fims/crdn/Crdn.java b/src/main/java/cokr/xit/fims/crdn/Crdn.java index e4eb4b19..98ef52b1 100644 --- a/src/main/java/cokr/xit/fims/crdn/Crdn.java +++ b/src/main/java/cokr/xit/fims/crdn/Crdn.java @@ -459,4 +459,9 @@ public class Crdn extends AbstractEntity { * 삭제 사유 */ private String delRsn; + + /** + * 연계 테이블 명 + */ + private String linkTblNm; } diff --git a/src/main/java/cokr/xit/fims/crdn/dao/Crdn05Mapper.java b/src/main/java/cokr/xit/fims/crdn/dao/Crdn05Mapper.java index 0f09bc98..464d6b70 100644 --- a/src/main/java/cokr/xit/fims/crdn/dao/Crdn05Mapper.java +++ b/src/main/java/cokr/xit/fims/crdn/dao/Crdn05Mapper.java @@ -1,7 +1,10 @@ package cokr.xit.fims.crdn.dao; +import java.util.Map; + import org.egovframe.rte.psl.dataaccess.mapper.Mapper; +import cokr.xit.fims.crdn.Crdn; import cokr.xit.foundation.component.AbstractMapper; /**단속 자료 등록 DAO @@ -10,4 +13,23 @@ import cokr.xit.foundation.component.AbstractMapper; @Mapper("crdn05Mapper") public interface Crdn05Mapper extends AbstractMapper { + /**단속 대장 정보를 등록한다. + * @param params 파라미터 + * + * @return 저장된 정보수 + */ + int insertCrdn(Map params); + + /**단속 대장 정보를 등록한다. + * @param crdn 단속 대장 + * @return 저장 여부 + * + */ + default boolean insert(Crdn crdn) { + return crdn != null && insertCrdn(params().set("crdn", crdn)) == 1; + } } diff --git a/src/main/java/cokr/xit/fims/crdn/service/Crdn05Service.java b/src/main/java/cokr/xit/fims/crdn/service/Crdn05Service.java index 652fc2a3..dcc93ba0 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/Crdn05Service.java +++ b/src/main/java/cokr/xit/fims/crdn/service/Crdn05Service.java @@ -1,5 +1,6 @@ package cokr.xit.fims.crdn.service; +import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; /**단속 자료 등록 서비스를 제공한다. @@ -9,4 +10,13 @@ import cokr.xit.fims.crdn.CrdnQuery; */ public interface Crdn05Service extends CrdnService { + /**단속 대장 정보를 등록한다. + * @param crdn05 단속 대장 + * @return 저장 여부 + * + */ + boolean create(Crdn crdn); + } diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn05Bean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn05Bean.java index 2e9917cf..499510a8 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn05Bean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn05Bean.java @@ -4,6 +4,7 @@ import javax.annotation.Resource; import org.springframework.stereotype.Component; +import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.dao.Crdn05Mapper; import cokr.xit.foundation.AbstractComponent; @@ -12,8 +13,18 @@ import cokr.xit.foundation.AbstractComponent; */ @Component("crdn05Bean") public class Crdn05Bean extends AbstractComponent { - + @Resource(name = "crdn05Mapper") private Crdn05Mapper crdn05Mapper; - + + /**단속 대장 정보를 등록한다. + * @param crdn 단속 대장 + * @return 저장 여부 + * + */ + public boolean create(Crdn crdn) { + return crdn05Mapper.insert(crdn); + } } diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn05ServiceBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn05ServiceBean.java index 72c2ec91..3373b700 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn05ServiceBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn05ServiceBean.java @@ -6,6 +6,7 @@ import javax.annotation.Resource; import org.springframework.stereotype.Service; +import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.service.Crdn05Service; import cokr.xit.foundation.component.AbstractServiceBean; @@ -26,4 +27,13 @@ public class Crdn05ServiceBean extends AbstractServiceBean implements Crdn05Serv return null; //crdn05Mapper. } + @Override + public boolean create(Crdn crdn) { + + if(ifEmpty(crdn.getDoGuidance(), () -> "").equals("on")) { + + } + + return crdn05Bean.create(crdn); + } } diff --git a/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java b/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java index dd9412ed..0d5ae333 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java @@ -86,7 +86,7 @@ public class Crdn05Controller extends ApplicationController { @RequestMapping(name="단속자료 수기 등록", value="/030/create.do") public ModelAndView createCrdnDataByManual(Crdn crdn) { - boolean saved = false; + boolean saved = crdn05Service.create(crdn); return new ModelAndView("jsonView") .addObject("saved", saved); diff --git a/src/main/resources/sql/mapper/fims/crdn/crdn05-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/crdn05-mapper.xml index dca481d7..8b3a16a4 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn05-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn05-mapper.xml @@ -2,4 +2,157 @@ + +/* 단속 대장 등록(crdn05Mapper.insertCrdn) */ + +SELECT LPAD(CONVERT(IFNULL(MAX(CRDN_ID) + 1, 1),INT), 20, '0') NEW_ID FROM TB_CRDN + +INSERT INTO TB_CRDN ( + CRDN_ID + , SGG_CD + , CRDN_REG_SE_CD + , CRDN_INPT_SE_CD + , LINK_ID + , CRDN_SE_CD + , RTPYR_ID + , CRDN_YMD + , CRDN_TM + , VHRNO + , CRDN_STDG_NM + , CRDN_ROAD_NM + , CRDN_PLC + , DTL_CRDN_PLC + , TEAM_ID + , VLTN_ID + , CRDN_SPAREA_CD + , CRDN_BGNG_TM + , CRDN_END_HR + , CRDN_SN + , GPS_X + , GPS_Y + , MOSC_X + , MOSC_Y + , TOWNG_YN + , ATCH_FILE_CNT + , VIN + , VHCL_NM + , VHCL_COLOR + , USE_FUEL_CD + , USG_SE_CD + , MXMM_LOAD_QY + , TKCAR_PSNCPA_CNT + , CARMDL_ASORT_NM + , CARMDL_TYPE_NM + , CARMDL_CLSF_NM + , ERSR_YMD + , FFNLG_CARMDL_CD + , PARKNG_PSBLTY_RSLT_CD + , VLTN_NMTM + , OVTIME_YN + , RVW_SE_CD + , RVW_PRCS_SCRN_NM + , RVW_DT + , RVWR + , FFNLG_AMT + , FFNLG_RDUCT_RT + , LEVY_AMT + , ADVNTCE_BGNG_YMD + , ADVNTCE_DUDT_YMD + , ADVNTCE_LEVY_AMT + , OPNN_SBMSN_YN + , ETC_CN + , LEVY_ID + , CRDN_STTS_CD + , CRDN_STTS_CHG_DT + , ADTN_AMT + , MINUS_AMT + , RCVMT_AMT + , BFR_CRDN_ID + , DEL_YN + , REG_DT + , RGTR + , MDFCN_DT + , MDFR + , DEL_DT + , DLTR + , DEL_RSN + , TASK_SE_CD + , LINK_TBL_NM +) VALUES ( + #{crdn.crdnId} + , #{crdn.sggCd} + , #{crdn.crdnRegSeCd} + , #{crdn.crdnInptSeCd} + , #{crdn.linkId} + , #{crdn.crdnSeCd} + , #{crdn.rtpyrId} + , #{crdn.crdnYmd} + , #{crdn.crdnTm} + , #{crdn.vhrno} + , #{crdn.crdnStdgNm} + , #{crdn.crdnRoadNm} + , #{crdn.crdnPlc} + , #{crdn.dtlCrdnPlc} + , #{crdn.teamId} + , (SELECT VLTN_ID FROM TB_VLTN_INFO + WHERE SGG_CD = '41480' + AND TASK_SE_CD = #{crdn.taskSeCd} + AND VLTN_CD = #{crdn.vltnCd}) + , #{crdn.crdnSpareaCd} + , #{crdn.crdnBgngTm} + , #{crdn.crdnEndHr} + , #{crdn.crdnSn} + , #{crdn.gpsX} + , #{crdn.gpsY} + , #{crdn.moscX} + , #{crdn.moscY} + , #{crdn.towngYn} + , #{crdn.atchFileCnt} + , #{crdn.vin} + , #{crdn.vhclNm} + , #{crdn.vhclColor} + , #{crdn.useFuelCd} + , #{crdn.usgSeCd} + , #{crdn.mxmmLoadQy} + , #{crdn.tkcarPsncpaCnt} + , #{crdn.carmdlAsortNm} + , #{crdn.carmdlTypeNm} + , #{crdn.carmdlClsfNm} + , #{crdn.ersrYmd} + , #{crdn.ffnlgCarmdlCd} + , #{crdn.parkngPsbltyRsltCd} + , #{crdn.vltnNmtm} + , #{crdn.ovtimeYn} + , #{crdn.rvwSeCd} + , #{crdn.rvwPrcsScrnNm} + , #{crdn.rvwDt} + , #{crdn.rvwr} + , #{crdn.ffnlgAmt} + , #{crdn.ffnlgRductRt} + , #{crdn.levyAmt} + , #{crdn.advntceBgngYmd} + , #{crdn.advntceDudtYmd} + , #{crdn.advntceLevyAmt} + , #{crdn.opnnSbmsnYn} + , #{crdn.etcCn} + , #{crdn.levyId} + , #{crdn.crdnSttsCd} + , #{crdn.crdnSttsChgDt} + , #{crdn.adtnAmt} + , #{crdn.minusAmt} + , #{crdn.rcvmtAmt} + , #{crdn.bfrCrdnId} + , #{crdn.delYn} + , + , #{currentUser.id} + , + , #{currentUser.id} + , #{crdn.removedAt} + , #{crdn.removedBy} + , #{crdn.delRsn} + , #{crdn.taskSeCd} + , #{crdn.linkTblNm} +) + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp index a403dde8..d47a7431 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp @@ -4,6 +4,7 @@
+