소스 정리

main
이범준 4 months ago
parent 69cdea3caa
commit 2982685767

@ -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<String, List<CommonCode>> commonCodes = getCodesOf("FIM054","FIM047","FIM078");
List<CommonCode> 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<String, List<CommonCode>> commonCodes = getCodesOf("FIM054","FIM047","FIM078");
List<CommonCode> 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<String, List<CommonCode>> commonCodes = getCodesOf("FIM054","FIM047","FIM078");
List<CommonCode> FIM047 = commonCodes.get("FIM047");

@ -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;

@ -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);
}

@ -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<DataObject> 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<DataObject> 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<DataObject> 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;
}

@ -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<String, List<CommonCode>> 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<String, List<CommonCode>> 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<String, List<CommonCode>> 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<String, List<CommonCode>> 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<String, List<CommonCode>> commonCodes = getCodesOf("FIM054","FIM002");

@ -74,7 +74,10 @@
<select id="selectVltns" parameterType="map" resultType="dataobject">/* 위반 정보 객체 가져오기(vltnMapper.selectVltns) */
<include refid="select" />
WHERE V.SGG_CD = #{sggCd} <!-- 시군구 코드 -->
WHERE 1 = 1
<if test="sggCd != null">
AND V.SGG_CD = #{sggCd} <!-- 시군구 코드 -->
</if>
<if test="taskSeCd != null">
AND V.TASK_SE_CD = #{taskSeCd} <!-- 업무 구분 코드 -->
</if>

@ -1,40 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cokr.xit.fims.stat.dao.StatMapper">
<select id="selectVltnById" parameterType="string" resultType="dataobject">
SELECT VLTN_ID
, VLTN_NM AS NAME
FROM TB_VLTN
WHERE VLTN_ID = #{vltnId}
</select>
<select id="selectSggByCode" parameterType="string" resultType="dataobject">
SELECT SGG_CD
, SGG_NM AS NAME
FROM TB_SGG
WHERE SGG_CD = #{sggCd}
</select>
<select id="selectDeptByCode" parameterType="string" resultType="dataobject">
SELECT DEPT_CD
, DEPT_NM AS NAME
FROM TB_DEPT
WHERE DEPT_CD = #{deptCd}
</select>
<select id="selectUserById" parameterType="string" resultType="dataobject">
SELECT USER_ID
, USER_NM AS NAME
FROM TB_USER
WHERE USER_ID = #{userId}
</select>
<select id="selectTeamById" parameterType="string" resultType="dataobject">
SELECT TEAM_ID
, TEAM_NM AS NAME
FROM TB_TEAM
WHERE TEAM_ID = #{teamId}
</select>
</mapper>
Loading…
Cancel
Save