feat: 권한관리 - AuthRole 진행

main
Jonguk. Lim 2 years ago
parent 7fea76ce05
commit e33d03fb6e

@ -2,10 +2,12 @@ package kr.xit.framework.biz.mng.auth.mapper;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.List; import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper; import egovframework.rte.psl.dataaccess.mapper.Mapper;
import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngSearchVO;
/** /**
* *
@ -28,16 +30,7 @@ public interface AuthRoleMgtMapper {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
public List<XitAuthRuleMngVO> findList(XitAuthRuleMngSearchVO searchVO) throws SQLException; List<XitAuthRuleMngVO> selectAuthRoles(final Map<String,Object> paraMap, final RowBounds rowBounds);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitAuthRuleMngSearchVO searchVO) throws SQLException;
/** /**
* <pre> : </pre> * <pre> : </pre>
@ -46,6 +39,12 @@ public interface AuthRoleMgtMapper {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
public XitAuthRuleMngVO findView(XitAuthRuleMngVO vo) throws SQLException; XitAuthRuleMngVO selectAuthRole(final String roleCode);
int insertAuthRole(final XitAuthRuleMngVO vo);
int updateAuthRole(final XitAuthRuleMngVO vo);
int deleteAuthRole(final String roleCode);
} }

@ -1,6 +1,12 @@
package kr.xit.framework.biz.mng.auth.model; package kr.xit.framework.biz.mng.auth.model;
import kr.xit.framework.core.model.BaseVO; import kr.xit.framework.core.model.BaseVO;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
/** /**
* *
@ -12,6 +18,12 @@ import kr.xit.framework.core.model.BaseVO;
* @since 2002. 2. 2. * @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved. * @version 1.0 Copyright(c) XIT All rights reserved.
*/ */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@ToString
public class XitAuthRuleMngVO extends BaseVO { public class XitAuthRuleMngVO extends BaseVO {
/** /**
* serialVersionUID * serialVersionUID
@ -32,7 +44,7 @@ public class XitAuthRuleMngVO extends BaseVO {
/** /**
* *
*/ */
private String rolePtn; private String rolePttrn;
/** /**
* *
*/ */
@ -40,7 +52,7 @@ public class XitAuthRuleMngVO extends BaseVO {
/** /**
* *
*/ */
private String roleTyp; private String roleTy;
/** /**
* Sort * Sort
*/ */
@ -53,132 +65,4 @@ public class XitAuthRuleMngVO extends BaseVO {
* *
*/ */
private String authorCode; private String authorCode;
/**
* roleManage attribute .
* @return RoleManage
*/
public XitAuthRuleMngVO getRoleManage() {
return roleManage;
}
/**
* roleManage attribute .
* @param roleManage RoleManage
*/
public void setRoleManage(XitAuthRuleMngVO roleManage) {
this.roleManage = roleManage;
}
/**
* roleCode attribute .
* @return String
*/
public String getRoleCode() {
return roleCode;
}
/**
* roleCode attribute .
* @param roleCode String
*/
public void setRoleCode(String roleCode) {
this.roleCode = roleCode;
}
/**
* roleNm attribute .
* @return String
*/
public String getRoleNm() {
return roleNm;
}
/**
* roleNm attribute .
* @param roleNm String
*/
public void setRoleNm(String roleNm) {
this.roleNm = roleNm;
}
/**
* rolePtn attribute .
* @return String
*/
public String getRolePtn() {
return rolePtn;
}
/**
* rolePtn attribute .
* @param rolePtn String
*/
public void setRolePtn(String rolePtn) {
this.rolePtn = rolePtn;
}
/**
* roleDc attribute .
* @return String
*/
public String getRoleDc() {
return roleDc;
}
/**
* roleDc attribute .
* @param roleDc String
*/
public void setRoleDc(String roleDc) {
this.roleDc = roleDc;
}
/**
* roleTyp attribute .
* @return String
*/
public String getRoleTyp() {
return roleTyp;
}
/**
* roleTyp attribute .
* @param roleTyp String
*/
public void setRoleTyp(String roleTyp) {
this.roleTyp = roleTyp;
}
/**
* roleSort attribute .
* @return String
*/
public String getRoleSort() {
return roleSort;
}
/**
* roleSort attribute .
* @param roleSort String
*/
public void setRoleSort(String roleSort) {
this.roleSort = roleSort;
}
/**
* roleCreatDe attribute .
* @return String
*/
public String getRoleCreatDe() {
return roleCreatDe;
}
/**
* roleCreatDe attribute .
* @param roleCreatDe String
*/
public void setRoleCreatDe(String roleCreatDe) {
this.roleCreatDe = roleCreatDe;
}
/**
* authorCode attribute .
* @return String
*/
public String getAuthorCode() {
return authorCode;
}
/**
* authorCode attribute .
* @param authorCode String
*/
public void setAuthorCode(String authorCode) {
this.authorCode = authorCode;
}
} }

@ -1,6 +1,9 @@
package kr.xit.framework.biz.mng.auth.service; package kr.xit.framework.biz.mng.auth.service;
import java.util.List; import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngSearchVO; import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngSearchVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngVO;
@ -25,16 +28,7 @@ public interface AuthRoleMgtService {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
public List<XitAuthRuleMngVO> findList(XitAuthRuleMngSearchVO searchVO); List<XitAuthRuleMngVO> findAuthRoles(final Map<String,Object> paraMap, final RowBounds rowBounds);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitAuthRuleMngSearchVO searchVO);
/** /**
* <pre> : </pre> * <pre> : </pre>
@ -43,7 +37,7 @@ public interface AuthRoleMgtService {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
public XitAuthRuleMngVO findView(XitAuthRuleMngVO vo); XitAuthRuleMngVO findAuthRole(final String roleCode);
/** /**
* <pre> : </pre> * <pre> : </pre>
@ -51,7 +45,7 @@ public interface AuthRoleMgtService {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
public void addProc(XitAuthRuleMngVO vo); void addAuthRole(XitAuthRuleMngVO vo);
/** /**
* <pre> : </pre> * <pre> : </pre>
@ -59,7 +53,7 @@ public interface AuthRoleMgtService {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
public void modifyProc(XitAuthRuleMngVO vo); void modifyAuthRole(XitAuthRuleMngVO vo);
/** /**
* <pre> : </pre> * <pre> : </pre>
@ -67,14 +61,6 @@ public interface AuthRoleMgtService {
* @author: * @author:
* @date: 2020. 4. 16. * @date: 2020. 4. 16.
*/ */
public void removeProc(XitAuthRuleMngVO vo); void removeAuthRole(final String roleCode);
/**
* <pre> : </pre>
* @param ids void
* @author:
* @date: 2020. 4. 16.
*/
public void removesProc(String ids);
} }

