소스 정리

main
이범준 4 months ago
parent a29f06fdf7
commit 42ef395cce

@ -4,7 +4,6 @@ import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
@ -16,7 +15,21 @@ import cokr.xit.foundation.data.DataObject;
@Mapper("ogdpMapper")
public interface OgdpMapper extends AbstractMapper {
public static String selectAdd = """
public static String select = """
SELECT D.DEPT_CD <!-- -->
, D.SGG_CD <!-- -->
, (SELECT SGG_NM FROM TB_SGG WHERE SGG_CD = D.SGG_CD) AS SGG_NM <!-- -->
, D.INST_CD <!-- -->
, (SELECT INST_NM FROM TB_SGG WHERE INST_CD = D.INST_CD) AS INST_NM <!-- -->
, D.DEPT_NM <!-- -->
, D.DEPT_TELNO <!-- -->
, D.DEPT_FXNO <!-- -->
, D.USE_YN <!-- -->
, (CASE D.USE_YN WHEN 'Y' THEN '' WHEN 'N' THEN '' ELSE '' END) AS USE_YN_NM <!-- -->
, D.REG_DT <!-- -->
, D.RGTR <!-- -->
, D.MDFCN_DT <!-- -->
, D.MDFR <!-- -->
, D.CVLCPT_LINK_SE_CD <!-- -->
, D.VRBACNT_LINK_SE_CD <!-- -->
, D.PSTOFC_NM <!-- -->
@ -39,6 +52,21 @@ public interface OgdpMapper extends AbstractMapper {
, D.DTBN_ACTNO <!-- -->
, D.DOC_HEADER <!-- 릿 -->
, D.SRVR_OS <!-- OS -->
FROM TB_DEPT D
<where>
<if test="sggCd != null">
AND D.SGG_CD = #{sggCd} <!-- -->
</if>
<if test="deptCd != null">
AND D.DEPT_CD = #{deptCd} <!-- -->
</if>
<if test="instCd != null">
AND D.INST_CD = #{instCd} <!-- -->
</if>
<if test="useYn != null">
AND D.USE_YN = #{useYn} <!-- -->
</if>
</where>
""";
/** , .<br />
@ -152,7 +180,7 @@ public interface OgdpMapper extends AbstractMapper {
/** .
/** .
* @param sgg
* @return
* <ul><li> true</li>
@ -163,9 +191,9 @@ public interface OgdpMapper extends AbstractMapper {
return sgg != null && updateSggStng(params().set("sgg", sgg)) == 1;
}
/** .
/** .
* @param params
* <ul><li>"sgg" - </li>
* <ul><li>"sgg" - </li>
* <li>"currentUser" - </li>
* </ul>
* @return
@ -194,33 +222,27 @@ public interface OgdpMapper extends AbstractMapper {
"""+SQLUtil.SCRIPT_END)
int updateSggStng(Map<String, Object> params);
/** .
/** .
* @param req
* @return
*/
default DataObject selectSggInfo(OgdpQuery req) {
default DataObject selectSggStngInfo(OgdpQuery req) {
// 사용 여부 확인
if (req.getUseYn() == null) {
req.setUseYn("Y");
}
return selectSgg(req);
return selectSggStng(req);
}
/** .
/** .
* @param req
* @return
*/
@SelectProvider(type=OgdpMapper.class, method="selectSggProvider")
DataObject selectSgg(OgdpQuery req);
public static String selectSggProvider() {
String comment = " /* 시군구 객체 가져오기(ogdpMapper.selectSgg) */ ";
String selectFrom = """
SELECT S.SGG_CD <!-- -->
@Select(SQLUtil.SCRIPT_START+"""
/* 시군구 설정 객체 가져오기(ogdpMapper.selectSgg) */
SELECT S.SGG_CD <!-- -->
, S.SGG_NM <!-- -->
, S.INST_SE_CD <!-- -->
, S.INST_CD <!-- -->
@ -240,9 +262,7 @@ public interface OgdpMapper extends AbstractMapper {
, S.OFFCS_FILE_PATH <!-- -->
, S.OFFCS_FILE_NM <!-- -->
FROM TB_SGG S
""";
String where = """
<where>
<where>
<if test="sggCd != null">
AND S.SGG_CD = #{sggCd} <!-- -->
</if>
@ -250,13 +270,9 @@ public interface OgdpMapper extends AbstractMapper {
AND S.USE_YN = #{useYn} <!-- -->
</if>
</where>
""";
"""+SQLUtil.SCRIPT_END)
DataObject selectSggStng(OgdpQuery req);
return SQLUtil.SCRIPT_START
+ comment
+ selectFrom + where
+ SQLUtil.SCRIPT_END;
}
@ -299,78 +315,22 @@ public interface OgdpMapper extends AbstractMapper {
@SelectProvider(type=OgdpMapper.class, method="selectDeptInfoProvider")
DataObject selectDeptInfo(OgdpQuery req);
public static String selectDeptInfoProvider(OgdpQuery req) {
String comment = "/* 부서 객체 가져오기(ogdpMapper.selectDeptInfo) */ ";
String selectFromWhere = selectDept(req);
@Select(SQLUtil.SCRIPT_START
+ " /* 부서 설정 객체 가져오기(ogdpMapper.selectDeptInfo) */ "
+ select
+ SQLUtil.SCRIPT_END)
DataObject selectDeptStngInfo(OgdpQuery req);
return SQLUtil.SCRIPT_START
+ comment
+ selectFromWhere
+ SQLUtil.SCRIPT_END;
}
@SelectProvider(type=OgdpMapper.class, method="selectDeptListProvider")
List<DataObject> selectDeptList(OgdpQuery query);
public static String selectDeptListProvider(OgdpQuery req) {
@Select(SQLUtil.SCRIPT_START
+ " /* 부서 설정 객체 목록 가져오기(ogdpMapper.selectDeptList) */ "
+ SQLUtil.pagingPrefix
+ select
+ SQLUtil.orderBy
+ SQLUtil.pagingSuffix
+ SQLUtil.SCRIPT_END)
List<DataObject> selectDeptStngList(OgdpQuery query);
String comment = "/* 부서 객체 목록 가져오기(ogdpMapper.selectDeptList) */ ";
String selectFromWhere = selectDept(req);
return SQLUtil.SCRIPT_START
+ comment
+ SQLUtil.pagingPrefix
+ selectFromWhere
+ SQLUtil.orderBy
+ SQLUtil.pagingSuffix
+ SQLUtil.SCRIPT_END;
}
public static String selectDept(OgdpQuery req) {
String select = """
SELECT D.DEPT_CD <!-- -->
, D.SGG_CD <!-- -->
, (SELECT SGG_NM FROM TB_SGG WHERE SGG_CD = D.SGG_CD) AS SGG_NM <!-- -->
, D.INST_CD <!-- -->
, (SELECT INST_NM FROM TB_SGG WHERE INST_CD = D.INST_CD) AS INST_NM <!-- -->
, D.DEPT_NM <!-- -->
, D.DEPT_TELNO <!-- -->
, D.DEPT_FXNO <!-- -->
, D.USE_YN <!-- -->
, (CASE D.USE_YN WHEN 'Y' THEN '' WHEN 'N' THEN '' ELSE '' END) AS USE_YN_NM <!-- -->
, D.REG_DT <!-- -->
, D.RGTR <!-- -->
, D.MDFCN_DT <!-- -->
, D.MDFR <!-- -->
""";
String fromWhere = """
FROM TB_DEPT D
<where>
<if test="sggCd != null">
AND D.SGG_CD = #{sggCd} <!-- -->
</if>
<if test="deptCd != null">
AND D.DEPT_CD = #{deptCd} <!-- -->
</if>
<if test="instCd != null">
AND D.INST_CD = #{instCd} <!-- -->
</if>
<if test="useYn != null">
AND D.USE_YN = #{useYn} <!-- -->
</if>
</where>
""";
return select + selectAdd + fromWhere;
}
}

@ -86,10 +86,12 @@ public class OgdpBean extends AbstractBean {
* @param req
* @return
*/
public DataObject getSggInfo(OgdpQuery req) {
return ogdpMapper.selectSggInfo(req);
public DataObject getSggStngInfo(OgdpQuery req) {
return ogdpMapper.selectSggStngInfo(req);
}
public List<DataObject> getDeptList(OgdpQuery query) {
public List<DataObject> getDeptStngList(OgdpQuery query) {
// 기본 정렬
if (query.getOrderBy() == null) {
if(query.getFetchSize() > 0) {
@ -101,15 +103,15 @@ public class OgdpBean extends AbstractBean {
return ogdpMapper.selectDeptList(query);
return ogdpMapper.selectDeptStngList(query);
}
public DataObject getDeptInfo(OgdpQuery query) {
public DataObject getDeptStngInfo(OgdpQuery query) {
return ogdpMapper.selectDeptInfo(query);
return ogdpMapper.selectDeptStngInfo(query);
}

@ -7,7 +7,7 @@ import cokr.xit.base.user.Sigungu;
import cokr.xit.base.user.web.SigunguDepartmentController;
@Controller
public class FimsSggDeptController extends SigunguDepartmentController<Sigungu, Department> {
public class OgdpController extends SigunguDepartmentController<Sigungu, Department> {
}

@ -39,7 +39,7 @@ public class Mngt03Controller extends ApplicationController {
public class METHOD_URL {
public static final String
sggMngtMain = "/010/main.do",
getSggInfo = "/010/getSggInfo.do",
getSggStngInfo = "/010/getSggInfo.do",
getTasks = "/010/getTasks.do",
getVltns = "/010/getVltns.do",
updateSggStng = "/010/updateSgg.do",
@ -102,10 +102,10 @@ public class Mngt03Controller extends ApplicationController {
* @param req
* @return jsonView
*/
@RequestMapping(name="시군구 조회", value=METHOD_URL.getSggInfo)
@RequestMapping(name="시군구 설정 조회", value=METHOD_URL.getSggStngInfo)
public ModelAndView getSggInfo(OgdpQuery req) {
ModelAndView mav = new ModelAndView("jsonView");
DataObject sggInfo = ogdpBean.getSggInfo(req);
DataObject sggInfo = ogdpBean.getSggStngInfo(req);
mav.addObject("sggInfo", sggInfo);
return mav;
}

@ -30,8 +30,8 @@ public class Mngt04Controller extends ApplicationController {
public class METHOD_URL {
public static final String
deptStngMngtMain = "/010/main.do"
, getDeptList = "/010/list.do"
, getDeptInfo = "/020/info.do"
, getDeptStngList = "/010/list.do"
, getDeptStngInfo = "/020/info.do"
, updateDeptStng = "/020/update.do"
;
}
@ -62,16 +62,16 @@ public class Mngt04Controller extends ApplicationController {
}
/** .<br />
* {@link OgdpService#getDeptList(CmmnQuery)}
* {@link OgdpService#getDeptStngList(CmmnQuery)}
* @param query
* @return jsonView
*/
@RequestMapping(name="부서 목록 조회", value=METHOD_URL.getDeptList)
public ModelAndView getDeptList(OgdpQuery query) {
@RequestMapping(name="부서 목록 조회", value=METHOD_URL.getDeptStngList)
public ModelAndView getDeptStngList(OgdpQuery query) {
setFetchSize(query);
return setCollectionInfo(new ModelAndView("jsonView"), ogdpBean.getDeptList(query),"","");
return setCollectionInfo(new ModelAndView("jsonView"), ogdpBean.getDeptStngList(query),"","");
}
@ -82,12 +82,12 @@ public class Mngt04Controller extends ApplicationController {
* "deptInfo":
* }</pre>
*/
@RequestMapping(name="부서 상세 조회", value=METHOD_URL.getDeptInfo)
public ModelAndView getDeptInfo(OgdpQuery query) {
@RequestMapping(name="부서 상세 조회", value=METHOD_URL.getDeptStngInfo)
public ModelAndView getDeptStngInfo(OgdpQuery query) {
DataObject deptInfo = new DataObject();
if(!ifEmpty(query.getDeptCd(), ()->"").equals("")) {
deptInfo = ogdpBean.getDeptInfo(query);
deptInfo = ogdpBean.getDeptStngInfo(query);
} else {
deptInfo = null;
}

@ -145,7 +145,7 @@ public class NisIndivBean extends AbstractBean {
DataObject userInfo = userBean.getUserInfo(currentUser().getId());
// 2. 부서 정보
DataObject deptInfo = ogdpBean.getDeptInfo(new OgdpQuery().setDeptCd(userInfo.string("DEPT_CD")));
DataObject deptInfo = ogdpBean.getDeptStngInfo(new OgdpQuery().setDeptCd(userInfo.string("DEPT_CD")));
// 3. 세외수입 과태료대장에 연계할 단속 정보를 조회
DataObject selectCrdnInfo = nisA01Mapper.selectCrdnInfo(req.getCrdnId());
@ -347,7 +347,7 @@ public class NisIndivBean extends AbstractBean {
DataObject userInfo = userBean.getUserInfo(currentUser().getId());
// 2. 부서 정보
DataObject deptInfo = ogdpBean.getDeptInfo(new OgdpQuery().setDeptCd(userInfo.string("DEPT_CD")));
DataObject deptInfo = ogdpBean.getDeptStngInfo(new OgdpQuery().setDeptCd(userInfo.string("DEPT_CD")));
// 3. 세외수입 과태료대장에 연계할 단속 정보를 조회
DataObject selectCrdnInfo = nisA01Mapper.selectCrdnInfo(req.getCrdnId());

Loading…
Cancel
Save