From 11c2698cec317662bc072d810c0fa9cc46dc057e Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 8 Feb 2024 15:21:52 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8B=9C=EA=B5=B0=EA=B5=AC=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cokr/xit/fims/mngt/dao/FactionMapper.java | 49 +++++++++++++ .../cokr/xit/fims/mngt/dao/SggMapper.java | 71 ------------------- .../xit/fims/mngt/service/FactionService.java | 13 ++++ .../xit/fims/mngt/service/SggService.java | 34 --------- .../fims/mngt/service/bean/FactionBean.java | 21 ++++++ ...rviceBean.java => FactionServiceBean.java} | 16 ++--- .../xit/fims/mngt/service/bean/SggBean.java | 49 ------------- .../xit/fims/mngt/web/Mngt03Controller.java | 12 ++-- .../sql/mapper/fims/mngt/faction-mapper.xml | 61 ++++++++++++++++ .../sql/mapper/fims/mngt/sgg-mapper.xml | 65 ----------------- 10 files changed, 158 insertions(+), 233 deletions(-) delete mode 100644 src/main/java/cokr/xit/fims/mngt/dao/SggMapper.java create mode 100644 src/main/java/cokr/xit/fims/mngt/service/FactionService.java delete mode 100644 src/main/java/cokr/xit/fims/mngt/service/SggService.java rename src/main/java/cokr/xit/fims/mngt/service/bean/{SggServiceBean.java => FactionServiceBean.java} (52%) delete mode 100644 src/main/java/cokr/xit/fims/mngt/service/bean/SggBean.java delete mode 100644 src/main/resources/sql/mapper/fims/mngt/sgg-mapper.xml diff --git a/src/main/java/cokr/xit/fims/mngt/dao/FactionMapper.java b/src/main/java/cokr/xit/fims/mngt/dao/FactionMapper.java index 38db3725..d275a1a0 100644 --- a/src/main/java/cokr/xit/fims/mngt/dao/FactionMapper.java +++ b/src/main/java/cokr/xit/fims/mngt/dao/FactionMapper.java @@ -5,6 +5,8 @@ import java.util.Map; import org.egovframe.rte.psl.dataaccess.mapper.Mapper; +import cokr.xit.fims.cmmn.CmmnQuery; +import cokr.xit.fims.mngt.FineIntegrationSigungu; import cokr.xit.foundation.component.AbstractMapper; import cokr.xit.foundation.data.DataObject; @@ -51,4 +53,51 @@ public interface FactionMapper extends AbstractMapper { * @return 시군구 목록 */ List selectAllSggList(); + + + + /**시군구 정보를 수정한다. + * @param params 파라미터 + * + * @return 저장된 정보수 + */ + int updateSgg(Map params); + + /**시군구 정보를 수정한다. + * @param sgg 시군구 + * @return 저장 여부 + *
  • 저장됐으면 true
  • + *
  • 그렇지 않으면 false
  • + *
+ */ + default boolean updateSgg(FineIntegrationSigungu sgg) { + return sgg != null && updateSgg(params().set("sgg", sgg)) == 1; + } + + /**지정한 조건에 따라 시군구 객체들을 반환한다. + * @param req 시군구 조회 조건 + * @return 시군구 객체 목록 + */ + List selectSggs(CmmnQuery req); + + /**지정한 조건에 따라 시군구 객체를 반환한다. + * @param req 시군구 조회 조건 + * @return 시군구 객체 + */ + default DataObject selectSggInfo(CmmnQuery req) { + // 사용 여부 확인 + if (req.getUseYN() == null) { + req.setUseYN("Y"); + } + // 기본 정렬 + if (req.getOrderBy() == null) { + req.setOrderBy("S.SGG_CD DESC"); + } + + List sggs = selectSggs(req); + + return !sggs.isEmpty() ? sggs.get(0) : null; + } } diff --git a/src/main/java/cokr/xit/fims/mngt/dao/SggMapper.java b/src/main/java/cokr/xit/fims/mngt/dao/SggMapper.java deleted file mode 100644 index def984d4..00000000 --- a/src/main/java/cokr/xit/fims/mngt/dao/SggMapper.java +++ /dev/null @@ -1,71 +0,0 @@ -package cokr.xit.fims.mngt.dao; - -import java.util.List; -import java.util.Map; - -import org.egovframe.rte.psl.dataaccess.mapper.Mapper; - -import cokr.xit.fims.cmmn.CmmnQuery; -import cokr.xit.fims.mngt.FineIntegrationSigungu; -import cokr.xit.foundation.component.AbstractMapper; -import cokr.xit.foundation.data.DataObject; - -/** 시군구 정보 DAO -* -*

상세 설명: -* -*

-* ============ 변경 이력 ============
-* 2023-02-02	leebj 최초 작성
-* ================================
-* 
-*/ -@Mapper("sggMapper") -public interface SggMapper extends AbstractMapper { - - /**시군구 정보를 수정한다. - * @param params 파라미터 - *
  • "sgg" - 시군구 정보
  • - *
  • "currentUser" - 현재 접속한 사용자
  • - *
- * @return 저장된 정보수 - */ - int updateSgg(Map params); - - /**시군구 정보를 수정한다. - * @param sgg 시군구 - * @return 저장 여부 - *
  • 저장됐으면 true
  • - *
  • 그렇지 않으면 false
  • - *
- */ - default boolean update(FineIntegrationSigungu sgg) { - return sgg != null && updateSgg(params().set("sgg", sgg)) == 1; - } - - /**지정한 조건에 따라 시군구 객체들을 반환한다. - * @param req 시군구 조회 조건 - * @return 시군구 객체 목록 - */ - List selectSggs(CmmnQuery req); - - /**지정한 조건에 따라 시군구 객체를 반환한다. - * @param req 시군구 조회 조건 - * @return 시군구 객체 - */ - default DataObject selectSggInfo(CmmnQuery req) { - // 사용 여부 확인 - if (req.getUseYN() == null) { - req.setUseYN("Y"); - } - // 기본 정렬 - if (req.getOrderBy() == null) { - req.setOrderBy("S.SGG_CD DESC"); - } - - List sggs = selectSggs(req); - - return !sggs.isEmpty() ? sggs.get(0) : null; - } - -} diff --git a/src/main/java/cokr/xit/fims/mngt/service/FactionService.java b/src/main/java/cokr/xit/fims/mngt/service/FactionService.java new file mode 100644 index 00000000..d2814530 --- /dev/null +++ b/src/main/java/cokr/xit/fims/mngt/service/FactionService.java @@ -0,0 +1,13 @@ +package cokr.xit.fims.mngt.service; + +import cokr.xit.fims.cmmn.CmmnQuery; +import cokr.xit.fims.mngt.FineIntegrationSigungu; +import cokr.xit.foundation.data.DataObject; + +public interface FactionService { + + boolean updateSgg(FineIntegrationSigungu sgg); + + DataObject getSggInfo(CmmnQuery req); + +} diff --git a/src/main/java/cokr/xit/fims/mngt/service/SggService.java b/src/main/java/cokr/xit/fims/mngt/service/SggService.java deleted file mode 100644 index 4624541f..00000000 --- a/src/main/java/cokr/xit/fims/mngt/service/SggService.java +++ /dev/null @@ -1,34 +0,0 @@ -package cokr.xit.fims.mngt.service; - -import cokr.xit.fims.cmmn.CmmnQuery; -import cokr.xit.fims.mngt.FineIntegrationSigungu; -import cokr.xit.foundation.data.DataObject; - -/**시군구 정보 관리 서비스 인터페이스. -* -*

상세 설명: -* -*

-* ============ 변경 이력 ============
-* 2024-02-02	leebj 최초 작성
-* ================================
-* 
-*/ -public interface SggService { - - /**시군구 정보를 수정한다. - * @param sgg 시군구 - * @return 저장 여부 - *
  • 저장됐으면 true
  • - *
  • 그렇지 않으면 false
  • - *
- */ - boolean update(FineIntegrationSigungu sgg); - - /**지정한 조건에 따라 시군구 객체를 반환한다. - * @param req 시군구 조회 조건 - * @return 시군구 객체 - */ - DataObject getSggInfo(CmmnQuery req); - -} diff --git a/src/main/java/cokr/xit/fims/mngt/service/bean/FactionBean.java b/src/main/java/cokr/xit/fims/mngt/service/bean/FactionBean.java index bd8d1b3b..8a0d545b 100644 --- a/src/main/java/cokr/xit/fims/mngt/service/bean/FactionBean.java +++ b/src/main/java/cokr/xit/fims/mngt/service/bean/FactionBean.java @@ -7,7 +7,9 @@ import javax.annotation.Resource; import org.springframework.stereotype.Component; import cokr.xit.base.user.dao.UserMapper; +import cokr.xit.fims.cmmn.CmmnQuery; import cokr.xit.fims.crdn.dao.GlobalStngMapper; +import cokr.xit.fims.mngt.FineIntegrationSigungu; import cokr.xit.fims.mngt.dao.FactionMapper; import cokr.xit.foundation.AbstractComponent; import cokr.xit.foundation.UserInfo; @@ -53,4 +55,23 @@ public class FactionBean extends AbstractComponent { userInfo.setInfo(infoMap); } + /**시군구 정보를 수정한다. + * @param sgg 시군구 + * @return 저장 여부 + *
  • 저장됐으면 true
  • + *
  • 그렇지 않으면 false
  • + *
+ */ + public boolean updateSgg(FineIntegrationSigungu sgg) { + return factionMapper.updateSgg(sgg); + } + + /**지정한 조건에 따라 시군구 객체를 반환한다. + * @param req 시군구 조회 조건 + * @return 시군구 객체 + */ + public DataObject getSggInfo(CmmnQuery req) { + return factionMapper.selectSggInfo(req); + } + } diff --git a/src/main/java/cokr/xit/fims/mngt/service/bean/SggServiceBean.java b/src/main/java/cokr/xit/fims/mngt/service/bean/FactionServiceBean.java similarity index 52% rename from src/main/java/cokr/xit/fims/mngt/service/bean/SggServiceBean.java rename to src/main/java/cokr/xit/fims/mngt/service/bean/FactionServiceBean.java index 2775050c..8cfd26a1 100644 --- a/src/main/java/cokr/xit/fims/mngt/service/bean/SggServiceBean.java +++ b/src/main/java/cokr/xit/fims/mngt/service/bean/FactionServiceBean.java @@ -6,24 +6,24 @@ import org.springframework.stereotype.Service; import cokr.xit.fims.cmmn.CmmnQuery; import cokr.xit.fims.mngt.FineIntegrationSigungu; -import cokr.xit.fims.mngt.service.SggService; +import cokr.xit.fims.mngt.service.FactionService; import cokr.xit.foundation.component.AbstractServiceBean; import cokr.xit.foundation.data.DataObject; -@Service("sggService") -public class SggServiceBean extends AbstractServiceBean implements SggService { +@Service("factionService") +public class FactionServiceBean extends AbstractServiceBean implements FactionService { - @Resource(name = "sggBean") - private SggBean sggBean; + @Resource(name = "factionBean") + private FactionBean factionBean; @Override - public boolean update(FineIntegrationSigungu sgg) { - return sggBean.update(sgg); + public boolean updateSgg(FineIntegrationSigungu sgg) { + return factionBean.updateSgg(sgg); } @Override public DataObject getSggInfo(CmmnQuery req) { - return sggBean.getSggInfo(req); + return factionBean.getSggInfo(req); } } diff --git a/src/main/java/cokr/xit/fims/mngt/service/bean/SggBean.java b/src/main/java/cokr/xit/fims/mngt/service/bean/SggBean.java deleted file mode 100644 index a2004f85..00000000 --- a/src/main/java/cokr/xit/fims/mngt/service/bean/SggBean.java +++ /dev/null @@ -1,49 +0,0 @@ -package cokr.xit.fims.mngt.service.bean; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Component; - -import cokr.xit.fims.cmmn.CmmnQuery; -import cokr.xit.fims.mngt.FineIntegrationSigungu; -import cokr.xit.fims.mngt.dao.SggMapper; -import cokr.xit.foundation.AbstractComponent; -import cokr.xit.foundation.data.DataObject; - -/** 시군구 정보 관리 Bean -* -*

상세 설명: -* -*

-* ============ 변경 이력 ============
-* 2024-02-02	leebj 최초 작성
-* ================================
-* 
-*/ -@Component("sggBean") -public class SggBean extends AbstractComponent { - - /** 시군구 DAO */ - @Resource(name = "sggMapper") - private SggMapper sggMapper; - - /**시군구 정보를 수정한다. - * @param sgg 시군구 - * @return 저장 여부 - *
  • 저장됐으면 true
  • - *
  • 그렇지 않으면 false
  • - *
- */ - public boolean update(FineIntegrationSigungu sgg) { - return sggMapper.update(sgg); - } - - /**지정한 조건에 따라 시군구 객체를 반환한다. - * @param req 시군구 조회 조건 - * @return 시군구 객체 - */ - public DataObject getSggInfo(CmmnQuery req) { - return sggMapper.selectSggInfo(req); - } - -} diff --git a/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java b/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java index b28f555e..4e691382 100644 --- a/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java +++ b/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java @@ -17,7 +17,7 @@ import cokr.xit.fims.mngt.FineIntegrationSigungu; import cokr.xit.fims.mngt.Task; import cokr.xit.fims.mngt.VltnQuery; import cokr.xit.fims.mngt.dao.FactionMapper; -import cokr.xit.fims.mngt.service.SggService; +import cokr.xit.fims.mngt.service.FactionService; import cokr.xit.fims.mngt.service.TaskVltnService; import cokr.xit.fims.mngt.service.bean.FactionBean; import cokr.xit.fims.mngt.service.bean.TaskBean; @@ -45,9 +45,9 @@ public class Mngt03Controller extends ApplicationController { ; } - /** 시군구 정보 서비스 */ - @Resource(name = "sggService") - private SggService sggService; + /** 소속 정보 서비스 */ + @Resource(name = "factionService") + private FactionService factionService; /** 업무 정보 서비스 */ @Resource(name = "taskVltnService") @@ -106,7 +106,7 @@ public class Mngt03Controller extends ApplicationController { */ public ModelAndView getSggInfo(CmmnQuery req) { ModelAndView mav = new ModelAndView("jsonView"); - DataObject sggInfo = sggService.getSggInfo(req); + DataObject sggInfo = factionService.getSggInfo(req); mav.addObject("sggInfo", sggInfo); return mav; } @@ -157,7 +157,7 @@ public class Mngt03Controller extends ApplicationController { sgg.setOfficialSealFilename(newOffcs.get("fileName")); } - boolean saved = sggService.update(sgg); + boolean saved = factionService.updateSgg(sgg); mav.addObject("saved", saved); return mav; diff --git a/src/main/resources/sql/mapper/fims/mngt/faction-mapper.xml b/src/main/resources/sql/mapper/fims/mngt/faction-mapper.xml index ae233643..34c5b008 100644 --- a/src/main/resources/sql/mapper/fims/mngt/faction-mapper.xml +++ b/src/main/resources/sql/mapper/fims/mngt/faction-mapper.xml @@ -93,4 +93,65 @@ SELECT INST_CD WHERE USE_YN = 'Y' + + +SELECT S.SGG_CD + , S.SGG_NM + , S.INST_SE_CD + , S.INST_CD + , S.INST_NM + , (CASE + WHEN S.INST_DADDR IS NULL OR S.INST_DADDR = '' + THEN S.INST_ADDR + ELSE CONCAT(S.INST_ADDR,' ',S.INST_DADDR) + END) AS INST_FULL_ADDR + , S.INST_ADDR + , S.INST_DADDR + , S.INST_ZIP + , S.SYMBOL_FILE_PATH + , S.SYMBOL_FILE_NM + , S.LOGO_FILE_PATH + , S.LOGO_FILE_NM + , S.OFFCS_FILE_PATH + , S.OFFCS_FILE_NM + FROM TB_SGG S + + + + + +/* 시군구 설정정보 수정 (sggMapper.updateSgg) */ +UPDATE TB_SGG + SET MDFCN_DT = + , MDFR = #{sgg.modifiedBy} + , INST_ZIP = #{sgg.instituteZipCode} + , INST_ADDR = #{sgg.instAddress} + , INST_DADDR = #{sgg.instDetailAddress} + + , SYMBOL_FILE_PATH = #{sgg.symbolFilepath} + , SYMBOL_FILE_NM = #{sgg.symbolFilename} + + + , LOGO_FILE_PATH = #{sgg.logoFilepath} + , LOGO_FILE_NM = #{sgg.logoFilename} + + + , OFFCS_FILE_PATH = #{sgg.officialSealFilepath} + , OFFCS_FILE_NM = #{sgg.officialSealFilename} + + WHERE SGG_CD = #{sgg.sggID} + + \ No newline at end of file diff --git a/src/main/resources/sql/mapper/fims/mngt/sgg-mapper.xml b/src/main/resources/sql/mapper/fims/mngt/sgg-mapper.xml deleted file mode 100644 index e9e3304f..00000000 --- a/src/main/resources/sql/mapper/fims/mngt/sgg-mapper.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - -SELECT S.SGG_CD - , S.SGG_NM - , S.INST_SE_CD - , S.INST_CD - , S.INST_NM - , (CASE - WHEN S.INST_DADDR IS NULL OR S.INST_DADDR = '' - THEN S.INST_ADDR - ELSE CONCAT(S.INST_ADDR,' ',S.INST_DADDR) - END) AS INST_FULL_ADDR - , S.INST_ADDR - , S.INST_DADDR - , S.INST_ZIP - , S.SYMBOL_FILE_PATH - , S.SYMBOL_FILE_NM - , S.LOGO_FILE_PATH - , S.LOGO_FILE_NM - , S.OFFCS_FILE_PATH - , S.OFFCS_FILE_NM - FROM TB_SGG S - - - - - -/* 시군구 설정정보 수정 (sggMapper.updateSgg) */ -UPDATE TB_SGG - SET MDFCN_DT = - , MDFR = #{sgg.modifiedBy} - , INST_ZIP = #{sgg.instituteZipCode} - , INST_ADDR = #{sgg.instAddress} - , INST_DADDR = #{sgg.instDetailAddress} - - , SYMBOL_FILE_PATH = #{sgg.symbolFilepath} - , SYMBOL_FILE_NM = #{sgg.symbolFilename} - - - , LOGO_FILE_PATH = #{sgg.logoFilepath} - , LOGO_FILE_NM = #{sgg.logoFilename} - - - , OFFCS_FILE_PATH = #{sgg.officialSealFilepath} - , OFFCS_FILE_NM = #{sgg.officialSealFilename} - - WHERE SGG_CD = #{sgg.sggID} - - - \ No newline at end of file