From 183636b84d01a93375372614c5b8113b126ef60b Mon Sep 17 00:00:00 2001 From: leebj Date: Wed, 3 Jul 2024 17:05:12 +0900 Subject: [PATCH] =?UTF-8?q?=EC=86=8C=EC=8A=A4=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cokr/xit/fims/base/dao/OgdpMapper.java | 67 ++++++++++--------- .../xit/fims/base/service/bean/OgdpBean.java | 44 ++---------- .../xit/fims/mngt/web/Mngt03Controller.java | 12 ++-- .../xit/fims/mngt/web/Mngt04Controller.java | 16 ++--- 4 files changed, 57 insertions(+), 82 deletions(-) diff --git a/src/main/java/cokr/xit/fims/base/dao/OgdpMapper.java b/src/main/java/cokr/xit/fims/base/dao/OgdpMapper.java index 9ae978c7..27e68bba 100644 --- a/src/main/java/cokr/xit/fims/base/dao/OgdpMapper.java +++ b/src/main/java/cokr/xit/fims/base/dao/OgdpMapper.java @@ -6,12 +6,11 @@ import java.util.Map; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.SelectProvider; import org.apache.ibatis.annotations.Update; -import org.apache.ibatis.annotations.UpdateProvider; import org.egovframe.rte.psl.dataaccess.mapper.Mapper; import cokr.xit.applib.SQLUtil; -import cokr.xit.fims.base.OgdpQuery; import cokr.xit.fims.base.FimsSigungu; +import cokr.xit.fims.base.OgdpQuery; import cokr.xit.foundation.component.AbstractMapper; import cokr.xit.foundation.data.DataObject; @@ -136,8 +135,8 @@ public interface OgdpMapper extends AbstractMapper { *
  • 그렇지 않으면 false
  • * */ - default boolean updateSgg(FimsSigungu sgg) { - return sgg != null && updateSgg(params().set("sgg", sgg)) == 1; + default boolean updateSggStng(FimsSigungu sgg) { + return sgg != null && updateSggStng(params().set("sgg", sgg)) == 1; } /**시군구 정보를 수정한다. @@ -148,7 +147,7 @@ public interface OgdpMapper extends AbstractMapper { * @return 저장된 정보수 */ @Update(SQLUtil.SCRIPT_START+""" - /* 시군구 설정정보 수정 (ogdpMapper.updateSgg) */ + /* 시군구 설정 정보 수정 (ogdpMapper.updateSggStng) */ UPDATE TB_SGG SET MDFCN_DT = """ @@ -169,7 +168,7 @@ public interface OgdpMapper extends AbstractMapper { WHERE SGG_CD = #{sgg.sggID} """+SQLUtil.SCRIPT_END) - int updateSgg(Map params); + int updateSggStng(Map params); /**지정한 조건에 따라 시군구 객체를 반환한다. * @param req 시군구 조회 조건 @@ -238,36 +237,42 @@ public interface OgdpMapper extends AbstractMapper { - @UpdateProvider(type=OgdpMapper.class, method="updateDeptProvider") - int updateDept(Map params); - - - public static String updateDeptProvider(Map params) { - - - String comment = "/* 부서 수정(ogdpMapper.updateDept) */ "; - - String updateSet = """ - UPDATE TB_DEPT + @Update(SQLUtil.SCRIPT_START+""" + /* 부서 설정 수정(ogdpMapper.updateDeptStng) */ + UPDATE TB_DEPT SET MDFCN_DT = - """ - +SQLUtil.now - +""" + """+SQLUtil.now+""" , MDFR = #{dept.modifiedBy} - """; - String where = """ - WHERE DEPT_CD = #{dept.deptID} - AND USE_YN = 'Y' - """; + , CVLCPT_LINK_SE_CD = #{dept.cvlcptLinkSeCd} + , VRBACNT_LINK_SE_CD = #{dept.vrbacntLinkSeCd} + , PSTOFC_NM = #{dept.pstofcNm} + , RG_NO_HEADER = #{dept.rgNoHeader} + , SNDNG_LINK_SE_CD = #{dept.sndngLinkSeCd} + , EGP_CON_ORG = #{dept.egpConOrg} + , EGP_RCEPT_ID = #{dept.egpRceptId} + , EGP_APVL_NB = #{dept.egpApvlNb} + , EGP_ESB_PATH = #{dept.egpEsbPath} + , EGP_POST_INST_ID = #{dept.egpPostInstId} + , EGP_CERT_CN = #{dept.egpCertCn} + , ENS_INTERFACE_ID = #{dept.ensInterfaceId} + , ENS_SOURCE_CD = #{dept.ensSourceCd} + , ENS_TARGET_CD = #{dept.ensTargetCd} + , ENS_URL = #{dept.ensUrl} + , NXRP_LINK_YN = #{dept.nxrpLinkYn} + , NXRP_RGN_SE_CD = #{dept.nxrpRgnSeCd} + , DTBN_BANK_NM = #{dept.dtbnBankNm} + , DTBN_ACTNO = #{dept.dtbnActno} + , DOC_HEADER = #{dept.docHeader} + , SRVR_OS = #{dept.srvrOs} + WHERE DEPT_CD = #{dept.deptID} + AND USE_YN = 'Y' + """ + +SQLUtil.SCRIPT_END) + int updateDeptStng(Map params); + - String updateSetAdd = params.get("updateSetAdd") == null ? "" : (String)params.get("updateSetAdd"); - return SQLUtil.SCRIPT_START - + comment - + updateSet + updateSetAdd + where - + SQLUtil.SCRIPT_END; - } @SelectProvider(type=OgdpMapper.class, method="selectDeptInfoProvider") diff --git a/src/main/java/cokr/xit/fims/base/service/bean/OgdpBean.java b/src/main/java/cokr/xit/fims/base/service/bean/OgdpBean.java index 290d98da..6ec757e3 100644 --- a/src/main/java/cokr/xit/fims/base/service/bean/OgdpBean.java +++ b/src/main/java/cokr/xit/fims/base/service/bean/OgdpBean.java @@ -8,10 +8,9 @@ import javax.annotation.Resource; import org.springframework.stereotype.Component; -import cokr.xit.base.user.Department; -import cokr.xit.fims.base.OgdpQuery; import cokr.xit.fims.base.FimsDepartment; import cokr.xit.fims.base.FimsSigungu; +import cokr.xit.fims.base.OgdpQuery; import cokr.xit.fims.base.dao.OgdpMapper; import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.component.AbstractBean; @@ -102,8 +101,8 @@ public class OgdpBean extends AbstractBean { *
  • 그렇지 않으면 false
  • * */ - public boolean updateSgg(FimsSigungu sgg) { - return ogdpMapper.updateSgg(sgg); + public boolean updateSggStng(FimsSigungu sgg) { + return ogdpMapper.updateSggStng(sgg); } /**지정한 조건에 따라 시군구 객체를 반환한다. @@ -140,41 +139,12 @@ public class OgdpBean extends AbstractBean { - public boolean updateDept(Department dept) { - if(dept != null && dept instanceof FimsDepartment fimsDept) { - String updateSetAdd = """ - , CVLCPT_LINK_SE_CD = #{dept.cvlcptLinkSeCd} - , VRBACNT_LINK_SE_CD = #{dept.vrbacntLinkSeCd} - , PSTOFC_NM = #{dept.pstofcNm} - , RG_NO_HEADER = #{dept.rgNoHeader} - , SNDNG_LINK_SE_CD = #{dept.sndngLinkSeCd} - , EGP_CON_ORG = #{dept.egpConOrg} - , EGP_RCEPT_ID = #{dept.egpRceptId} - , EGP_APVL_NB = #{dept.egpApvlNb} - , EGP_ESB_PATH = #{dept.egpEsbPath} - , EGP_POST_INST_ID = #{dept.egpPostInstId} - , EGP_CERT_CN = #{dept.egpCertCn} - , ENS_INTERFACE_ID = #{dept.ensInterfaceId} - , ENS_SOURCE_CD = #{dept.ensSourceCd} - , ENS_TARGET_CD = #{dept.ensTargetCd} - , ENS_URL = #{dept.ensUrl} - , NXRP_LINK_YN = #{dept.nxrpLinkYn} - , NXRP_RGN_SE_CD = #{dept.nxrpRgnSeCd} - , DTBN_BANK_NM = #{dept.dtbnBankNm} - , DTBN_ACTNO = #{dept.dtbnActno} - , DOC_HEADER = #{dept.docHeader} - , SRVR_OS = #{dept.srvrOs} - """; + public boolean updateDeptStng(FimsDepartment dept) { - boolean result = ogdpMapper.updateDept( - new DataObject() - .set("currentUser", currentUser()) - .set("dept", fimsDept) - .set("updateSetAdd", updateSetAdd)) == 1; + boolean result = ogdpMapper.updateDeptStng(new DataObject().set("currentUser", currentUser()).set("dept", dept)) == 1; + + return result; - return result; - } - return false; } 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 5d4cb1ce..27c67d55 100644 --- a/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java +++ b/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java @@ -14,8 +14,8 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; import cokr.xit.base.web.ApplicationController; -import cokr.xit.fims.base.OgdpQuery; import cokr.xit.fims.base.FimsSigungu; +import cokr.xit.fims.base.OgdpQuery; import cokr.xit.fims.base.service.bean.OgdpBean; import cokr.xit.fims.cmmn.CmmnQuery; import cokr.xit.fims.cmmn.service.StngService; @@ -42,7 +42,7 @@ public class Mngt03Controller extends ApplicationController { getSggInfo = "/010/getSggInfo.do", getTasks = "/010/getTasks.do", getVltns = "/010/getVltns.do", - updateSgg = "/010/updateSgg.do", + updateSggStng = "/010/updateSgg.do", updateTaskStng = "/010/updateTaskStng.do", createTaskStng = "/010/createTaskStng.do" ; @@ -130,15 +130,15 @@ public class Mngt03Controller extends ApplicationController { return setCollectionInfo(new ModelAndView("jsonView"), result, "vltn"); } - /**시군구 정보를 수정한다. + /**시군구 설정 정보를 수정한다. * @param sgg 시군구 정보, symbol 시군구 상징파일, logo 시군구 로고파일, offcs 시군구 직인파일 * @return jsonView *
     {
     	 *     "saved": 수정되었으면 true, 그렇지 않으면 false
     	 * }
    */ - @RequestMapping(name="시군구 정보 수정", value=METHOD_URL.updateSgg) - public ModelAndView updateSgg(FimsSigungu sgg, MultipartFile symbol, MultipartFile logo, MultipartFile offcs) { + @RequestMapping(name="시군구 설정 정보 수정", value=METHOD_URL.updateSggStng) + public ModelAndView updateSggStng(FimsSigungu sgg, MultipartFile symbol, MultipartFile logo, MultipartFile offcs) { ModelAndView mav = new ModelAndView("jsonView"); String sggCd = sgg.getSggID(); @@ -158,7 +158,7 @@ public class Mngt03Controller extends ApplicationController { sgg.setOfficialSealFilepath(newOffcs.get("filePath")); sgg.setOfficialSealFilename(newOffcs.get("fileName")); } - boolean saved = ogdpBean.updateSgg(sgg); + boolean saved = ogdpBean.updateSggStng(sgg); mav.addObject("saved", saved); return mav; diff --git a/src/main/java/cokr/xit/fims/mngt/web/Mngt04Controller.java b/src/main/java/cokr/xit/fims/mngt/web/Mngt04Controller.java index 89f19976..c6110c23 100644 --- a/src/main/java/cokr/xit/fims/mngt/web/Mngt04Controller.java +++ b/src/main/java/cokr/xit/fims/mngt/web/Mngt04Controller.java @@ -29,10 +29,10 @@ public class Mngt04Controller extends ApplicationController { public class METHOD_URL { public static final String - deptMngtMain = "/010/main.do" + deptStngMngtMain = "/010/main.do" , getDeptList = "/010/list.do" , getDeptInfo = "/020/info.do" - , updateDept = "/020/update.do" + , updateDeptStng = "/020/update.do" ; } @@ -44,11 +44,11 @@ public class Mngt04Controller extends ApplicationController { private OgdpBean ogdpBean; - /** 부서관리 메인화면을 연다. + /** 부서 설정관리 메인화면을 연다. * @return fims/mngt/mngt04010-main */ - @RequestMapping(name="부서 정보 관리 메인", value=METHOD_URL.deptMngtMain) - public ModelAndView deptMngtMain() { + @RequestMapping(name="부서 설정 정보 관리 메인", value=METHOD_URL.deptStngMngtMain) + public ModelAndView deptStngMngtMain() { ModelAndView mav = new ModelAndView(); mav.setViewName("fims/mngt/mngt04010-main"); @@ -110,10 +110,10 @@ public class Mngt04Controller extends ApplicationController { * "saved": 저장되었으면 true, 그렇지 않으면 false * } */ - @RequestMapping(name="부서 수정", value=METHOD_URL.updateDept) - public ModelAndView updateDept(FimsDepartment dept) { + @RequestMapping(name="부서 설정 수정", value=METHOD_URL.updateDeptStng) + public ModelAndView updateDeptStng(FimsDepartment dept) { ModelAndView mav = new ModelAndView("jsonView"); - boolean saved = ogdpBean.updateDept(dept); + boolean saved = ogdpBean.updateDeptStng(dept); mav.addObject("saved", saved); return mav;