From 9aae97becbc86c43a9ad9b90f143dc2bcee7df03 Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Tue, 25 Jun 2024 13:19:03 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EA=B8=B0=EA=B4=80/=EB=B6=80=EC=84=9C?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cokr/xit/adds/MainController.java | 29 +-- .../java/cokr/xit/base/SggDeptController.java | 10 + .../sql/mapper/base/department-mapper.xml | 111 ++++++++ .../sql/mapper/base/sigungu-mapper.xml | 121 +++++++++ .../WEB-INF/jsp/base/user/dept-info.jsp | 101 ++++++++ .../WEB-INF/jsp/base/user/select-sggDepts.jsp | 57 ++++ .../webapp/WEB-INF/jsp/base/user/sgg-dept.jsp | 245 ++++++++++++++++++ .../webapp/WEB-INF/jsp/base/user/sgg-info.jsp | 122 +++++++++ .../WEB-INF/jsp/base/user/user-info.jsp | 45 +++- src/main/webapp/WEB-INF/jsp/include/tail.jsp | 1 + src/main/webapp/WEB-INF/jsp/login.jsp | 43 ++- 11 files changed, 851 insertions(+), 34 deletions(-) create mode 100644 src/main/java/cokr/xit/base/SggDeptController.java create mode 100644 src/main/resources/sql/mapper/base/department-mapper.xml create mode 100644 src/main/resources/sql/mapper/base/sigungu-mapper.xml create mode 100644 src/main/webapp/WEB-INF/jsp/base/user/dept-info.jsp create mode 100644 src/main/webapp/WEB-INF/jsp/base/user/select-sggDepts.jsp create mode 100644 src/main/webapp/WEB-INF/jsp/base/user/sgg-dept.jsp create mode 100644 src/main/webapp/WEB-INF/jsp/base/user/sgg-info.jsp diff --git a/src/main/java/cokr/xit/adds/MainController.java b/src/main/java/cokr/xit/adds/MainController.java index f239443..659fedc 100644 --- a/src/main/java/cokr/xit/adds/MainController.java +++ b/src/main/java/cokr/xit/adds/MainController.java @@ -1,29 +1,12 @@ package cokr.xit.adds; - -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; - -import cokr.xit.foundation.data.DataObject; -import cokr.xit.foundation.web.AbstractController; -import cokr.xit.foundation.web.RequestHandlerReader; @Controller -public class MainController extends AbstractController { - @Autowired - private RequestMappingHandlerMapping requestHandlers; - - @GetMapping(name="로그인", value="/login.do") - public String loginPage() { - return "login"; - } - +public class MainController extends cokr.xit.base.web.MainController { + @Override @GetMapping(name="홈", value={"/", "/index.do"}) public ModelAndView mainPage() { ModelAndView mav = dashboard(); @@ -35,12 +18,4 @@ public class MainController extends AbstractController { public ModelAndView dashboard() { return new ModelAndView("dashboard"); } - - @RequestMapping(name="기능 URL 선택", value="/urls.do") - public ModelAndView getURLs(boolean multiple) { - List urls = new RequestHandlerReader().read(requestHandlers); - return new ModelAndView("select-url") - .addObject("multiple", multiple) - .addObject("urls", toJson(urls)); - } } \ No newline at end of file diff --git a/src/main/java/cokr/xit/base/SggDeptController.java b/src/main/java/cokr/xit/base/SggDeptController.java new file mode 100644 index 0000000..97901f1 --- /dev/null +++ b/src/main/java/cokr/xit/base/SggDeptController.java @@ -0,0 +1,10 @@ +package cokr.xit.base; + +import org.springframework.stereotype.Controller; + +import cokr.xit.base.user.Department; +import cokr.xit.base.user.Sigungu; +import cokr.xit.base.user.web.SigunguDepartmentController; + +@Controller +public class SggDeptController extends SigunguDepartmentController {} \ No newline at end of file diff --git a/src/main/resources/sql/mapper/base/department-mapper.xml b/src/main/resources/sql/mapper/base/department-mapper.xml new file mode 100644 index 0000000..184bee0 --- /dev/null +++ b/src/main/resources/sql/mapper/base/department-mapper.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + +SELECT DEPT_CD + , SGG_CD + , INST_CD + , DEPT_NM + , DEPT_TELNO + , DEPT_FXNO + , USE_YN + , REG_DT + , RGTR + , MDFCN_DT + , MDFR + FROM TB_DEPT + + + + + +SELECT A.SGG_CD, SGG_NM, A.INST_CD, INST_NM, DEPT_CD, DEPT_NM + FROM TB_SGG A, TB_DEPT B + WHERE A.USE_YN = 'Y' + AND B.USE_YN = 'Y' + AND A.SGG_CD = B.SGG_CD + AND A.INST_CD = B.INST_CD + + + +/* 부서 정보 등록(departmentMapper.insert) */ +INSERT INTO TB_DEPT ( + DEPT_CD + , SGG_CD + , INST_CD + , DEPT_NM + , DEPT_TELNO + , DEPT_FXNO + , USE_YN + , REG_DT + , RGTR + , MDFCN_DT + , MDFR +) VALUES ( + #{deptID} + , #{sggID} + , #{instCode} + , #{name} + , #{telno} + , #{faxno} + , #{useYN} + , #{createdAt} + , #{createdBy} + , #{lastModified} + , #{modifiedBy} +) + +/* 부서 정보 수정(departmentMapper.update) */ +UPDATE TB_DEPT + SET SGG_CD = #{sggID} + , INST_CD = #{instCode} + , DEPT_NM = #{name} + , DEPT_TELNO = #{telno} + , DEPT_FXNO = #{faxno} + , MDFCN_DT = #{lastModified} + , MDFR = #{modifiedBy} + WHERE DEPT_CD = #{deptID} + +/* 부서 정보 삭제(departmentMapper.deleteDepartment) */ +UPDATE TB_DEPT + SET USE_YN = 'N' + , MDFCN_DT = + , MDFR = #{currentUser.id} + AND SGG_CD IN (#{sggID}) + AND DEPT_CD IN (#{deptID}) + + \ No newline at end of file diff --git a/src/main/resources/sql/mapper/base/sigungu-mapper.xml b/src/main/resources/sql/mapper/base/sigungu-mapper.xml new file mode 100644 index 0000000..f034d48 --- /dev/null +++ b/src/main/resources/sql/mapper/base/sigungu-mapper.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + +SELECT SGG_CD + , SGG_NM + , INST_CD + , INST_SE_CD + , INST_NM + , INST_ADDR + , INST_DADDR + , INST_ZIP + , OFFCS_FILE_PATH + , OFFCS_FILE_NM + , USE_YN + , REG_DT + , RGTR + , MDFCN_DT + , MDFR + FROM TB_SGG + + + + + +/* 시군구 등록(sigunguMapper.insert) */ +INSERT INTO TB_SGG ( + SGG_CD + , SGG_NM + , INST_CD + , INST_SE_CD + , INST_NM + , INST_ADDR + , INST_DADDR + , INST_ZIP + , OFFCS_FILE_PATH + , OFFCS_FILE_NM + , USE_YN + , REG_DT + , RGTR + , MDFCN_DT + , MDFR +) VALUES ( + #{sggID} + , #{sggName} + , #{instCode} + , #{instType} + , #{instName} + , #{instAddress} + , #{instDetailAddress} + , #{instZipCode} + , #{officialSealFilepath} + , #{officialSealFilename} + , #{useYN} + , #{createdAt} + , #{createdBy} + , #{lastModified} + , #{modifiedBy} +) + +/* 시군구 수정(sigunguMapper.update) */ +UPDATE TB_SGG + SET INST_CD = #{instCode} + , INST_SE_CD = #{instType} + , SGG_NM = #{sggName} + , INST_NM = #{instName} + , INST_ADDR = #{instAddress} + , INST_DADDR = #{instDetailAddress} + , INST_ZIP = #{instZipCode} + , OFFCS_FILE_PATH = #{officialSealFilepath} + , OFFCS_FILE_NM = #{officialSealFilename} + , USE_YN = #{useYN} + , MDFCN_DT = #{lastModified} + , MDFR = #{modifiedBy} + WHERE SGG_CD = #{sggID} + +/* 시군구 삭제(sigunguMapper.delete) */ +UPDATE TB_SGG + SET USE_YN = 'N' + , MDFCN_DT = + , MDFR = #{currentUser.id} + WHERE SGG_CD IN (#{sggID}) + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/base/user/dept-info.jsp b/src/main/webapp/WEB-INF/jsp/base/user/dept-info.jsp new file mode 100644 index 0000000..9e088b6 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/base/user/dept-info.jsp @@ -0,0 +1,101 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> +<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> +
+
+
+
+ +
+ + + +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/base/user/select-sggDepts.jsp b/src/main/webapp/WEB-INF/jsp/base/user/select-sggDepts.jsp new file mode 100644 index 0000000..b665b92 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/base/user/select-sggDepts.jsp @@ -0,0 +1,57 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> +<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/base/user/sgg-dept.jsp b/src/main/webapp/WEB-INF/jsp/base/user/sgg-dept.jsp new file mode 100644 index 0000000..424f7f6 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/base/user/sgg-dept.jsp @@ -0,0 +1,245 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> +<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> +기관 정보 + +
+ +
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/base/user/sgg-info.jsp b/src/main/webapp/WEB-INF/jsp/base/user/sgg-info.jsp new file mode 100644 index 0000000..777d0e1 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/base/user/sgg-info.jsp @@ -0,0 +1,122 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> +<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> +
+
+
+
+ +
+
+ + +
+
+
+
+
+
+ +
+
+ + + +
+
+
+
+
+
+ +
+
+ + + +
+
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/base/user/user-info.jsp b/src/main/webapp/WEB-INF/jsp/base/user/user-info.jsp index ca9ab48..40d8eb7 100644 --- a/src/main/webapp/WEB-INF/jsp/base/user/user-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/base/user/user-info.jsp @@ -1,5 +1,6 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> <%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> +${currentUser.hasAuthorities("ROLE_ADMIN")}
@@ -44,6 +45,26 @@
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+