diff --git a/src/main/java/cokr/xit/fims/cmmn/web/StngController.java b/src/main/java/cokr/xit/fims/cmmn/web/StngController.java index 64911175..959382a1 100644 --- a/src/main/java/cokr/xit/fims/cmmn/web/StngController.java +++ b/src/main/java/cokr/xit/fims/cmmn/web/StngController.java @@ -14,7 +14,9 @@ import org.springframework.web.servlet.ModelAndView; import cokr.xit.base.code.CommonCode; import cokr.xit.base.user.ManagedUser; +import cokr.xit.base.user.SigunguQuery; import cokr.xit.base.user.dao.UserMapper; +import cokr.xit.base.user.service.bean.SigunguBean; import cokr.xit.base.web.ApplicationController; import cokr.xit.fims.cmmn.ExtrForm; import cokr.xit.fims.cmmn.ExtrStngQuery; @@ -27,7 +29,6 @@ import cokr.xit.fims.cmmn.service.bean.ExtrStngBean; import cokr.xit.fims.cmmn.service.bean.OtptStngBean; import cokr.xit.fims.cmmn.service.bean.OutsourcingStngBean; import cokr.xit.fims.cmmn.service.bean.StngBean; -import cokr.xit.fims.stat.dao.StatMapper; import cokr.xit.foundation.data.DataObject; /**설정 관리 서비스의 웹 컨트롤러 @@ -65,6 +66,9 @@ public class StngController extends ApplicationController { @Resource(name = "stngBean") private StngBean stngBean; + @Resource(name = "sigunguBean") + private SigunguBean sigunguBean; + @Resource(name = "otptStngBean") private OtptStngBean otptStngBean; @@ -77,8 +81,6 @@ public class StngController extends ApplicationController { @Resource(name = "userMapper") private UserMapper userMapper; - @Resource(name = "statMapper") - private StatMapper statMapper; /** 출력물 설정 메인 화면을 연다. * @return 출력물 설정 메인 화면 @@ -111,8 +113,8 @@ public class StngController extends ApplicationController { //출력 설정 제목 ManagedUser currentUser = (ManagedUser) currentUser().getUser(); String sggCd = currentUser.getOrgID(); - DataObject sgg = statMapper.selectSggByCode(sggCd); - String sggNm = sgg.string("NAME"); + DataObject sgg = sigunguBean.getSigunguList(new SigunguQuery().setSggIDs(sggCd)).get(0); + String sggNm = sgg.string("SGG_NM"); Map> commonCodes = getCodesOf("FIM054","FIM047","FIM078"); List FIM047 = commonCodes.get("FIM047"); @@ -222,8 +224,8 @@ public class StngController extends ApplicationController { //설정 제목 ManagedUser currentUser = (ManagedUser) currentUser().getUser(); String sggCd = currentUser.getOrgID(); - DataObject sgg = statMapper.selectSggByCode(sggCd); - String sggNm = sgg.string("NAME"); + DataObject sgg = sigunguBean.getSigunguList(new SigunguQuery().setSggIDs(sggCd)).get(0); + String sggNm = sgg.string("SGG_NM"); Map> commonCodes = getCodesOf("FIM054","FIM047","FIM078"); List FIM054 = commonCodes.get("FIM054"); @@ -309,8 +311,8 @@ public class StngController extends ApplicationController { //설정 제목 ManagedUser currentUser = (ManagedUser) currentUser().getUser(); String sggCd = currentUser.getOrgID(); - DataObject sgg = statMapper.selectSggByCode(sggCd); - String sggNm = sgg.string("NAME"); + DataObject sgg = sigunguBean.getSigunguList(new SigunguQuery().setSggIDs(sggCd)).get(0); + String sggNm = sgg.string("SGG_NM"); Map> commonCodes = getCodesOf("FIM054","FIM047","FIM078"); List FIM047 = commonCodes.get("FIM047"); diff --git a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java index 2f90fd76..01b18aa4 100644 --- a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java +++ b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java @@ -58,7 +58,6 @@ import cokr.xit.fims.sprt.SprtQuery; import cokr.xit.fims.sprt.dao.IntegrationSearchMapper; import cokr.xit.fims.sprt.service.IntegrationSearchService; import cokr.xit.fims.sprt.service.bean.MediaBean; -import cokr.xit.fims.stat.dao.StatMapper; import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.data.DataObject; @@ -109,9 +108,6 @@ public class Sprt01Controller extends ApplicationController { @Resource(name="userMapper") protected UserMapper userMapper; - @Resource(name="statMapper") - protected StatMapper statMapper; - @Resource(name="otptStngBean") protected OtptStngBean otptStngBean; diff --git a/src/main/java/cokr/xit/fims/stat/dao/StatMapper.java b/src/main/java/cokr/xit/fims/stat/dao/StatMapper.java deleted file mode 100644 index f22b7d42..00000000 --- a/src/main/java/cokr/xit/fims/stat/dao/StatMapper.java +++ /dev/null @@ -1,21 +0,0 @@ -package cokr.xit.fims.stat.dao; - -import org.egovframe.rte.psl.dataaccess.mapper.Mapper; - -import cokr.xit.foundation.component.AbstractMapper; -import cokr.xit.foundation.data.DataObject; - -@Mapper("statMapper") -public interface StatMapper extends AbstractMapper { - - DataObject selectVltnById(String vltnId); - - DataObject selectSggByCode(String sggCd); - - DataObject selectDeptByCode(String deptCd); - - DataObject selectUserById(String userId); - - DataObject selectTeamById(String teamId); - -} diff --git a/src/main/java/cokr/xit/fims/stat/service/bean/StatBean.java b/src/main/java/cokr/xit/fims/stat/service/bean/StatBean.java index bdd862ef..cc0e6205 100644 --- a/src/main/java/cokr/xit/fims/stat/service/bean/StatBean.java +++ b/src/main/java/cokr/xit/fims/stat/service/bean/StatBean.java @@ -15,10 +15,19 @@ import javax.annotation.Resource; import org.springframework.stereotype.Component; import cokr.xit.base.code.CommonCode; +import cokr.xit.base.user.DepartmentQuery; +import cokr.xit.base.user.SigunguQuery; +import cokr.xit.base.user.UserQuery; +import cokr.xit.base.user.service.bean.DepartmentBean; +import cokr.xit.base.user.service.bean.SigunguBean; +import cokr.xit.base.user.service.bean.UserBean; import cokr.xit.fims.cmmn.CmmnQuery; import cokr.xit.fims.cmmn.CmmnUtil; import cokr.xit.fims.cmmn.CodeConverter; +import cokr.xit.fims.crdn.dao.CrdnTeamMapper; import cokr.xit.fims.crdn.service.bean.CrdnStngBean; +import cokr.xit.fims.mngt.VltnQuery; +import cokr.xit.fims.mngt.dao.VltnMapper; import cokr.xit.fims.stat.CodeSubsetInfo; import cokr.xit.fims.stat.CompositeKey; import cokr.xit.fims.stat.GroupInfo; @@ -26,7 +35,6 @@ import cokr.xit.fims.stat.NumberValueInfo; import cokr.xit.fims.stat.Stat; import cokr.xit.fims.stat.StatItem; import cokr.xit.fims.stat.StatQuery; -import cokr.xit.fims.stat.dao.StatMapper; import cokr.xit.foundation.component.AbstractBean; import cokr.xit.foundation.data.DataObject; @@ -34,11 +42,23 @@ import cokr.xit.foundation.data.DataObject; @Component("statBean") public class StatBean extends AbstractBean { - @Resource(name = "statMapper") - StatMapper statMapper; - @Resource(name = "crdnStngBean") - CrdnStngBean crdnStngBean; + private CrdnStngBean crdnStngBean; + + @Resource(name="sigunguBean") + protected SigunguBean sigunguBean; + + @Resource(name = "departmentBean") + private DepartmentBean departmentBean; + + @Resource(name="userBean") + private UserBean userBean; + + @Resource(name="crdnTeamMapper") + private CrdnTeamMapper teamMapper; + + @Resource(name="vltnMapper") + private VltnMapper vltnMapper; /**쿼리에서 날짜와 관련된 파라미터를 설정한다. * @param sql처리용 query, dayCol 날짜조회용 컬럼, from 조회시작일, to 조회종료일 @@ -547,19 +567,39 @@ public class StatBean extends AbstractBean { switch(type) { case "SGG_CD" : - result = statMapper.selectSggByCode(uniqId); + List sggs = sigunguBean.getSigunguList(new SigunguQuery().setSggIDs(uniqId)); + if(sggs != null && !sggs.isEmpty()) { + sggs.get(0).set("NAME", sggs.get(0).string("SGG_NM")); + result = sggs.get(0); + } break; case "DEPT_CD" : - result = statMapper.selectDeptByCode(uniqId); + List depts = departmentBean.getDepartmentList(new DepartmentQuery().setDeptIDs(uniqId)); + if(depts != null && !depts.isEmpty()) { + depts.get(0).set("NAME", depts.get(0).string("DEPT_NM")); + result = depts.get(0); + } break; case "VLTN_ID" : - result = statMapper.selectVltnById(uniqId); + DataObject vltn = vltnMapper.selectVltnInfo(new VltnQuery().setVltnId(uniqId)); + if(vltn != null && !vltn.isEmpty()) { + vltn.set("NAME", vltn.string("VLTN_NM")); + result = vltn; + } break; case "USER_ID" : - result = statMapper.selectUserById(uniqId); + List users = userBean.getUserList(new UserQuery().setUserIDs(uniqId)); + if(users != null && !users.isEmpty()) { + users.get(0).set("NAME", users.get(0).string("USER_NM")); + result = users.get(0); + } break; case "TEAM_ID" : - result = statMapper.selectTeamById(uniqId); + DataObject team = teamMapper.selectTeamInfo(uniqId); + if(team != null && !team.isEmpty()) { + team.set("NAME", team.string("TEAM_NM")); + result = team; + } break; } diff --git a/src/main/java/cokr/xit/fims/stat/web/Stat01Controller.java b/src/main/java/cokr/xit/fims/stat/web/Stat01Controller.java index 14a491e3..d1c4cce7 100644 --- a/src/main/java/cokr/xit/fims/stat/web/Stat01Controller.java +++ b/src/main/java/cokr/xit/fims/stat/web/Stat01Controller.java @@ -13,7 +13,9 @@ import org.springframework.web.servlet.ModelAndView; import cokr.xit.base.code.CommonCode; import cokr.xit.base.user.ManagedUser; +import cokr.xit.base.user.SigunguQuery; import cokr.xit.base.user.dao.UserMapper; +import cokr.xit.base.user.service.bean.SigunguBean; import cokr.xit.base.web.ApplicationController; import cokr.xit.fims.cmmn.service.bean.StngBean; import cokr.xit.fims.stat.CodeSubsetInfo; @@ -21,7 +23,6 @@ import cokr.xit.fims.stat.GroupInfo; import cokr.xit.fims.stat.NumberValueInfo; import cokr.xit.fims.stat.Stat; import cokr.xit.fims.stat.StatQuery; -import cokr.xit.fims.stat.dao.StatMapper; import cokr.xit.fims.stat.service.StatService; import cokr.xit.foundation.data.DataObject; @@ -49,12 +50,12 @@ public class Stat01Controller extends ApplicationController { @Resource(name="statService") private StatService statService; + @Resource(name="sigunguBean") + protected SigunguBean sigunguBean; + @Resource(name="userMapper") protected UserMapper userMapper; - @Resource(name="statMapper") - protected StatMapper statMapper; - @Resource(name = "stngBean") private StngBean stngBean; @@ -151,8 +152,8 @@ public class Stat01Controller extends ApplicationController { ManagedUser currentUser = (ManagedUser) currentUser().getUser(); String sggCd = currentUser.getOrgID(); mav.addObject("sggCd", sggCd); - DataObject sgg = statMapper.selectSggByCode(sggCd); - String sggNm = sgg.string("NAME"); + DataObject sgg = sigunguBean.getSigunguList(new SigunguQuery().setSggIDs(sggCd)).get(0); + String sggNm = sgg.string("SGG_NM"); mav.addObject("sggNm", sggNm); Map> commonCodes = getCodesOf("FIM054","FIM002"); @@ -176,8 +177,8 @@ public class Stat01Controller extends ApplicationController { ManagedUser currentUser = (ManagedUser) currentUser().getUser(); String sggCd = currentUser.getOrgID(); mav.addObject("sggCd", sggCd); - DataObject sgg = statMapper.selectSggByCode(sggCd); - String sggNm = sgg.string("NAME"); + DataObject sgg = sigunguBean.getSigunguList(new SigunguQuery().setSggIDs(sggCd)).get(0); + String sggNm = sgg.string("SGG_NM"); mav.addObject("sggNm", sggNm); Map> commonCodes = getCodesOf("FIM054","FIM002"); @@ -202,8 +203,8 @@ public class Stat01Controller extends ApplicationController { ManagedUser currentUser = (ManagedUser) currentUser().getUser(); String sggCd = currentUser.getOrgID(); mav.addObject("sggCd", sggCd); - DataObject sgg = statMapper.selectSggByCode(sggCd); - String sggNm = sgg.string("NAME"); + DataObject sgg = sigunguBean.getSigunguList(new SigunguQuery().setSggIDs(sggCd)).get(0); + String sggNm = sgg.string("SGG_NM"); mav.addObject("sggNm", sggNm); Map> commonCodes = getCodesOf("FIM054"); @@ -226,8 +227,8 @@ public class Stat01Controller extends ApplicationController { ManagedUser currentUser = (ManagedUser) currentUser().getUser(); String sggCd = currentUser.getOrgID(); mav.addObject("sggCd", sggCd); - DataObject sgg = statMapper.selectSggByCode(sggCd); - String sggNm = sgg.string("NAME"); + DataObject sgg = sigunguBean.getSigunguList(new SigunguQuery().setSggIDs(sggCd)).get(0); + String sggNm = sgg.string("SGG_NM"); mav.addObject("sggNm", sggNm); Map> commonCodes = getCodesOf("FIM054"); @@ -250,8 +251,8 @@ public class Stat01Controller extends ApplicationController { ManagedUser currentUser = (ManagedUser) currentUser().getUser(); String sggCd = currentUser.getOrgID(); mav.addObject("sggCd", sggCd); - DataObject sgg = statMapper.selectSggByCode(sggCd); - String sggNm = sgg.string("NAME"); + DataObject sgg = sigunguBean.getSigunguList(new SigunguQuery().setSggIDs(sggCd)).get(0); + String sggNm = sgg.string("SGG_NM"); mav.addObject("sggNm", sggNm); Map> commonCodes = getCodesOf("FIM054","FIM002"); diff --git a/src/main/resources/sql/mapper/fims/mngt/vltn-mapper.xml b/src/main/resources/sql/mapper/fims/mngt/vltn-mapper.xml index dabbbccf..8bbe6e50 100644 --- a/src/main/resources/sql/mapper/fims/mngt/vltn-mapper.xml +++ b/src/main/resources/sql/mapper/fims/mngt/vltn-mapper.xml @@ -74,7 +74,10 @@ -SELECT VLTN_ID - , VLTN_NM AS NAME -FROM TB_VLTN -WHERE VLTN_ID = #{vltnId} - - - - - - - - - - - \ No newline at end of file