@ -1,10 +1,11 @@
package kr.xit.framework.biz.mng.auth.service.impl; package kr.xit.framework.biz.mng.auth.service.impl;
import java.sql.SQLException;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import egovframework.rte.fdl.cmmn.exception.FdlException; import egovframework.rte.fdl.cmmn.exception.FdlException;
@ -12,7 +13,6 @@ import egovframework.rte.fdl.idgnr.EgovIdGnrService;
import kr.xit.framework.biz.cmm.model.XitRoleInfoVO; import kr.xit.framework.biz.cmm.model.XitRoleInfoVO;
import kr.xit.framework.biz.cmm.service.XitFrameCrudService; import kr.xit.framework.biz.cmm.service.XitFrameCrudService;
import kr.xit.framework.biz.mng.auth.mapper.AuthRoleMgtMapper; import kr.xit.framework.biz.mng.auth.mapper.AuthRoleMgtMapper;
import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngSearchVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngVO;
import kr.xit.framework.biz.mng.auth.service.AuthRoleMgtService; import kr.xit.framework.biz.mng.auth.service.AuthRoleMgtService;
import kr.xit.framework.core.message.XitMessageSource; import kr.xit.framework.core.message.XitMessageSource;
@ -21,7 +21,7 @@ import kr.xit.framework.core.message.XitMessageSource;
public class AuthRoleMgtServiceImpl implements AuthRoleMgtService { public class AuthRoleMgtServiceImpl implements AuthRoleMgtService {
@Resource @Resource
private AuthRoleMgtMapper xitAuthRuleMngMapper; private AuthRoleMgtMapper mapper;
@Resource @Resource
private XitFrameCrudService xitFrameCrudService; private XitFrameCrudService xitFrameCrudService;
@Resource(name="xitRoleIdGnrService") @Resource(name="xitRoleIdGnrService")
@ -30,44 +30,21 @@ public class AuthRoleMgtServiceImpl implements AuthRoleMgtService {
private XitMessageSource xitMessageSource; private XitMessageSource xitMessageSource;
@Override @Override
public List<XitAuthRuleMngVO> findList(XitAuthRuleMngSearchVO searchVO) { public List<XitAuthRuleMngVO> findAuthRoles(final Map<String,Object> paraMap, final RowBounds rowBounds) {
List<XitAuthRuleMngVO> result = null; return mapper.selectAuthRoles(paraMap, rowBounds);
try {
result = xitAuthRuleMngMapper.findList(searchVO);
} catch (SQLException e) {
throw new RuntimeException("롤관리 목록 조회 FAIL::", e);
}
return result;
}
@Override
public int findListTotCnt(XitAuthRuleMngSearchVO searchVO) {
int result = 0;
try {
result = xitAuthRuleMngMapper.findListTotCnt(searchVO);
} catch (SQLException e) {
throw new RuntimeException("롤관리 목록 총건수 조회 FAIL::", e);
}
return result;
} }
@Override @Override
public XitAuthRuleMngVO findView(XitAuthRuleMngVO vo) { public XitAuthRuleMngVO findAuthRole(final String roleCode) {
XitAuthRuleMngVO result = null; return mapper.selectAuthRole(roleCode);
try {
result = xitAuthRuleMngMapper.findView(vo);
} catch (SQLException e) {
throw new RuntimeException("롤관리 상세정보 조회 FAIL::", e);
}
return result;
} }
@Override @Override
public void addProc(XitAuthRuleMngVO vo) { public void addAuthRole(XitAuthRuleMngVO vo) {
/** /**
* *
*/ */
String roleTyp = vo.getRoleTyp(); String roleTyp = vo.getRoleTy();
if("method".equals(roleTyp)) if("method".equals(roleTyp))
roleTyp = "mtd"; roleTyp = "mtd";
else if("pointcut".equals(roleTyp)) else if("pointcut".equals(roleTyp))
@ -78,76 +55,32 @@ public class AuthRoleMgtServiceImpl implements AuthRoleMgtService {
} catch (FdlException e) { } catch (FdlException e) {
throw new RuntimeException(String.format("%s %s", xitMessageSource.getMessage("fail.common.insert"), e.getMessage())); throw new RuntimeException(String.format("%s %s", xitMessageSource.getMessage("fail.common.insert"), e.getMessage()));
} }
XitRoleInfoVO roleInfoVO = convertToCrudVO(vo); //XitRoleInfoVO roleInfoVO = convertToCrudVO(vo);
/** //mapper.insertAuthRole(vo);
* //xitFrameCrudService.addXitRoleInfo(roleInfoVO);
*/
xitFrameCrudService.addXitRoleInfo(roleInfoVO);
} }
@Override @Override
public void modifyProc(XitAuthRuleMngVO vo) { public void modifyAuthRole(XitAuthRuleMngVO vo) {
/** /**
* *
*/ */
XitRoleInfoVO roleInfoVO = convertToCrudVO(vo); //XitRoleInfoVO roleInfoVO = convertToCrudVO(vo);
/** //mapper.updateAuthRole(vo);
* //xitFrameCrudService.modifyXitRoleInfo(roleInfoVO);
*/
xitFrameCrudService.modifyXitRoleInfo(roleInfoVO);
} }
@Override @Override
public void removeProc(XitAuthRuleMngVO vo) { public void removeAuthRole(final String roleCode) {
/**
*
*/
XitRoleInfoVO roleInfoVO = convertToCrudVO(vo);
/**
*
*/
xitFrameCrudService.removeXitRoleInfo(roleInfoVO);
}
@Override //mapper.deleteAuthRole(roleCode);
public void removesProc(String ids) { //xitFrameCrudService.removeXitRoleInfo(roleInfoVO);
/**
*
*/
String [] roleCodes = ids.split(";");
for(int i=0; i<roleCodes.length;i++) {
XitAuthRuleMngVO vo = new XitAuthRuleMngVO();
vo.setRoleCode(roleCodes[i]);
this.removeProc(vo);
}
}
/**
* <pre>
* : VO CRUD Service VO .
* </pre>
*
* @return XitRoleInfoVO
* @author:
* @date: 2020. 4. 16.
*/
private XitRoleInfoVO convertToCrudVO(XitAuthRuleMngVO vo) {
XitRoleInfoVO roleInfoVO = new XitRoleInfoVO();
roleInfoVO.setRole_code (vo.getRoleCode()); //역할 코드
roleInfoVO.setRole_nm (vo.getRoleNm()); //역할 명
roleInfoVO.setRole_pttrn (vo.getRolePtn()); //역할 패턴
roleInfoVO.setRole_dc (vo.getRoleDc()); //역할 설명
roleInfoVO.setRole_ty (vo.getRoleTyp()); //역할 유형
roleInfoVO.setRole_sort (vo.getRoleSort()); //역할 정렬
// roleInfoVO.setRole_creat_de(vo.getRoleCreatDe()); //역할 생성 일
return roleInfoVO;
} }
} }

