소스 정리

main
이범준 4 months ago
parent cf29004c20
commit 0389e95ebf

@ -164,21 +164,14 @@ public interface OgdpMapper extends AbstractMapper {
/** .<br />
* @param
* @return
*/
@Select(SQLUtil.SCRIPT_START+"""
/* 모든 시군구 조회(ogdpMapper.selectAllSggList) */
SELECT SGG_CD
, SGG_NM
, (SELECT (CASE WHEN COUNT(*) > 0 THEN 'Y' ELSE 'N' END) FROM TB_USER WHERE NSTT_CD = A.INST_CD) AS USER_USE_YN
/* 유저 수 조회(ogdpMapper.countUser) */
SELECT COUNT(*)
FROM TB_SGG A
WHERE USE_YN = 'Y'
AND SGG_CD = #{sggCd}
"""+SQLUtil.SCRIPT_END)
List<DataObject> selectAllSggList();
int countUser(String sggCd);
/** .
* @param sgg
@ -332,5 +325,4 @@ public interface OgdpMapper extends AbstractMapper {
List<DataObject> selectDeptStngList(OgdpQuery query);
}

@ -34,8 +34,8 @@ public class OgdpBean extends AbstractBean {
return ogdpMapper.selectAbleOgdpList(params);
}
public List<DataObject> selectAllSggList(){
return ogdpMapper.selectAllSggList();
public int countUser(String sggCd) {
return ogdpMapper.countUser(sggCd);
}
public DataObject selectOgdpInfoOfUser(String userId){
@ -127,9 +127,4 @@ public class OgdpBean extends AbstractBean {
}
}

@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.user.ManagedUser;
import cokr.xit.base.user.SigunguQuery;
import cokr.xit.base.user.service.SigunguDepartmentService;
import cokr.xit.base.user.service.UserService;
import cokr.xit.fims.base.service.bean.OgdpBean;
import cokr.xit.fims.task.TaskRequestMappingHandlerMapping;
@ -36,17 +38,34 @@ public class MainController extends cokr.xit.base.web.MainController {
@Resource(name="userService")
private UserService userService;
@Resource(name="sigunguDepartmentService")
private SigunguDepartmentService sggDeptService;
@Override
public ModelAndView loginPage() {
ModelAndView mav = new ModelAndView("login");
List<DataObject> sggs = sggDeptService.getSigunguList(new SigunguQuery());
if (sggs.isEmpty()) {
throw new RuntimeException("No sigungu info found.");
}
for(DataObject sgg : sggs) {
int count = ogdpBean.countUser(sgg.string("SGG_CD"));
String userUseYn = count > 0 ? "Y" : "N";
sgg.set("USER_USE_YN", userUseYn);
}
boolean multiple = sggs.size() > 1;
mav.addObject("sggs", toJson(sggs));
mav.addObject("multipleSggs", multiple);
ModelAndView mav = new ModelAndView("login");
List<DataObject> sggList = ogdpBean.selectAllSggList();
mav.addObject("sggList", sggList);
mav.addObject("sggList", sggs);
mav.addObject("sysInstCd", instCd);
mav.addObject("sysSggCd", sggCd);
return mav;
}
@Override

@ -89,7 +89,7 @@ public class OgdpController extends ApplicationController {
mav.setViewName("fims/ogdp/select-sgg");
mav.addObject("pageName", "selectSgg");
List<DataObject> sggList = ogdpBean.selectAllSggList();
List<DataObject> sggList = sggDeptService.getSigunguList(new SigunguQuery()) ;
mav.addObject("sggList", sggList);
} else {

@ -164,7 +164,7 @@ SELECT A.AUTH_ID
, B.ORG_ID
, (SELECT SGG_NM FROM TB_SGG WHERE SGG_CD = B.ORG_ID) AS SGG_NM
, B.NSTT_CD
, (SELECT INST_NM FROM TB_SGG WHERE SGG_CD = B.ORG_ID) AS NSTT_NM
, (SELECT INST_NM FROM TB_SGG WHERE SGG_CD = B.ORG_ID) AS INST_NM
, B.DEPT_CD
, (SELECT DEPT_NM FROM TB_DEPT WHERE DEPT_CD = B.DEPT_CD) AS DEPT_NM
FROM TB_AUTH_USER A

@ -69,7 +69,6 @@ SELECT A.USER_ID
, A.STTS
, (SELECT GET_CODE_NM('CMN004', A.STTS) FROM DUAL) AS STTS_NM
, A.NSTT_CD AS NSTT_CD
, (CASE WHEN A.NSTT_CD = 'default' THEN '기본 기관' ELSE B.INST_NM END) AS NSTT_NM
, A.NSTT_CD AS INST_CD
, (CASE WHEN A.NSTT_CD = 'default' THEN '기본 기관' ELSE B.INST_NM END) AS INST_NM
, A.DEPT_CD AS DEPT_CD

@ -23,7 +23,7 @@
<tr data-key="{AUTH_ID}-{USER_ID}">
<td style="text-align:center;"><input value="{AUTH_ID}-{USER_ID}" onchange="${infoPrefix}Control.users.select('{AUTH_ID}-{USER_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
<td onclick="${infoPrefix}Control.users.setCurrent('{AUTH_ID}-{USER_ID}')">{SGG_NM}</td>
<td onclick="${infoPrefix}Control.users.setCurrent('{AUTH_ID}-{USER_ID}')">{NSTT_NM}</td>
<td onclick="${infoPrefix}Control.users.setCurrent('{AUTH_ID}-{USER_ID}')">{INST_NM}</td>
<td onclick="${infoPrefix}Control.users.setCurrent('{AUTH_ID}-{USER_ID}')">{DEPT_NM}</td>
<td onclick="${infoPrefix}Control.users.setCurrent('{AUTH_ID}-{USER_ID}')">{USER_ACNT}</td>
<td onclick="${infoPrefix}Control.users.setCurrent('{AUTH_ID}-{USER_ID}')">{USER_NM}</td>

@ -36,7 +36,7 @@
<tr data-key="{USER_ID}">
<td style="text-align:center;"><input value="{USER_ID}" onchange="${infoPrefix}Control.dataset.select('{USER_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
<td onclick="${infoPrefix}Control.setCurrent('{USER_ID}')" ondblclick="${infoPrefix}Control.getInfo({})">{SGG_NM}</td>
<td onclick="${infoPrefix}Control.setCurrent('{USER_ID}')" ondblclick="${infoPrefix}Control.getInfo({})">{NSTT_NM}</td>
<td onclick="${infoPrefix}Control.setCurrent('{USER_ID}')" ondblclick="${infoPrefix}Control.getInfo({})">{INST_NM}</td>
<td onclick="${infoPrefix}Control.setCurrent('{USER_ID}')" ondblclick="${infoPrefix}Control.getInfo({})">{DEPT_NM}</td>
<td onclick="${infoPrefix}Control.setCurrent('{USER_ID}')" ondblclick="${infoPrefix}Control.getInfo({})">{USER_ACNT}</td>
<td onclick="${infoPrefix}Control.setCurrent('{USER_ID}')" ondblclick="${infoPrefix}Control.getInfo({})">{USER_NM}</td>

@ -41,7 +41,7 @@
<td style="text-align:center;"><input value="{USER_ID}" onchange="${infoPrefix}Control.select('{USER_ID}', this.checked);" type="checkbox" class="form-check-input"></td>
<td {onclick} {ondblclick}>{USER_ACNT}</td>
<td {onclick} {ondblclick}>{USER_NM}</td>
<td {onclick} {ondblclick}>{NSTT_NM}</td>
<td {onclick} {ondblclick}>{INST_NM}</td>
<td {onclick} {ondblclick}>{DEPT_NM}</td>
<td {onclick} {ondblclick}>{EML_ADRS}</td>
<td {onclick} {ondblclick}>{TELNO}</td>

Loading…
Cancel
Save