From b9880f7c43015af79cb4581720cbc06b08489d56 Mon Sep 17 00:00:00 2001 From: leebj Date: Thu, 4 Jul 2024 11:00:03 +0900 Subject: [PATCH] =?UTF-8?q?=EC=86=8C=EC=8A=A4=20=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 | 23 ------------------- .../xit/fims/base/service/bean/OgdpBean.java | 9 ++++---- .../resources/sql/mapper/base/user-mapper.xml | 4 ++-- 3 files changed, 7 insertions(+), 29 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 4899d334..c6c0dd27 100644 --- a/src/main/java/cokr/xit/fims/base/dao/OgdpMapper.java +++ b/src/main/java/cokr/xit/fims/base/dao/OgdpMapper.java @@ -141,29 +141,6 @@ public interface OgdpMapper extends AbstractMapper { List selectAbleOgdpList(Map params); - - /**사용자의 시군구코드,시군구명,기관코드,기관명,부서코드,부서명을 반환한다.
- * @param 사용자ID - * @return 시군구코드,시군구명,기관코드,기관명,부서코드,부서명 - */ - @Select(SQLUtil.SCRIPT_START+""" - /* 사용자의 시군구,기관,부서 조회(ogdpMapper.selectOgdpInfoOfUser) */ - SELECT S.SGG_CD - , S.SGG_NM - , U.NSTT_CD AS INST_CD - , S.INST_NM - , U.DEPT_CD - , D.DEPT_NM - FROM TB_USER U - LEFT OUTER JOIN TB_SGG S ON (U.ORG_ID = S.SGG_CD) - LEFT OUTER JOIN TB_DEPT D ON (U.DEPT_CD = D.DEPT_CD) - WHERE U.USER_ID = #{userId} - """+SQLUtil.SCRIPT_END) - DataObject selectOgdpInfoOfUser(String userId); - - - - @Select(SQLUtil.SCRIPT_START+""" /* 유저 수 조회(ogdpMapper.countUser) */ SELECT COUNT(*) 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 f7d3a95b..8e01a198 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,6 +8,7 @@ import javax.annotation.Resource; import org.springframework.stereotype.Component; +import cokr.xit.base.user.dao.UserMapper; import cokr.xit.fims.base.FimsDepartment; import cokr.xit.fims.base.FimsSigungu; import cokr.xit.fims.base.OgdpQuery; @@ -25,6 +26,9 @@ public class OgdpBean extends AbstractBean { @Resource(name="ogdpMapper") private OgdpMapper ogdpMapper; + @Resource(name="userMapper") + private UserMapper userMapper; + public Object selectAllOgdpList() { return ogdpMapper.selectAllOgdpList(); @@ -38,9 +42,6 @@ public class OgdpBean extends AbstractBean { return ogdpMapper.countUser(sggCd); } - public DataObject selectOgdpInfoOfUser(String userId){ - return ogdpMapper.selectOgdpInfoOfUser(userId); - } /**userInfo 객체에 해당 사용자가 소속된 시군구,기관,부서 정보를 저장한다. @@ -49,7 +50,7 @@ public class OgdpBean extends AbstractBean { */ public void initUserInfo(UserInfo userInfo) { - DataObject ogdpInfo = ogdpMapper.selectOgdpInfoOfUser(userInfo.getId()); + DataObject ogdpInfo = userMapper.getUserInfo(userInfo.getId()); Map infoMap = userInfo.getInfo(); if(ogdpInfo == null) { diff --git a/src/main/resources/sql/mapper/base/user-mapper.xml b/src/main/resources/sql/mapper/base/user-mapper.xml index e19d4fac..8a3b3b6e 100644 --- a/src/main/resources/sql/mapper/base/user-mapper.xml +++ b/src/main/resources/sql/mapper/base/user-mapper.xml @@ -60,7 +60,6 @@ SELECT A.USER_ID , A.EML_ADRS , A.POS_NM , A.GRP_ID - , A.ORG_ID , A.CRTFC_DN , A.LOCK_YN , A.LOCK_CNT @@ -73,7 +72,8 @@ SELECT A.USER_ID , (CASE WHEN A.NSTT_CD = 'default' THEN '기본 기관' ELSE B.INST_NM END) AS INST_NM , A.DEPT_CD AS DEPT_CD , (CASE WHEN A.DEPT_CD = 'default' THEN '기본 부서' ELSE B.DEPT_NM END) AS DEPT_NM - , B.SGG_CD AS SGG_CD + , A.ORG_ID AS ORG_ID + , A.ORG_ID AS SGG_CD , B.SGG_NM AS SGG_NM FROM TB_USER A LEFT OUTER JOIN (