@ -14,25 +14,35 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.support.SessionStatus; import org.springframework.web.bind.support.SessionStatus;
import org.springframework.web.servlet.ModelAndView;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
import kr.xit.framework.biz.cmm.service.XitFrameCodeService; import kr.xit.framework.biz.cmm.service.XitFrameCodeService;
import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngSearchVO; import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngSearchVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngVO; import kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngVO;
import kr.xit.framework.biz.mng.auth.service.AuthRoleMgtService; import kr.xit.framework.biz.mng.auth.service.AuthRoleMgtService;
import kr.xit.framework.biz.mng.menu.model.ProgramMngVO;
import kr.xit.framework.core.constants.FrameworkConstants; import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE; import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE;
import kr.xit.framework.core.message.XitMessageSource; import kr.xit.framework.core.message.XitMessageSource;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.core.utils.XitCmmnUtil; import kr.xit.framework.core.utils.XitCmmnUtil;
import kr.xit.framework.core.validation.XitBeanValidator; import kr.xit.framework.core.validation.XitBeanValidator;
import kr.xit.framework.support.mybatis.MybatisUtils;
import kr.xit.framework.support.util.AjaxMessageMapRenderer;
import kr.xit.framework.support.util.AjaxUtils; import kr.xit.framework.support.util.AjaxUtils;
import kr.xit.framework.support.util.Checks;
import kr.xit.framework.support.util.ValidationError;
import kr.xit.framework.support.util.constants.MessageKey;
/** /**
* *
@ -49,7 +59,7 @@ import kr.xit.framework.support.util.AjaxUtils;
public class AuthRoleMgtController { public class AuthRoleMgtController {
@Resource @Resource
private AuthRoleMgtService xitAuthRuleMngService; private AuthRoleMgtService service;
@Resource @Resource
private XitFrameCodeService xitFrameCodeService; private XitFrameCodeService xitFrameCodeService;
@Autowired @Autowired
@ -69,65 +79,69 @@ public class AuthRoleMgtController {
public void mngAuthRoleMgtForm() { public void mngAuthRoleMgtForm() {
} }
@RequestMapping(value = "mnuAuthRoleMgtPopup")
public ModelAndView mngAuthRoleMgtPopup(final XitAuthRuleMngVO vo){
ModelAndView mav = new ModelAndView();
if(Checks.isEmpty(vo)){
mav.addObject("roleManage", new ProgramMngVO());
mav.addObject("pageTitle", "롤 등록");
} else {
mav.addObject("roleManage", vo);
mav.addObject("pageTitle", "롤 정보 변경");
}
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/menu/mngAuthRoleMgtPopup.popup");
return mav;
}
/** /**
* <pre> : </pre> * <pre> : </pre>
* @return String * @return String
* @author: * @author:
* @date: 2020. 7. 31. * @date: 2020. 7. 31.
*/ */
@RequestMapping(value = "AuthRuleMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST}) @GetMapping(value = "findAuthRoles")
@ResponseBody public ModelAndView findAuthRoles(final Map<String,Object> paraMap) {
public Map<String, Object> AuthRuleMng_listAjax(@ModelAttribute("roleManageVO") XitAuthRuleMngSearchVO searchVO, ModelMap model) { return ResultResponse.of(service.findAuthRoles(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
/** paging */
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(searchVO.getPage()>-1?searchVO.getPage():searchVO.getPageIndex());
paginationInfo.setRecordCountPerPage(searchVO.getPerPage()>-1?searchVO.getPerPage():searchVO.getPageUnit());
paginationInfo.setPageSize(searchVO.getPageSize());
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
Map<String, Object> resultMap = new HashMap<String, Object>(); @PostMapping(value = "/addAuthRole")
try { public ModelAndView addAuthRole(@ModelAttribute final XitAuthRuleMngVO vo, final BindingResult bindingResult) {
/** ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
*
*/ //유효성 확인
int totCnt = xitAuthRuleMngService.findListTotCnt(searchVO); ValidationError.of("roleManage", vo, bindingResult);
paginationInfo.setTotalRecordCount(totCnt); service.addAuthRole(vo);
/** AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
* return mav;
*/ }
/* ***************************
* tui Grid Response Set @PostMapping(value = "/modifyAuthRole")
*************************** */ public ModelAndView modifyAuthRole(@ModelAttribute final XitAuthRuleMngVO vo, final BindingResult bindingResult) {
resultMap.put("result", true); //[tui Grid] result ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message
Map<String, Object> data = new HashMap<String, Object>(); //유효성 확인
data.put("contents", xitAuthRuleMngService.findList(searchVO)); //[tui Grid] data-contents ValidationError.of("roleManage", vo, bindingResult);
Map<String, Integer> pagination = new HashMap<String, Integer>(); service.modifyAuthRole(vo);
pagination.put("page", searchVO.getPage()); AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS);
pagination.put("totalCount", totCnt); return mav;
data.put("pagination", pagination); //[tui Grid] data-paging
resultMap.put("data", data); //[tui Grid] data
/* ***************************
* //tui Grid Response Set
*************************** */
} catch (Exception e) {
/**
*
*/
//tui Grid Response Set
resultMap.put("result", false); //[tui Grid] result
resultMap.put("message", xitMessageSource.getMessage("fail.common.select")); //[tui Grid] result message
} }
return resultMap; @PostMapping(value = "/removeAuthRole")
public ModelAndView removeAuthRole(final String roleCode) {
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
service.removeAuthRole(roleCode);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS);
return mav;
} }
/** /**
* <pre> : .</pre> * <pre> : .</pre>
* @param page
* @param tilesDef Type(none: tiles ) * @param tilesDef Type(none: tiles )
* @param model * @param model
* @return String * @return String
@ -155,7 +169,7 @@ public class AuthRoleMgtController {
================*/ ================*/
model.addAttribute("cmmCodeDetailList" , xitFrameCodeService.findCmmnDetailCodes("XIT029")); //롤유형코드 목록 model.addAttribute("cmmCodeDetailList" , xitFrameCodeService.findCmmnDetailCodes("XIT029")); //롤유형코드 목록
model.addAttribute("roleManage", xitAuthRuleMngService.findView(vo)); model.addAttribute("roleManage", service.findAuthRole(null));
model.addAttribute("message", xitMessageSource.getMessage("success.common.select")); model.addAttribute("message", xitMessageSource.getMessage("success.common.select"));
break; break;
default: default:
@ -172,7 +186,6 @@ public class AuthRoleMgtController {
/** /**
* <pre> : .</pre> * <pre> : .</pre>
* @param page
* @param model * @param model
* @return String * @return String
* @author: * @author:
@ -233,7 +246,7 @@ public class AuthRoleMgtController {
} }
//처리 //처리
try { try {
xitAuthRuleMngService.addProc(vo); service.addAuthRole(vo);
status.setComplete(); status.setComplete();
message = xitMessageSource.getMessage("success.common.insert"); message = xitMessageSource.getMessage("success.common.insert");
model.addAttribute("roleCode", vo.getRoleCode()); model.addAttribute("roleCode", vo.getRoleCode());
@ -260,7 +273,7 @@ public class AuthRoleMgtController {
} }
//처리 //처리
try { try {
xitAuthRuleMngService.modifyProc(vo); service.modifyAuthRole(vo);
status.setComplete(); status.setComplete();
message = xitMessageSource.getMessage("success.common.update"); message = xitMessageSource.getMessage("success.common.update");
} catch (RuntimeException e) { } catch (RuntimeException e) {
@ -275,7 +288,7 @@ public class AuthRoleMgtController {
case "delete": //삭제 case "delete": //삭제
//처리 //처리
try { try {
xitAuthRuleMngService.removeProc(vo); service.removeAuthRole(null);
status.setComplete(); status.setComplete();
message = xitMessageSource.getMessage("success.common.delete"); message = xitMessageSource.getMessage("success.common.delete");
break; break;
@ -291,7 +304,7 @@ public class AuthRoleMgtController {
case "deletes": //다건 삭제 case "deletes": //다건 삭제
//처리 //처리
try { try {
xitAuthRuleMngService.removesProc(roleCodes); //service.removesProc();
status.setComplete(); status.setComplete();
message = xitMessageSource.getMessage("success.common.delete"); message = xitMessageSource.getMessage("success.common.delete");
} catch (RuntimeException e) { } catch (RuntimeException e) {

@ -1,6 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="kr.xit.framework.biz.mng.auth.mapper.AuthGrpMgtMapper"> <mapper namespace="kr.xit.framework.biz.mng.auth.mapper.AuthGrpMgtMapper">
<select id="findXitAuthorGroupInfos" resultType="kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO">
/** findXitAuthorGroupInfos */
/** 권한그룹정보 다건 조회 */
SELECT GROUP_ID
,GROUP_NM
,GROUP_CREAT_DE
,GROUP_DC
,AUTHOR_CODE
FROM XIT_AUTHOR_GROUP_INFO
WHERE 1=1
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_id )">AND GROUP_ID = #{group_id }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_nm )">AND GROUP_NM = #{group_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_creat_de)">AND GROUP_CREAT_DE = #{group_creat_de }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_dc )">AND GROUP_DC = #{group_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_code )">AND AUTHOR_CODE = #{author_code }</if>
</select>
<select id="findXitAuthorGroupInfo" resultType="kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO">
/** findXitAuthorGroupInfo */
/** 권한그룹정보 조회 */
SELECT GROUP_ID
,GROUP_NM
,GROUP_CREAT_DE
,GROUP_DC
,AUTHOR_CODE
FROM XIT_AUTHOR_GROUP_INFO
WHERE 1=1
AND GROUP_ID = #{group_id}
</select>
<insert id="addXitAuthorGroupInfo">
/** addXitAuthorGroupInfo */
/** 권한그룹정보 등록 */
INSERT INTO XIT_AUTHOR_GROUP_INFO(
GROUP_ID
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_nm )">,GROUP_NM</if>
,GROUP_CREAT_DE
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_dc )">,GROUP_DC</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_code)">,AUTHOR_CODE</if>
)VALUES(
#{group_id }
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_nm )">,#{group_nm }</if>
,DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(group_dc )">,#{group_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_code)">,#{author_code }</if>
)
</insert>
<update id="modifyXitAuthorGroupInfo">
/** modifyXitAuthorGroupInfo */
/** 권한그룹정보 수정 */
UPDATE XIT_AUTHOR_GROUP_INFO
SET
GROUP_CREAT_DE = GROUP_CREAT_DE
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(group_nm )">,GROUP_NM = #{group_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(group_dc )">,GROUP_DC = #{group_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(author_code)">,AUTHOR_CODE = #{author_code}</if>
WHERE 1=1
AND GROUP_ID = #{group_id}
</update>
<delete id="removeXitAuthorGroupInfo">
/** removeXitAuthorGroupInfo */
/** 권한그룹정보 삭제 */
DELETE FROM XIT_AUTHOR_GROUP_INFO
WHERE 1=1
AND GROUP_ID = #{group_id}
</delete>
<!-- SQL 페이징 코드 --> <!-- SQL 페이징 코드 -->
<sql id="pageBefore"> <sql id="pageBefore">
SELECT LIST.* FROM( SELECT LIST.* FROM(

@ -1,6 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="kr.xit.framework.biz.mng.auth.mapper.AuthMgtMapper"> <mapper namespace="kr.xit.framework.biz.mng.auth.mapper.AuthMgtMapper">
<select id="findXitAuthorInfos" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
/** findXitAuthorInfos */
/** 권한정보 다건 조회 */
SELECT AUTHOR_CODE
,AUTHOR_NM
,AUTHOR_DC
,AUTHOR_CREAT_DE
FROM XIT_AUTHOR_INFO
WHERE 1=1
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_code )">AND AUTHOR_CODE = #{author_code }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_nm )">AND AUTHOR_NM = #{author_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_dc )">AND AUTHOR_DC = #{author_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_creat_de)">AND AUTHOR_CREAT_DE = #{author_creat_de}</if>
</select>
<select id="findXitAuthorInfo" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
/** findXitAuthorInfo */
/** 권한정보 조회 */
SELECT AUTHOR_CODE
,AUTHOR_NM
,AUTHOR_DC
,AUTHOR_CREAT_DE
FROM XIT_AUTHOR_INFO
WHERE 1=1
AND AUTHOR_CODE = #{author_code}
</select>
<insert id="addXitAuthorInfo">
/** addXitAuthorInfo */
/** 권한정보 등록 */
INSERT INTO XIT_AUTHOR_INFO(
AUTHOR_CODE
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_nm)">,AUTHOR_NM</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_dc)">,AUTHOR_DC</if>
,AUTHOR_CREAT_DE
)VALUES(
#{author_code }
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_nm)">,#{author_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_dc)">,#{author_dc }</if>
,DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
)
</insert>
<update id="modifyXitAuthorInfo">
/** modifyXitAuthorInfo */
/** 권한정보 수정 */
UPDATE XIT_AUTHOR_INFO
SET
AUTHOR_CREAT_DE = AUTHOR_CREAT_DE
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(author_nm)">,AUTHOR_NM = #{author_nm}</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(author_dc)">,AUTHOR_DC = #{author_dc}</if>
WHERE 1=1
AND AUTHOR_CODE = #{author_code}
</update>
<delete id="removeXitAuthorInfo">
/** removeXitAuthorInfo */
/** 권한정보 삭제 */
DELETE FROM XIT_AUTHOR_INFO
WHERE 1=1
AND AUTHOR_CODE = #{author_code}
</delete>
<!-- SQL 페이징 코드 --> <!-- SQL 페이징 코드 -->
<sql id="pageBefore"> <sql id="pageBefore">
SELECT LIST.* FROM( SELECT LIST.* FROM(

@ -54,15 +54,6 @@
<select id="findListTotCnt" resultType="int">
/** XitAuthRuleMngMapper.findListTotCnt */
/** 롤관리 목록 총건수 조회 */
SELECT COUNT(1) AS "CNT"
<include refid="findList_FROM"/>
WHERE 1=1
<include refid="findList_WHERE"/>
</select>
<select id="findView" resultType="kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngVO"> <select id="findView" resultType="kr.xit.framework.biz.mng.auth.model.XitAuthRuleMngVO">
@ -74,4 +65,84 @@
</select> </select>
<select id="findXitRoleInfos" resultType="kr.xit.framework.biz.cmm.model.XitRoleInfoVO">
/** findXitRoleInfos */
/** 역할정보 다건 조회 */
SELECT ROLE_CODE
,ROLE_NM
,ROLE_PTTRN
,ROLE_DC
,ROLE_TY
,ROLE_SORT
,ROLE_CREAT_DE
FROM XIT_ROLE_INFO
WHERE 1=1
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(role_code )">AND ROLE_CODE = #{role_code }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(role_nm )">AND ROLE_NM = #{role_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(role_pttrn )">AND ROLE_PTTRN = #{role_pttrn }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(role_dc )">AND ROLE_DC = #{role_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(role_ty )">AND ROLE_TY = #{role_ty }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(role_sort )">AND ROLE_SORT = #{role_sort }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(role_creat_de)">AND ROLE_CREAT_DE = #{role_creat_de}</if>
</select>
<select id="findXitRoleInfo" resultType="kr.xit.framework.biz.cmm.model.XitRoleInfoVO">
/** findXitRoleInfo */
/** 역할정보 조회 */
SELECT ROLE_CODE
,ROLE_NM
,ROLE_PTTRN
,ROLE_DC
,ROLE_TY
,ROLE_SORT
,ROLE_CREAT_DE
FROM XIT_ROLE_INFO
WHERE 1=1
AND ROLE_CODE = #{role_code}
</select>
<insert id="addXitRoleInfo">
/** addXitRoleInfo */
/** 역할정보 등록 */
INSERT INTO XIT_ROLE_INFO(
ROLE_CODE
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(role_nm )">,ROLE_NM </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(role_pttrn )">,ROLE_PTTRN </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(role_dc )">,ROLE_DC </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(role_ty )">,ROLE_TY </if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(role_sort )">,ROLE_SORT </if>
,ROLE_CREAT_DE
)VALUES(
#{role_code }
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(role_nm )">,#{role_nm }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(role_pttrn )">,#{role_pttrn }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(role_dc )">,#{role_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(role_ty )">,#{role_ty }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(role_sort )">,#{role_sort }</if>
,DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
)
</insert>
<update id="modifyXitRoleInfo">
/** modifyXitRoleInfo */
/** 역할정보 수정 */
UPDATE XIT_ROLE_INFO
SET
ROLE_NM = IFNULL(#{role_nm }, ROLE_NM)
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(role_pttrn )">,ROLE_PTTRN = #{role_pttrn }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(role_dc )">,ROLE_DC = #{role_dc }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(role_ty )">,ROLE_TY = #{role_ty }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(role_sort )">,ROLE_SORT = #{role_sort }</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(role_creat_de)">,ROLE_CREAT_DE = #{role_creat_de}</if>
WHERE 1=1
AND ROLE_CODE = #{role_code}
</update>
<delete id="removeXitRoleInfo">
/** removeXitRoleInfo */
/** 역할정보 삭제 */
DELETE FROM XIT_ROLE_INFO
WHERE 1=1
AND ROLE_CODE = #{role_code}
</delete>
</mapper> </mapper>

Loading…
Cancel
Save