diff --git a/src/main/java/cokr/xit/fims/crdn/Crdn.java b/src/main/java/cokr/xit/fims/crdn/Crdn.java index 263bd70d..dfd3ea32 100644 --- a/src/main/java/cokr/xit/fims/crdn/Crdn.java +++ b/src/main/java/cokr/xit/fims/crdn/Crdn.java @@ -37,6 +37,11 @@ public class Crdn extends AbstractEntity { */ private String sggCd; + /** + * 기관 + */ + private String institute; + /** * 업무 구분 코드 */ 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 9f396174..6aa9e00d 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,6 @@ package cokr.xit.fims.crdn.dao; import java.util.List; -import java.util.Map; import org.egovframe.rte.psl.dataaccess.mapper.Mapper; @@ -30,18 +29,7 @@ public interface Crdn05Mapper extends AbstractMapper { * * @return 저장된 정보수 */ - int insertCrdn(Map params); - - /**단속 대장 정보를 등록한다. - * @param crdn 단속 대장 - * @return 저장 여부 - * - */ - default boolean insert(Crdn crdn) { - return crdn != null && insertCrdn(params().set("crdn", crdn)) == 1; - } + int insertCrdn(Crdn crdn); /**기본금액을 조회한다.
* {@link cokr.xit.fims.crdn.service.bean.Crdn05Bean#getBasicAmt(CrdnQuery)} 참고 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 8b183aec..e5784555 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 @@ -22,6 +22,7 @@ import cokr.xit.fims.task.service.bean.EcaServiceBean; import cokr.xit.fims.task.service.bean.PvsServiceBean; import cokr.xit.fims.task.service.bean.TpvServiceBean; import cokr.xit.foundation.AbstractComponent; +import cokr.xit.foundation.UserInfo; /** 단속 자료 등록 Bean * @author leebj @@ -109,7 +110,9 @@ public class Crdn05Bean extends AbstractComponent { } else { crdn.setCrdnSttsCd("01"); } - boolean result = crdn05Mapper.insert(crdn); + + crdn.setInstitute(UserInfo.current().getInstitute()); + boolean result = crdn05Mapper.insertCrdn(crdn) == 1 ? true : false; SimpleDateFormat yyyyMMdd = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat yyyyMMddHHmmss = new SimpleDateFormat("yyyyMMddHHmmss"); 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 3cf96489..09b16c7b 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn05-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn05-mapper.xml @@ -29,10 +29,13 @@ SELECT C.CRDN_ID - + /* 단속 대장 등록(crdn05Mapper.insertCrdn) */ - -SELECT LPAD(IFNULL(MAX(CRDN_ID) + 1, 1), 20, '0') NEW_ID FROM TB_CRDN + +SELECT + CONCAT(DATE_FORMAT(CURRENT_DATE, '%Y'), LPAD(CAST(IFNULL(MAX(SUBSTRING(CRDN_ID,5)) + 1, 1) AS INT), 16, '0')) + AS NEW_ID +FROM TB_CRDN INSERT INTO TB_CRDN ( CRDN_ID @@ -106,82 +109,82 @@ INSERT INTO TB_CRDN ( , TASK_SE_CD , LINK_TBL_NM ) VALUES ( - #{crdn.crdnId} - , (SELECT SGG_CD FROM TB_SGG_INFO WHERE INST_CD = #{currentUser.institute}) - , #{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} + #{crdnId} + , (SELECT SGG_CD FROM TB_SGG_INFO WHERE INST_CD = #{institute}) + , #{crdnRegSeCd} + , #{crdnInptSeCd} + , #{linkId} + , #{crdnSeCd} + , #{rtpyrId} + , #{crdnYmd} + , #{crdnTm} + , #{vhrno} + , #{crdnStdgNm} + , #{crdnRoadNm} + , #{crdnPlc} + , #{dtlCrdnPlc} + , #{teamId} , (SELECT B.VLTN_ID FROM TB_SGG_INFO A INNER JOIN TB_VLTN_INFO B WHERE A.SGG_CD = B.SGG_CD - AND A.INST_CD = #{currentUser.institute} - AND B.TASK_SE_CD = #{crdn.taskSeCd} - AND B.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} + AND A.INST_CD = #{institute} + AND B.TASK_SE_CD = #{taskSeCd} + AND B.VLTN_CD = #{vltnCd}) + , #{crdnSpareaCd} + , #{crdnBgngTm} + , #{crdnEndHr} + , #{crdnSn} + , #{gpsX} + , #{gpsY} + , #{moscX} + , #{moscY} + , #{towngYn} + , #{atchFileCnt} + , #{vin} + , #{vhclNm} + , #{vhclColor} + , #{useFuelCd} + , #{usgSeCd} + , #{mxmmLoadQy} + , #{tkcarPsncpaCnt} + , #{carmdlAsortNm} + , #{carmdlTypeNm} + , #{carmdlClsfNm} + , #{ersrYmd} + , #{ffnlgCarmdlCd} + , #{parkngPsbltyRsltCd} + , #{vltnNmtm} + , #{ovtimeYn} + , #{rvwSeCd} + , #{rvwPrcsScrnNm} + , #{rvwDt} + , #{rvwr} + , #{ffnlgAmt} + , #{ffnlgRductRt} + , #{levyAmt} + , #{advntceBgngYmd} + , #{advntceDudtYmd} + , #{advntceLevyAmt} + , #{opnnSbmsnYn} + , #{etcCn} + , #{levyId} + , #{crdnSttsCd} + , #{crdnSttsChgDt} + , #{adtnAmt} + , #{minusAmt} + , #{rcvmtAmt} + , #{bfrCrdnId} , 'N' - , #{crdn.createdAt} - , #{crdn.createdBy} - , #{crdn.lastModified} - , #{crdn.modifiedBy} - , #{crdn.removedAt} - , #{crdn.removedBy} - , #{crdn.delRsn} - , #{crdn.taskSeCd} - , #{crdn.linkTblNm} + , #{createdAt} + , #{createdBy} + , #{lastModified} + , #{modifiedBy} + , #{removedAt} + , #{removedBy} + , #{delRsn} + , #{taskSeCd} + , #{linkTblNm} )