no message

main
이범준 1 year ago
parent 089bb0713d
commit 0d6fdc6833

@ -1,15 +0,0 @@
package cokr.xit.fims.framework.biz.cache.dao;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
public interface CacheMenuMapper {
List<Map<String, String>> selectMenuListAll(final String uniqId);
List<Map<String, String>> selectMenuListByUser(final String uniqId);
List<Map<String, String>> selectMenuListByAuthId(final String authId);
}

@ -32,19 +32,6 @@ public interface CacheService {
void evictCodeCache(final String grpId, final String type);
List<Map<String, String>> findMenuListAll(final String uniqId);
/**
*
* @param uniqId
* @return List<T>
*/
List<Map<String, String>> findMenuListByUser(final String uniqId);
/**
*
* @param authId
* @return List<T>
*/
List<Map<String, String>> findMenuListByAuthId(final String authId);
/**
* Evict
*/

@ -3,7 +3,6 @@ package cokr.xit.fims.framework.biz.cache.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.framework.biz.cache.dao.CacheBbsMapper;
import cokr.xit.fims.framework.biz.cache.dao.CacheCodeMapper;
import cokr.xit.fims.framework.biz.cache.dao.CacheMenuMapper;
import cokr.xit.fims.framework.biz.cache.service.CacheService;
import cokr.xit.fims.framework.biz.mng.bbs.XitBasicBbsMngVO;
import cokr.xit.fims.framework.support.mybatis.MybatisUtils;
@ -23,10 +22,8 @@ import java.util.Map;
public class CacheServiceBean extends AbstractServiceBean implements CacheService {
private final CacheCodeMapper codeMapper;
private final CacheMenuMapper menuMapper;
private final CacheBbsMapper bbsMapper;
// ---------------------------------------------------------------------------------------------------------
@ -62,29 +59,7 @@ public class CacheServiceBean extends AbstractServiceBean implements CacheServic
// ---------------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------
// Menu
// ---------------------------------------------------------------------------------------------------------
@Cacheable(cacheNames="menuCache", key = "#uniqId")
@Override
@Transactional(readOnly = true)
public List<Map<String, String>> findMenuListAll(final String uniqId) {
return menuMapper.selectMenuListAll(uniqId);
}
@Cacheable(cacheNames="menuCache", key = "#uniqId")
@Override
@Transactional(readOnly = true)
public List<Map<String, String>> findMenuListByUser(final String uniqId) {
return menuMapper.selectMenuListByUser(uniqId);
}
@Cacheable(cacheNames="menuCache", key = "#authId")
@Override
@Transactional(readOnly = true)
public List<Map<String, String>> findMenuListByAuthId(final String authId) {
return menuMapper.selectMenuListByAuthId(authId);
}
@Override
@CacheEvict(cacheNames="menuCache", allEntries = true)

@ -39,31 +39,7 @@ public class CacheServiceUtils {
// ---------------------------------------------------------------------------------------------------------
// User menu
// ---------------------------------------------------------------------------------------------------------
public static List<Map<String,String>> findMenuListAll(final String uniqId) {
return JBeanRegistry.getCacheService().findMenuListAll(uniqId);
}
/**
*
*
* @param uniqId String
* @return List<Map<String,Object>>
*/
public static List<Map<String,String>> findMenuListByUser(final String uniqId) {
return JBeanRegistry.getCacheService().findMenuListByUser(uniqId);
}
/**
*
* @param authId String
* @return List<Map<String,Object>>
*/
public static List<Map<String,String>> findMenuListByAuthId(final String authId) {
return JBeanRegistry.getCacheService().findMenuListByAuthId(authId);
}

@ -56,26 +56,7 @@ public class CacheController extends AbstractController {
mav.addObject("comboList", CacheServiceUtils.getComboCodes(grpId, type));
return mav;
}
@GetMapping(name = "", value="/getMenuListAll")
public ModelAndView getMenuListAll(final String uniqId) {
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
mav.addObject("allMenuList", CacheServiceUtils.findMenuListAll(uniqId));
return mav;
}
@GetMapping(name = "", value="/getMenuListByUser")
public ModelAndView getMenuListByUser(final String uniqId) {
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
mav.addObject("allMenuList", CacheServiceUtils.findMenuListByUser(uniqId));
return mav;
}
@GetMapping(name = "", value="/getMenuListByAuthId")
public ModelAndView getMenuListByAuthId(final String authId) {
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
mav.addObject("allMenuList", CacheServiceUtils.findMenuListByAuthId(authId));
return mav;
}
@GetMapping(name = "", value="/getNoticeList")
public ModelAndView getNoticeList() {

@ -23,26 +23,7 @@ import java.util.Map;
public interface XitFrameUnitMapper {
/**
* <pre> :
* - .
* </pre>
* @param userId
* @return List<Map>
* @author:
* @date: 2020. 3. 25.
*/
public List<Map<String, String>> findMenuListByUser(String uniqId) throws SQLException;
/**
* <pre> :
* - .
* </pre>
* @param authId
* @return List<Map>
* @author:
* @date: 2020. 11. 20.
*/
public List<Map<String, String>> findMenuListByAuthId(String authId) throws SQLException;
/**

@ -1,42 +0,0 @@
package cokr.xit.fims.framework.biz.cmm.dao;
import cokr.xit.fims.framework.core.XitMenuManageVO;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import java.sql.SQLException;
import java.util.List;
/**
*
* @: XIT Mapper
* @:
* @: 2020. 3. 23. 3:23:12
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface XitMainMapper {
/**
* <pre> : .</pre>
* @param vo
* @return List<XitMenuManageVO>
* @author:
* @date: 2020. 3. 24.
*/
public List<XitMenuManageVO> findMainMenuHeads(XitMenuManageVO vo) throws SQLException;
/**
* <pre> : .</pre>
* @param vo
* @return List<XitMenuManageVO>
* @author:
* @date: 2020. 3. 24.
*/
public List<XitMenuManageVO> findtMainMenuLefts(XitMenuManageVO vo) throws SQLException;
public String findMenuPath(String menu_no) throws SQLException;
public String findMenuPath2(String pgmId) throws SQLException;
}

@ -125,29 +125,7 @@ public interface XitFrameUnitService {
/**
* <pre> :
* - .
* </pre>
* @param uniqId
* @return List<Map>
* @author:
* @date: 2020. 3. 25.
*/
public List<Map<String, String>> findMenuListByUser(String uniqId);
/**
* <pre> :
* - .
* </pre>
* @param authId
* @return List<Map<String,String>>
* @author:
* @date: 2020. 11. 20.
*/
public List<Map<String, String>> findMenuListByAuthId(String authId);
/**

@ -1,40 +0,0 @@
package cokr.xit.fims.framework.biz.cmm.service;
import cokr.xit.fims.framework.core.XitMenuManageVO;
import java.util.List;
/**
*
* @: XIT Service
* @:
* @: 2020. 3. 23. 3:23:12
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface XitMainService {
/**
* <pre> : .</pre>
* @param uniqId
* @return List<XitMenuManageVO>
* @author:
* @date: 2020. 3. 24.
*/
public List<XitMenuManageVO> findMainMenuHeads(String uniqId);
/**
* <pre> : .</pre>
* @param uniqId
* @return List<XitMenuManageVO>
* @author:
* @date: 2020. 3. 24.
*/
public List<XitMenuManageVO> findtMainMenuLefts(String uniqId);
public String findMenuPath(String menu_no);
public String findMenuPath2(String pgmId);
}

@ -221,15 +221,7 @@ public class XitFrameUnitServiceBean extends AbstractServiceBean implements XitF
}
@Override
public List<Map<String, String>> findMenuListByUser(String uniqId) {
return CacheServiceUtils.findMenuListByUser(uniqId);
}
@Override
public List<Map<String, String>> findMenuListByAuthId(String authId){
return CacheServiceUtils.findMenuListByAuthId(authId);
}
@Override
public int findUserAcntDuplCheck(String accountId) {

@ -1,73 +0,0 @@
package cokr.xit.fims.framework.biz.cmm.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.framework.biz.cmm.dao.XitMainMapper;
import cokr.xit.fims.framework.biz.cmm.service.XitMainService;
import cokr.xit.fims.framework.core.XitMenuManageVO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import java.sql.SQLException;
import java.util.List;
@AllArgsConstructor
@Service
public class XitMainServiceBean extends AbstractServiceBean implements XitMainService {
private final XitMainMapper xitMainMapper;
@Override
public List<XitMenuManageVO> findMainMenuHeads(String uniqId) {
XitMenuManageVO vo = new XitMenuManageVO();
vo.setTmpUniqId(uniqId);
List<XitMenuManageVO> result = null;
try {
result = xitMainMapper.findMainMenuHeads(vo);
} catch (SQLException e) {
throw new RuntimeException("상단 메뉴목록 조회 실패", e);
}
return result;
}
@Override
public List<XitMenuManageVO> findtMainMenuLefts(String uniqId) {
XitMenuManageVO vo = new XitMenuManageVO();
vo.setTmpUniqId(uniqId);
List<XitMenuManageVO> result = null;
try {
result = xitMainMapper.findtMainMenuLefts(vo);
} catch (SQLException e) {
throw new RuntimeException("좌측 메뉴목록 조회 실패", e);
}
return result;
}
@Override
public String findMenuPath(String menu_no) {
String result = null;
try {
result = xitMainMapper.findMenuPath(menu_no);
} catch (SQLException e) {
throw new RuntimeException("메뉴 조회 실패", e);
}
return result;
}
@Override
public String findMenuPath2(String pgmId) {
String result = null;
try {
result = xitMainMapper.findMenuPath2(pgmId);
} catch (SQLException e) {
throw new RuntimeException("메뉴 조회 실패", e);
}
return result;
}
}

@ -3,7 +3,7 @@ package cokr.xit.fims.framework.biz.cmm.web;
import cokr.xit.foundation.web.AbstractController;
import cokr.xit.fims.framework.biz.cache.util.CacheServiceUtils;
import cokr.xit.fims.framework.biz.cmm.XitLoginVO;
import cokr.xit.fims.framework.biz.cmm.service.XitMainService;
import cokr.xit.fims.framework.biz.mng.bbs.XitBasicBbsMngSearchVO;
import cokr.xit.fims.framework.biz.mng.bbs.service.XitBasicBbsMngService;
import cokr.xit.fims.framework.core.XitMenuManageVO;
@ -36,7 +36,7 @@ import java.util.Map;
@RequestMapping(name = "", value="/framework/biz/cmm/")
public class XitMainController extends AbstractController {
private final XitMainService xitMainService;
private final XitBasicBbsMngService xitBasicBbsMngService;
/**
@ -74,8 +74,7 @@ public class XitMainController extends AbstractController {
if(EgovUserDetailsHelper.isAuthenticated() && user!=null){
model.addAttribute("list_headmenu", xitMainService.findMainMenuHeads(user.getUniqId()));
model.addAttribute("list_menulist", xitMainService.findtMainMenuLefts(user.getUniqId()));
}else{
}
@ -113,7 +112,7 @@ public class XitMainController extends AbstractController {
return mav;
}
String result = xitMainService.findMenuPath(menuNo);
String result = null;
if(result.endsWith(".do")){
result = result.substring(0, result.length() -3);
}
@ -136,7 +135,7 @@ public class XitMainController extends AbstractController {
return mav;
}
String result = xitMainService.findMenuPath2(pgmId);
String result = null;
if(result.endsWith(".do")){
result = result.substring(0, result.length() -3);
}

@ -32,6 +32,6 @@ public class XitRoleInfoVO {
private String roleSort; //역할 정렬
private String roleCreatDe; //역할 생성 일
private String regYn; // 권한 롤 등록여부 : xit_author_role_relate
private String regYn; // 권한 롤 등록여부
private String creatDt; // 권한롤 등록일
}

@ -1,67 +0,0 @@
package cokr.xit.fims.framework.biz.mng.auth.dao;
import cokr.xit.fims.framework.biz.mng.auth.XitAuthorInfoVO;
import cokr.xit.fims.framework.biz.mng.auth.XitRoleInfoVO;
import cokr.xit.fims.framework.biz.mng.auth.XitRoleSclsrtRescueVO;
import org.apache.ibatis.session.RowBounds;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import java.util.List;
import java.util.Map;
/**
*
* @: Mapper
* @:
* @: 2020. 4. 16. 9:38:07
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface AuthAuthorMgtMapper {
/**
* <pre> : </pre>
*
* @param paraMap
* @param rowBounds
* @return List<XitAuthRegMngVO>
* @author:
* @date: 2020. 4. 16.
*/
<T> List<XitAuthorInfoVO> selectAuthorInfos(final Map<String,Object> paraMap, final RowBounds rowBounds);
/**
*
* @param t Map VO generic (AuthHierarchy VO )
* @return
* @param <T>
*/
<T> List<XitAuthorInfoVO> selectAuthorInfos(final T t);
/**
* <pre> : </pre>
* @param vo
* @return XitAuthRegMngVO
* @author:
* @date: 2020. 4. 16.
*/
<T> XitAuthorInfoVO selectAuthorInfo(final T t);
int insertAuthorInfo(final XitAuthorInfoVO vo);
int updateAuthorInfo(final XitAuthorInfoVO vo);
int deleteAuthorInfo(final String authId);
List<XitRoleSclsrtRescueVO> selectRoleSclsrtRescues(final XitRoleSclsrtRescueVO vo);
XitRoleSclsrtRescueVO selectRoleSclsrtRescue(final XitRoleSclsrtRescueVO vo);
int insertRoleSclsrtRescue(final XitRoleSclsrtRescueVO vo);
int deleteRoleSclsrtRescue(final XitRoleSclsrtRescueVO vo);
List<XitRoleInfoVO> selectAuthRoleGrantList(Map<String, Object> paraMap);
int deleteRoleGrant(Map<String, Object> map);
int saveRoleGrant(Map<String, Object> map);
}

@ -1,45 +0,0 @@
package cokr.xit.fims.framework.biz.mng.auth.dao;
import cokr.xit.fims.framework.biz.mng.auth.XitRoleInfoVO;
import org.apache.ibatis.session.RowBounds;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import java.util.List;
import java.util.Map;
/**
*
* @: Mapper
* @:
* @: 2020. 4. 16. 9:38:07
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface AuthRoleMgtMapper {
/**
* <pre> : </pre>
*/
@SuppressWarnings("MybatisXMapperMethodInspection")
List<XitRoleInfoVO> selectAuthRoles(final Map<String,Object> paraMap, final RowBounds rowBounds);
/**
* <pre> : </pre>
* @param vo
* @return XitAuthRuleMngVO
* @author:
* @date: 2020. 4. 16.
*/
<T> XitRoleInfoVO selectAuthRole(final T t);
int insertAuthRole(final XitRoleInfoVO vo);
int updateAuthRole(final XitRoleInfoVO vo);
int deleteAuthRole(final String roleCode);
}

@ -1,41 +0,0 @@
package cokr.xit.fims.framework.biz.mng.auth.service;
import cokr.xit.fims.framework.biz.mng.auth.XitAuthorInfoVO;
import cokr.xit.fims.framework.biz.mng.auth.XitRoleInfoVO;
import org.apache.ibatis.session.RowBounds;
import java.util.List;
import java.util.Map;
/**
*
* @: Service
* @:
* @: 2020. 4. 16. 9:38:56
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface AuthAuthorMgtService {
/**
* <pre> : </pre>
* @param paraMap
* @return List<XitAuthRegMngVO>
* @author:
* @date: 2020. 4. 16.
*/
List<XitAuthorInfoVO> findAuthAuthors(final Map<String,Object> paraMap, final RowBounds rowBounds);
List<XitAuthorInfoVO> findAuthAuthors(final Map<String,Object> paraMap);
<T> XitAuthorInfoVO findAuthAuthor(final T t);
void addAuthAuthor(final XitAuthorInfoVO vo);
void modifyAuthAuthor(final XitAuthorInfoVO vo);
void removeAuthAuthor(final String authId);
List<XitRoleInfoVO> findAuthRoleGrantList(final Map<String, Object> paraMap);
void saveAuthRoleGrantList(final Map<String, Object> paraMap);
}

@ -1,64 +0,0 @@
package cokr.xit.fims.framework.biz.mng.auth.service;
import cokr.xit.fims.framework.biz.mng.auth.XitRoleInfoVO;
import org.apache.ibatis.session.RowBounds;
import java.util.List;
import java.util.Map;
/**
*
* @: Service
* @:
* @: 2020. 4. 16. 9:38:56
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface AuthRoleMgtService {
/**
* <pre> : </pre>
* @param paraMap
* @return List<XitAuthRuleMngVO>
* @author:
* @date: 2020. 4. 16.
*/
List<XitRoleInfoVO> findAuthRoles(final Map<String,Object> paraMap, final RowBounds rowBounds);
/**
* <pre> : </pre>
* @param t
* @return XitAuthRuleMngVO
* @author:
* @date: 2020. 4. 16.
*/
<T> XitRoleInfoVO findAuthRole(final T t);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
void addAuthRole(final XitRoleInfoVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
void modifyAuthRole(final XitRoleInfoVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
void removeAuthRole(final String roleCode);
}

@ -1,123 +0,0 @@
package cokr.xit.fims.framework.biz.mng.auth.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.framework.biz.mng.auth.dao.AuthAuthorMgtMapper;
import cokr.xit.fims.framework.biz.mng.auth.XitAuthorInfoVO;
import cokr.xit.fims.framework.biz.mng.auth.XitRoleInfoVO;
import cokr.xit.fims.framework.biz.mng.auth.XitRoleSclsrtRescueVO;
import cokr.xit.fims.framework.biz.mng.auth.service.AuthAuthorMgtService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@RequiredArgsConstructor
@Slf4j
@Service
public class AuthAuthorMgtServiceBean extends AbstractServiceBean implements AuthAuthorMgtService {
private final AuthAuthorMgtMapper mapper;
/** 부모 권한코드 */
private static final String PARNTS_AUTHOR = "ROLE_USER";
/** 자녀 권한코드 */
private static final String CHLDRN_AUTHOR = "ROLE_ADMIN";
@Override
@Transactional(readOnly = true)
public List<XitAuthorInfoVO> findAuthAuthors(final Map<String,Object> paraMap, final RowBounds rowBounds) {
return mapper.selectAuthorInfos(paraMap, rowBounds);
}
@Override
@Transactional(readOnly = true)
public List<XitAuthorInfoVO> findAuthAuthors(final Map<String, Object> paraMap) {
return mapper.selectAuthorInfos(paraMap);
}
@Override
@Transactional(readOnly = true)
public <T> XitAuthorInfoVO findAuthAuthor(final T t) {
return mapper.selectAuthorInfo(t);
}
/* =====================================================
* 2020.05.21
*
* -: egovFrame ~ "익명사용자->사용자->관리자"
* ROLE .
* "관리자>매니저>정회원>준회원>비회원"
* ( ) .
* -: "익명사용자->사용자->관리자"
* "익명사용자->사용자->신규권한1/신규권한2/...->관리자"
* n "사용자" ROLE
* n ROLE "관리자" .
* AS-IS: "익명사용자->사용자->관리자" (PARENT) ROLE .
* TO-BE: "익명사용자->사용자->신규권한1/신규권한2/...->관리자" (PARENT) ROLE .
===================================================== */
@Override
@Transactional
public void addAuthAuthor(final XitAuthorInfoVO vo){
//권한정보 Insert
mapper.insertAuthorInfo(vo);
//계층구조생성
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
//부모관계 생성
roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR);
roleSclsrtRescueVO.setChldrnRole(vo.getAuthId());
mapper.insertRoleSclsrtRescue(roleSclsrtRescueVO);
//자녀관계 생성
roleSclsrtRescueVO.setParntsRole(vo.getAuthId());
roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR);
mapper.insertRoleSclsrtRescue(roleSclsrtRescueVO);
}
@Override
@Transactional
public void modifyAuthAuthor(final XitAuthorInfoVO vo){
mapper.updateAuthorInfo(vo);
}
@Transactional
public void removeAuthAuthor(final String authId){
//계층구조 삭제
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR);
roleSclsrtRescueVO.setChldrnRole(authId);
mapper.deleteRoleSclsrtRescue(roleSclsrtRescueVO);
//자녀관계 제거
roleSclsrtRescueVO.setParntsRole(authId);
roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR);
mapper.deleteRoleSclsrtRescue(roleSclsrtRescueVO);
mapper.deleteAuthorInfo(authId);
}
@Override
@Transactional(readOnly = true)
public List<XitRoleInfoVO> findAuthRoleGrantList(final Map<String, Object> paraMap) {
return mapper.selectAuthRoleGrantList(paraMap);
}
@SuppressWarnings("unchecked")
@Override
@Transactional
public void saveAuthRoleGrantList(final Map<String, Object> paraMap) {
List<Map<String,Object>> mapList = (List<Map<String, Object>>)paraMap.get("grantData");
mapList.forEach(map -> {
map.put("authId", paraMap.get("authId"));
if(Objects.equals(map.get("regYn"), "N"))
mapper.deleteRoleGrant(map);
else
mapper.saveRoleGrant(map);
});
}
}

@ -26,7 +26,6 @@ public class AuthByUserMgtServiceBean extends AbstractServiceBean implements Aut
private final UserMgtMapper userMapper;
private final AuthGrpMgtService authGrpMgtService;
private final UserMgtService userMgtService;
@Override
@ -40,8 +39,7 @@ public class AuthByUserMgtServiceBean extends AbstractServiceBean implements Aut
public void saveAuthUserList(List<Map<String, Object>> paraList) {
String sessionUniqId = XitCmmnUtil.getUserInfo().getUniqId();
paraList.forEach(map -> {
//유효성확인
authGrpMgtService.isCheckUserForCanChange(sessionUniqId, String.valueOf(map.get("authId")));
XitUserScrtySetupVO vo = new XitUserScrtySetupVO();
vo.setUserId(String.valueOf(map.get("uniqId")));

@ -1,158 +0,0 @@
package cokr.xit.fims.framework.biz.mng.auth.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.framework.biz.mng.auth.dao.AuthAuthorMgtMapper;
import cokr.xit.fims.framework.biz.mng.auth.dao.AuthGrpMgtMapper;
import cokr.xit.fims.framework.biz.mng.auth.XitAuthorGroupInfoVO;
import cokr.xit.fims.framework.biz.mng.auth.XitRoleSclsrtRescueVO;
import cokr.xit.fims.framework.biz.mng.auth.service.AuthGrpMgtService;
import cokr.xit.fims.framework.biz.mng.user.dao.UserMgtMapper;
import cokr.xit.fims.framework.biz.mng.user.XitUserScrtySetupVO;
import cokr.xit.fims.framework.core.utils.XitCmmnUtil;
import cokr.xit.fims.framework.support.exception.BizRuntimeException;
import cokr.xit.fims.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.RowBounds;
import org.egovframe.rte.fdl.cmmn.exception.FdlException;
import org.egovframe.rte.fdl.idgnr.EgovIdGnrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
@RequiredArgsConstructor
@Slf4j
@Service
public class AuthGrpMgtServiceBean extends AbstractServiceBean implements AuthGrpMgtService {
private final AuthGrpMgtMapper mapper;
private final AuthAuthorMgtMapper authAuthorMgtMapper;
private final UserMgtMapper userMgtMapper;
@Autowired
@Qualifier("groupIdGnrService")
private final EgovIdGnrService groupIdGnrService;
@Override
@Transactional(readOnly = true)
public List<XitAuthorGroupInfoVO> findAuthGrps(final Map<String, Object> paraMap, final RowBounds rowBounds) {
return mapper.selectAuthorGroupInfos(paraMap, rowBounds);
}
@Override
@Transactional(readOnly = true)
public <T> XitAuthorGroupInfoVO findAuthGrp(final T t) {
return mapper.selectAuthorGroupInfo(t);
}
@Override
@Transactional
public void addAuthGrp(final XitAuthorGroupInfoVO vo) {
// 유효성 확인
this.isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthId());
try {
vo.setGrpId(groupIdGnrService.getNextStringId());
} catch (FdlException e) {
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage());
}
mapper.insertAuthorGroupInfo(vo);
}
@Override
@Transactional
public void modifyAuthGrp(final XitAuthorGroupInfoVO vo) {
// 유효성 확인
this.isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthId());
mapper.updateAuthorGroupInfo(vo);
}
@Override
@Transactional
public void removeAuthGrp(final String grpId) {
mapper.deleteAuthorGroupInfo(grpId);
}
@Transactional(readOnly = true)
public void isCheckUserForCanChange(final String uniqId, final String trgetAuthId) {
//사용자보안설정 조회
XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO();
userScrtySetupVO.setUserId(uniqId);
List<XitUserScrtySetupVO> listUserScrtySetupVO = userMgtMapper.selectUserScrtySetups(userScrtySetupVO);
String userAuthId = XitCmmnUtil.isEmpty(listUserScrtySetupVO)?null:listUserScrtySetupVO.get(0).getAuthId();
if(!this.isCheckUserAuthIdForCanChange(userAuthId, trgetAuthId))
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "자신의 권한보다 상위 권한을 설정 할 수 없습니다.");;
}
private boolean isCheckUserAuthIdForCanChange(final String userAuthId, final String trgetAuthId) {
//역할(권한)계층구조 데이터 목록 조회
List<XitRoleSclsrtRescueVO> listRoleSclsrtRescueVO = authAuthorMgtMapper.selectRoleSclsrtRescues(null);
//역할(권한)계층구조를 사용하지 않고 있는 경우 true 반환
if(XitCmmnUtil.isEmpty(listRoleSclsrtRescueVO)) {
log.debug("Do not use a RoleSclsrtRescue Data !!");
return true;
}else {
//사용자의 권한 정보가 없을 때(비정상적인 루트로 등록한 사용자 계정으로 판단)
if(XitCmmnUtil.isEmpty(userAuthId)) {
log.debug("This user is have not UserScrtySetup Data !!");
return false;
}
}
boolean isExists = false;
//사용자 권한과 매칭되는 역할(권한)계층정보 유무 확인
for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) {
if(item.getParntsRole().equals(userAuthId)) {
isExists = true;
break;
}
}
//사용자 권한이 최상위 권한이면 true 반환
if(!isExists)
for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) {
if(item.getChldrnRole().equals(userAuthId)) {
log.debug("This user is Top-Level Author !!");
return true;
}
}
//사용자의 역할(권한)정보가 없으면 false 반환
if(!isExists) {
log.debug("This user is have not RoleSclsrtRescue Data !!");
return false;
}
/**
*
*
*/
return !this.isHighAuthor(listRoleSclsrtRescueVO, userAuthId, trgetAuthId);
}
private boolean isHighAuthor(final List<XitRoleSclsrtRescueVO> list, final String authId, final String highAuthId) {
boolean result = false;
for (XitRoleSclsrtRescueVO item : list) {
// 상위 권한으로 확인 되었으면 stop
if (result)
break;
// 권한코드가 일치하지 않으면 skip
if (!item.getParntsRole().equals(authId))
continue;
if (item.getChldrnRole().equals(highAuthId)) { // 상위 권한과 일치하면
result = true;
} else { // 상위 권한과 일치하지 않으면 재호출
result = this.isHighAuthor(list, item.getChldrnRole(), highAuthId);
}
}
return result;
}
}

@ -1,251 +0,0 @@
package cokr.xit.fims.framework.biz.mng.auth.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.framework.biz.mng.auth.dao.AuthAuthorMgtMapper;
import cokr.xit.fims.framework.biz.mng.auth.dao.AuthHierarchyMgtMapper;
import cokr.xit.fims.framework.biz.mng.auth.XitAuthHierarchyMngVO;
import cokr.xit.fims.framework.biz.mng.auth.XitAuthorInfoVO;
import cokr.xit.fims.framework.biz.mng.auth.XitRoleSclsrtRescueVO;
import cokr.xit.fims.framework.biz.mng.auth.service.AuthHierarchyMgtService;
import cokr.xit.fims.framework.core.utils.XitCmmnUtil;
import cokr.xit.fims.framework.support.exception.BizRuntimeException;
import cokr.xit.fims.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
@RequiredArgsConstructor
@Service
public class AuthHierarchyMgtServiceBean extends AbstractServiceBean implements AuthHierarchyMgtService {
private final AuthHierarchyMgtMapper mapper;
private final AuthAuthorMgtMapper authAuthorMgtMapper;
@Override
@Transactional(readOnly = true)
public List<XitAuthHierarchyMngVO> findAuthHierarchies(final Map<String, Object> paraMap, final RowBounds rowBounds) {
List<XitAuthHierarchyMngVO> voList = mapper.selectAuthHierarchies(paraMap, rowBounds);
//권한구조 설정
if(XitCmmnUtil.notEmpty(voList)) {
for(XitAuthHierarchyMngVO vo : voList) {
String strAuthorRescueCode = this.getStrAuthHierarchy(vo.getAuthId());
vo.setAuthorRescueCode(strAuthorRescueCode);
vo.setAuthorRescueCodeNm(this.convertKorNm(strAuthorRescueCode));
}
}
return voList;
}
@Override
@Transactional(readOnly = true)
public XitAuthHierarchyMngVO findAuthHierarchyInfo(final XitAuthHierarchyMngVO vo) {
XitAuthHierarchyMngVO result = new XitAuthHierarchyMngVO();
List<XitRoleSclsrtRescueVO> listRoleSclsrtRescueVO = authAuthorMgtMapper.selectRoleSclsrtRescues(new XitRoleSclsrtRescueVO());
if(XitCmmnUtil.isEmpty(listRoleSclsrtRescueVO))
return result;
String topButtonAuthId = this.getStrAuthHierarchy(listRoleSclsrtRescueVO.get(0).getChldrnRole());
topButtonAuthId = topButtonAuthId.split(">")[0].trim();
String strAuthorRescueCode = this.getStrAuthHierarchy(topButtonAuthId);
result.setAuthorRescueCode(strAuthorRescueCode);
return result;
}
@Transactional
public void saveAuthHierarchy(final XitAuthHierarchyMngVO vo) {
if(XitCmmnUtil.isEmpty(vo.getAuthId()))
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "권한코드는 필수조건 입니다.");
String[] arrAuthIdGrp = vo.getAuthId().split(","); //권한코드 묶음 목록
/**
*
* - .
* - () .
*/
if(arrAuthIdGrp[0].split(";").length>1)
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"최상위 부모는 한개만 설정 가능 합니다.");
// 최하위 자녀 갯수 확인
if(arrAuthIdGrp[arrAuthIdGrp.length-1].split(";").length>1)
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"최하위 자녀는 한개만 설정 가능 합니다.");
// 다중상속 구간 갯수 확인
int cnt = 0;
for(String authIdGrp : arrAuthIdGrp) {
if(authIdGrp.split(";").length > 1)
cnt++;
}
if(cnt > 1)
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"다중상속은 하나의 구간만 설정 가능 합니다.");
//권한계층구조 일괄 제거
authAuthorMgtMapper.deleteRoleSclsrtRescue(new XitRoleSclsrtRescueVO());
//권한계층 데이터 등록
for(int i=0; i<arrAuthIdGrp.length; i++) {
//마지막 권한이면 stop
if(i==arrAuthIdGrp.length-1)
break;
String[] arrParntsRole = arrAuthIdGrp[i].split(";");
String[] arrChldrnRole = arrAuthIdGrp[i+1].split(";");
for(int j=0; j<arrParntsRole.length; j++) {
String parntsRole = arrParntsRole[j];
for(int k=0; k<arrChldrnRole.length; k++) {
String chldrnRole = arrChldrnRole[k];
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
roleSclsrtRescueVO.setParntsRole(parntsRole);
roleSclsrtRescueVO.setChldrnRole(chldrnRole);
authAuthorMgtMapper.insertRoleSclsrtRescue(roleSclsrtRescueVO);
}
}
}
}
/**
* <pre> : .</pre>
* @param authId
* @return String
* @author:
* @date: 2020. 11. 2.
*/
private String getStrAuthHierarchy(final String authId) {
LinkedHashMap<String, String> mParnts = new LinkedHashMap<String, String>();
LinkedHashMap<String, String> mChldrn = new LinkedHashMap<String, String>();
List<XitRoleSclsrtRescueVO> list = authAuthorMgtMapper.selectRoleSclsrtRescues(new XitRoleSclsrtRescueVO());
this.getAuthHierarchy(list, authId, false, mParnts);
this.getAuthHierarchy(list, authId, true, mChldrn);
StringBuffer sb = new StringBuffer();
Iterator<String> it = mParnts.keySet().iterator();
while(it.hasNext()) {
sb.append(mParnts.get(it.next())).append(" > ");
}
sb.append(authId).append(" > ");
it = mChldrn.keySet().iterator();
while(it.hasNext()) {
sb.append(mChldrn.get(it.next())).append(" > ");
}
String result = sb.toString().trim();
return result.substring(0, result.length()-2);
}
/**
* <pre> : / resultMap(LinkedHashMap) .</pre>
* @param list
* @param authId
* @param isChldrnSearch (true: , false: )
* @param resultMap
* @return void
* @author:
* @date: 2020. 11. 2.
*/
private void getAuthHierarchy(final List<XitRoleSclsrtRescueVO> list, final String authId, final boolean isChldrnSearch, final LinkedHashMap<String, String> resultMap) {
for (XitRoleSclsrtRescueVO item : list) {
if(isChldrnSearch) {
// 권한코드가 일치하지 않으면 skip
if (!item.getParntsRole().equals(authId))
continue;
//권한코드 Set
if(resultMap.containsKey(authId)) {
//동일한 값이면 담지 않음
if(resultMap.get(authId).equals(item.getChldrnRole()))
continue;
resultMap.put(authId, resultMap.get(authId)+", "+item.getChldrnRole());
}else {
//동일한 값이 있으면 담지 않음
Iterator<String> it = resultMap.values().iterator();
boolean isExists = false;
LOOP:
while(it.hasNext()) {
String[] values = it.next().split(",");
for(int j=0; j<values.length; j++) {
String value = values[j].trim();
if(value.equals(item.getChldrnRole())) {
isExists = true;
break LOOP;
}
}
}
if(!isExists)
resultMap.put(authId, item.getChldrnRole());
}
//재탐색
this.getAuthHierarchy(list, item.getChldrnRole(), isChldrnSearch, resultMap);
}else {
// 권한코드가 일치하지 않으면 skip
if (!item.getChldrnRole().equals(authId))
continue;
//재탐색
this.getAuthHierarchy(list, item.getParntsRole(), isChldrnSearch, resultMap);
//권한코드 Set
if(resultMap.containsKey(authId)) {
//동일한 값이면 담지 않음
if(resultMap.get(authId).equals(item.getParntsRole()))
continue;
resultMap.put(authId, resultMap.get(authId)+", "+item.getParntsRole());
}else {
//동일한 값이 있으면 담지 않음
if(!resultMap.containsValue(item.getParntsRole())) {
resultMap.put(authId, item.getParntsRole());
}
}
}
}
}
private String convertKorNm(final String strAuthorRescueCode) {
//권한코드 Map 생성
List<XitAuthorInfoVO> listAuthorInfoVO = authAuthorMgtMapper.selectAuthorInfos(null);
Map<String, String> mAuthorInfo = new HashMap<String, String>();
for(XitAuthorInfoVO item : listAuthorInfoVO) {
mAuthorInfo.put(item.getAuthId(), item.getAuthNm());
}
StringBuffer sb = new StringBuffer();
String[] items = strAuthorRescueCode.split(">");
for(int i=0; i<items.length; i++) {
String item = items[i];
if(i>0)
sb.append(" > ");
String[] arrAuthId = item.split(",");
for(int j=0; j<arrAuthId.length; j++) {
String authId = arrAuthId[j].trim();
if(j==0)
sb.append(mAuthorInfo.get(authId));
else
sb.append(", ").append(mAuthorInfo.get(authId));
}
}
return sb.toString();
}
}

@ -1,68 +0,0 @@
package cokr.xit.fims.framework.biz.mng.auth.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.framework.biz.mng.auth.dao.AuthRoleMgtMapper;
import cokr.xit.fims.framework.biz.mng.auth.XitRoleInfoVO;
import cokr.xit.fims.framework.biz.mng.auth.service.AuthRoleMgtService;
import cokr.xit.fims.framework.support.exception.BizRuntimeException;
import cokr.xit.fims.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor;
import org.apache.ibatis.session.RowBounds;
import org.egovframe.rte.fdl.cmmn.exception.FdlException;
import org.egovframe.rte.fdl.idgnr.EgovIdGnrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
@RequiredArgsConstructor
@Service
public class AuthRoleMgtServiceBean extends AbstractServiceBean implements AuthRoleMgtService {
private final AuthRoleMgtMapper mapper;
@Autowired
@Qualifier("groupIdGnrService")
private final EgovIdGnrService groupIdGnrService;
@Override
@Transactional(readOnly = true)
public List<XitRoleInfoVO> findAuthRoles(final Map<String,Object> paraMap, final RowBounds rowBounds) {
return mapper.selectAuthRoles(paraMap, rowBounds);
}
@Override
@Transactional(readOnly = true)
public <T> XitRoleInfoVO findAuthRole(final T t) {
return mapper.selectAuthRole(t);
}
@Override
@Transactional
public void addAuthRole(final XitRoleInfoVO vo) {
String roleTyp = vo.getRoleTy();
if("method".equals(roleTyp)) roleTyp = "mtd";
else if("pointcut".equals(roleTyp)) roleTyp = "pct";
else roleTyp = "web";
try {
vo.setRoleCode(roleTyp.concat("-").concat(groupIdGnrService.getNextStringId()));
} catch (FdlException e) {
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage());
}
mapper.insertAuthRole(vo);
}
@Override
@Transactional
public void modifyAuthRole(final XitRoleInfoVO vo) {
mapper.updateAuthRole(vo);
}
@Override
@Transactional
public void removeAuthRole(final String roleCode) {
mapper.deleteAuthRole(roleCode);
}
}

@ -1,132 +0,0 @@
package cokr.xit.fims.framework.biz.mng.auth.web;
import cokr.xit.foundation.web.AbstractController;
import cokr.xit.fims.framework.biz.mng.auth.XitAuthorInfoVO;
import cokr.xit.fims.framework.biz.mng.auth.service.AuthAuthorMgtService;
import cokr.xit.fims.framework.core.constants.FrameworkConstants;
import cokr.xit.fims.framework.support.mybatis.MybatisUtils;
import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer;
import cokr.xit.fims.framework.support.util.Checks;
import cokr.xit.fims.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* @: Controller
* @:
* @: 2020. 4. 16. 9:39:52
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@RequiredArgsConstructor
@Controller
@RequestMapping(name = "", value = "/framework/biz/mng/auth")
public class AuthAuthorMgtController extends AbstractController {
private final AuthAuthorMgtService service;
@RequestMapping(name = "", value = "/mngAuthAuthorMgtPopup")
public ModelAndView mngAuthAuthorMgtPopup(final XitAuthorInfoVO vo){
ModelAndView mav = new ModelAndView();
if(Checks.isEmpty(vo) || Checks.isEmpty(vo.getAuthId())){
mav.addObject("authorInfoVO", new XitAuthorInfoVO());
mav.addObject("pageTitle", "권한 등록");
} else {
mav.addObject("authorInfoVO", service.findAuthAuthor(vo));
mav.addObject("pageTitle", "권한 변경");
}
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/mngAuthAuthorMgtPopup.popup");
return mav;
}
/**
* <pre> : </pre>
*/
@GetMapping(name = "", value = "findAuthAuthors")
public ModelAndView findAuthAuthors(@RequestParam final Map<String,Object> paraMap) {
return new ModelAndView("jsonView").addObject("result",service.findAuthAuthors(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
@PostMapping(name = "", value = "/addAuthAuthor")
//public ModelAndView addAuthAuthor(@ModelAttribute final XitAuthorInfoVO vo, final BindingResult bindingResult){
public ModelAndView addAuthAuthor(@ModelAttribute final XitAuthorInfoVO vo){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
//TODO : validate
//ValidationError.of("", vo, bindingResult);
service.addAuthAuthor(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav;
}
@PostMapping(name = "", value = "/modifyAuthAuthor")
//public ModelAndView modifyAuthAuthor(@ModelAttribute final XitAuthorInfoVO vo, final BindingResult bindingResult){
public ModelAndView modifyAuthAuthor(@ModelAttribute final XitAuthorInfoVO vo){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
//TODO : validate
//ValidationError.of("", vo, bindingResult);
service.modifyAuthAuthor(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS);
return mav;
}
@PostMapping(name = "", value = "/removeAuthAuthor")
public ModelAndView removeAuthAuthor(final String authId){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
service.removeAuthAuthor(authId);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS);
return mav;
}
@RequestMapping(name = "", value = "/mngAuthRoleGrantMgtPopup")
public ModelAndView mngAuthRoleGrantMgtPopup(@RequestParam Map<String,Object> paraMap) {
ModelAndView mav = new ModelAndView();
List<Map<String,String>> regYnList = new ArrayList<>();
Map<String,String> map = new HashMap<>();
map.put("code", "Y");
map.put("code_val", "등록");
regYnList.add(map);
map = new HashMap<>();;
map.put("code", "N");
map.put("code_val", "미등록");
regYnList.add(map);
mav.addObject("pageTitle", "권한별 롤 목록");
mav.addObject("regYnList", regYnList);
mav.addObject("authorRoleManageVO", paraMap);
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/mngAuthRoleGrantMgtPopup.popup");
return mav;
}
@GetMapping(name = "", value="/findAuthRoleGrantList")
public ModelAndView findAuthRoleGrantList(@RequestParam final Map<String,Object> paraMap) {
return new ModelAndView("jsonView").addObject("result",service.findAuthRoleGrantList(paraMap));
}
@PostMapping(name = "", value = "/saveAuthRoleGrantList")
public ModelAndView saveAuthRoleGrantList(@RequestBody final Map<String, Object> paraMap) {
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
service.saveAuthRoleGrantList(paraMap);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav;
}
}

@ -31,7 +31,6 @@ import java.util.Map;
@RequestMapping(name = "", value = "/framework/biz/mng/auth")
public class AuthGrpMgtController extends AbstractController {
private final AuthGrpMgtService service;
@ -43,8 +42,7 @@ public class AuthGrpMgtController extends AbstractController {
mav.addObject("groupManage", new XitAuthorGroupInfoVO());
mav.addObject("pageTitle", "권한그룹 등록");
} else {
mav.addObject("groupManage", service.findAuthGrp(vo));
mav.addObject("pageTitle", "권한그룹 변경");
}
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/mngAuthGrpMgtPopup.popup");
return mav;
@ -52,7 +50,7 @@ public class AuthGrpMgtController extends AbstractController {
@GetMapping(name = "", value = "/findAuthGrps")
public ModelAndView findAuthAuthors(@RequestParam final Map<String,Object> paraMap) {
return new ModelAndView("jsonView").addObject("result",service.findAuthGrps(paraMap, MybatisUtils.getPagingInfo(paraMap)));
return new ModelAndView("jsonView").addObject("result",null);
}
@PostMapping(name = "", value = "/addAuthGrp")
@ -60,9 +58,8 @@ public class AuthGrpMgtController extends AbstractController {
public ModelAndView addAuthAuthor(@ModelAttribute final XitAuthorGroupInfoVO vo){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
//TODO : validate
//ValidationError.of("", vo, bindingResult);
service.addAuthGrp(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav;
}
@ -72,9 +69,7 @@ public class AuthGrpMgtController extends AbstractController {
public ModelAndView modifyAuthAuthor(@ModelAttribute final XitAuthorGroupInfoVO vo){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
//TODO : validate
//ValidationError.of("", vo, bindingResult);
service.modifyAuthGrp(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS);
return mav;
}
@ -83,7 +78,6 @@ public class AuthGrpMgtController extends AbstractController {
public ModelAndView removeAuthAuthor(final String grpId){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
service.removeAuthGrp(grpId);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS);
return mav;
}

@ -1,109 +0,0 @@
package cokr.xit.fims.framework.biz.mng.auth.web;
import cokr.xit.foundation.web.AbstractController;
import cokr.xit.fims.framework.biz.mng.auth.XitAuthHierarchyMngVO;
import cokr.xit.fims.framework.biz.mng.auth.XitAuthorInfoVO;
import cokr.xit.fims.framework.biz.mng.auth.service.AuthAuthorMgtService;
import cokr.xit.fims.framework.biz.mng.auth.service.AuthHierarchyMgtService;
import cokr.xit.fims.framework.core.constants.FrameworkConstants;
import cokr.xit.fims.framework.support.exception.BizRuntimeException;
import cokr.xit.fims.framework.support.mybatis.MybatisUtils;
import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer;
import cokr.xit.fims.framework.support.util.ValidationError;
import cokr.xit.fims.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor;
import org.egovframe.rte.fdl.security.securedobject.EgovSecuredObjectService;
import org.egovframe.rte.fdl.security.userdetails.jdbc.EgovJdbcUserDetailsManager;
import org.springframework.security.access.hierarchicalroles.RoleHierarchy;
import org.springframework.security.access.hierarchicalroles.RoleHierarchyImpl;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
*
* @: Controller
* @:
* @: 2020. 11. 2. 9:39:52
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@RequiredArgsConstructor
@Controller
@RequestMapping(name = "", value = "/framework/biz/mng/auth")
public class AuthHierarchyMgtController extends AbstractController {
private final AuthHierarchyMgtService service;
private final AuthAuthorMgtService authAuthorMgtService;
@RequestMapping(name = "", value = "/mngAuthHierarchyMgtPopup")
public ModelAndView mngAuthHierarchyMgtPopup(XitAuthHierarchyMngVO vo){
ModelAndView mav = new ModelAndView();
//최하위 권한의 권한계층 조회
XitAuthHierarchyMngVO authHierarchyMngVO = service.findAuthHierarchyInfo(vo);
//권한코드 Map 생성
List<XitAuthorInfoVO> authorInfoVOList = authAuthorMgtService.findAuthAuthors(null);
Map<String, String> mAuthorInfo = new HashMap<String, String>();
authorInfoVOList.forEach(infoVO -> mAuthorInfo.put(infoVO.getAuthId(), infoVO.getAuthNm()));
//권한코드 목록에서 비중복 권한만 추출
Map<String, String> mNoDuplAuthorInfo = new HashMap<String, String>();
mNoDuplAuthorInfo.putAll(mAuthorInfo);
String[] arrAuthorRescue = authHierarchyMngVO.getAuthorRescueCode().split(">");
for(int i=0; i<arrAuthorRescue.length; i++) {
String[] arrAuthId = arrAuthorRescue[i].split(",");
for(int j=0; j<arrAuthId.length; j++) {
String authId = arrAuthId[j].trim();
if(mNoDuplAuthorInfo.containsKey(authId)) {
mNoDuplAuthorInfo.remove(authId);
}
}
}
//권한계층 미설정 권한 목록 설정
List<XitAuthorInfoVO> listAuthorInfo = new ArrayList<>();
for (String authId : mNoDuplAuthorInfo.keySet()) {
XitAuthorInfoVO authorInfo = new XitAuthorInfoVO();
authorInfo.setAuthId(authId);
authorInfo.setAuthNm(mNoDuplAuthorInfo.get(authId));
listAuthorInfo.add(authorInfo);
}
mav.addObject("authorList", listAuthorInfo);
mav.addObject("mAuthorInfo", mAuthorInfo);
mav.addObject("authHierarchyManage", authHierarchyMngVO);
mav.addObject("pageTitle", "권한 계층 설정");
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/mngAuthHierarchyMgtPopup.popup");
return mav;
}
@GetMapping(name = "", value = "/findAuthHierarchies")
public ModelAndView findAuthHierarchies(@RequestParam final Map<String,Object> paraMap){
return new ModelAndView("jsonView").addObject("result",service.findAuthHierarchies(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
@PostMapping(name = "", value = "/saveAuthHierarchy")
public ModelAndView saveAuthHierarchy(@ModelAttribute final XitAuthHierarchyMngVO vo, final BindingResult bindingResult){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
ValidationError.of("authHierarchyManage", vo, bindingResult);
service.saveAuthHierarchy(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_SUCCESS);
return mav;
}
}

@ -1,95 +0,0 @@
package cokr.xit.fims.framework.biz.mng.auth.web;
import cokr.xit.foundation.web.AbstractController;
import cokr.xit.fims.framework.biz.mng.auth.XitRoleInfoVO;
import cokr.xit.fims.framework.biz.mng.auth.service.AuthRoleMgtService;
import cokr.xit.fims.framework.core.constants.FrameworkConstants;
import cokr.xit.fims.framework.support.mybatis.MybatisUtils;
import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer;
import cokr.xit.fims.framework.support.util.Checks;
import cokr.xit.fims.framework.support.util.ValidationError;
import cokr.xit.fims.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import java.util.Map;
/**
*
* @: Controller
* @:
* @: 2020. 4. 16. 9:39:52
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@RequiredArgsConstructor
@Controller
@RequestMapping(name = "", value = "/framework/biz/mng/auth")
public class AuthRoleMgtController extends AbstractController {
private final AuthRoleMgtService service;
@RequestMapping(name = "", value = "/mngAuthRoleMgtPopup")
public ModelAndView mngAuthRoleMgtPopup(@ModelAttribute final XitRoleInfoVO vo){
ModelAndView mav = new ModelAndView();
if(Checks.isEmpty(vo) || Checks.isEmpty(vo.getRoleCode())){
mav.addObject("roleManage", new XitRoleInfoVO());
mav.addObject("pageTitle", "롤 등록");
} else {
mav.addObject("roleManage", service.findAuthRole(vo));
mav.addObject("pageTitle", "롤 정보 변경");
}
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/auth/mngAuthRoleMgtPopup.popup");
return mav;
}
/**
* <pre> : </pre>
* @return String
* @author:
* @date: 2020. 7. 31.
*/
@GetMapping(name = "", value = "/findAuthRoles")
public ModelAndView findAuthRoles(@RequestParam final Map<String,Object> paraMap) {
return new ModelAndView("jsonView").addObject("result",service.findAuthRoles(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
@PostMapping(name = "", value = "/addAuthRole")
public ModelAndView addAuthRole(@ModelAttribute final XitRoleInfoVO vo, final BindingResult bindingResult) {
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
//유효성 확인
ValidationError.of("roleManage", vo, bindingResult);
service.addAuthRole(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav;
}
@PostMapping(name = "", value = "/modifyAuthRole")
public ModelAndView modifyAuthRole(@ModelAttribute final XitRoleInfoVO vo, final BindingResult bindingResult) {
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
//유효성 확인
ValidationError.of("roleManage", vo, bindingResult);
service.modifyAuthRole(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS);
return mav;
}
@PostMapping(name = "", 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;
}
}

@ -1,17 +0,0 @@
package cokr.xit.fims.framework.biz.mng.menu.dao;
import cokr.xit.fims.framework.biz.cmm.XitMenuCreatDtlsVO;
import cokr.xit.fims.framework.biz.mng.menu.MenuCreateMngVO;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import java.util.List;
@Mapper
public interface MenuByRoleMgtMapper {
<T> List<MenuCreateMngVO> selectRoleInfos(T t);
<T> List<MenuCreateMngVO> selectMenuInfoByRoleList(T t);
int deleteMenuCreatDtls(final String authId);
int insertMenuCreatDtls(final XitMenuCreatDtlsVO vo);
}

@ -1,30 +0,0 @@
package cokr.xit.fims.framework.biz.mng.menu.dao;
import cokr.xit.fims.framework.biz.mng.menu.ProgramMngVO;
import org.apache.ibatis.session.RowBounds;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import java.util.List;
@Mapper
public interface ProgramMgtMapper {
/**
* <pre> : </pre>
*/
<T> List<ProgramMngVO> selectPrograms(final T t, final RowBounds rowBounds);
<T> List<ProgramMngVO> selectPrograms(final T t);
/**
* <pre> : </pre>
*/
<T> ProgramMngVO selectProgram(final T t);
int updateProgram(final ProgramMngVO vo);
int insertProgram(final ProgramMngVO vo);
/**
* <pre> : </pre>
*/
int deleteProgram(final String programFileNm);
}

@ -1,23 +0,0 @@
package cokr.xit.fims.framework.biz.mng.menu.service;
import cokr.xit.fims.framework.biz.mng.menu.MenuCreateMngVO;
import java.util.List;
import java.util.Map;
/**
*
* @: Service
* @:
* @: 2020. 3. 26. 10:07:11
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface MenuByRoleMgtService {
<T> List<MenuCreateMngVO> findRoleInfos(T t);
<T> List<MenuCreateMngVO> findMenuInfoByRoleList(T t);
void saveMenuByRoleList(Map<String, Object> paraMap);
}

@ -1,42 +0,0 @@
package cokr.xit.fims.framework.biz.mng.menu.service;
import cokr.xit.fims.framework.biz.mng.menu.ProgramMngVO;
import org.apache.ibatis.session.RowBounds;
import java.util.List;
import java.util.Map;
/**
*
* @: Service
* @:
* @: 2020. 3. 26. 10:07:11
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface ProgramMgtService {
/**
* <pre> : </pre>
*/
List<ProgramMngVO> findPrograms(final Map<String, Object> paraMap, final RowBounds rowBounds);
/**
* <pre> : </pre>
*/
ProgramMngVO findProgram(final String pgrmFileNm);
/**
* <pre> : </pre>
*/
int addProgram(final ProgramMngVO vo);
/**
* <pre> : </pre>
*/
int modifyProgram(final ProgramMngVO vo);
int removeProgram(final String programFileNm);
}

@ -1,58 +0,0 @@
package cokr.xit.fims.framework.biz.mng.menu.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.framework.biz.cache.service.CacheService;
import cokr.xit.fims.framework.biz.cmm.XitMenuCreatDtlsVO;
import cokr.xit.fims.framework.biz.mng.menu.dao.MenuByRoleMgtMapper;
import cokr.xit.fims.framework.biz.mng.menu.MenuCreateMngVO;
import cokr.xit.fims.framework.biz.mng.menu.service.MenuByRoleMgtService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
//TODO : 캐쉬 반영??
@RequiredArgsConstructor
@Service
public class MenuByRoleMgtServiceBean extends AbstractServiceBean implements MenuByRoleMgtService {
private final MenuByRoleMgtMapper mapper;
private final CacheService cacheService;
@Override
@Transactional(readOnly = true)
public <T> List<MenuCreateMngVO> findRoleInfos(T t) {
return mapper.selectRoleInfos(t);
}
@Override
@Transactional(readOnly = true)
public <T> List<MenuCreateMngVO> findMenuInfoByRoleList(T t) {
return mapper.selectMenuInfoByRoleList(t);
}
@Override
@Transactional
public void saveMenuByRoleList(Map<String, Object> paraMap) {
String authId = String.valueOf(paraMap.get("authId"));
@SuppressWarnings("unchecked")
List<String> menuNoList = (List<String>)paraMap.get("menuNoList");
// 해당 권한의 메뉴 삭제
mapper.deleteMenuCreatDtls(authId);
// 메뉴 등록
menuNoList.forEach((menuNo) -> {
mapper.insertMenuCreatDtls(
XitMenuCreatDtlsVO
.builder()
.authId(authId)
.menuNo(menuNo)
.build()
);
});
cacheService.evictAllMenuCache();
}
}

@ -1,73 +0,0 @@
package cokr.xit.fims.framework.biz.mng.menu.service.bean;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.fims.framework.biz.mng.menu.dao.ProgramMgtMapper;
import cokr.xit.fims.framework.biz.mng.menu.ProgramMngVO;
import cokr.xit.fims.framework.biz.mng.menu.service.ProgramMgtService;
import cokr.xit.fims.framework.core.constants.FrameworkConstants;
import cokr.xit.fims.framework.core.utils.XitCmmnUtil;
import cokr.xit.fims.framework.support.exception.BizRuntimeException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
@Slf4j
@RequiredArgsConstructor
@Service
public class ProgramMgtServiceBean extends AbstractServiceBean implements ProgramMgtService {
private final ProgramMgtMapper mapper;
@Override
@Transactional(readOnly = true)
public List<ProgramMngVO> findPrograms(final Map<String, Object> paraMap, final RowBounds rowBounds) {
return mapper.selectPrograms(paraMap, rowBounds);
}
@Override
@Transactional(readOnly = true)
public ProgramMngVO findProgram(final String pgrmFileNm) {
return mapper.selectProgram(pgrmFileNm);
}
@Override
@Transactional
public int addProgram(final ProgramMngVO vo) {
return mapper.insertProgram(vo);
}
@Override
@Transactional
public int modifyProgram(final ProgramMngVO vo) {
String table = "프로그램목록";
FrameworkConstants.DB_ACTION action = FrameworkConstants.DB_ACTION.U;
/**
*
*/
String emsg = null;
if(XitCmmnUtil.isEmpty(vo.getPgrmFileNm()))
emsg = String.format("(%s)프로그램파일명(은)는 필수조건 입니다.", table);
if(emsg!=null){
log.error(emsg);
throw BizRuntimeException.create(emsg);
}
int result = mapper.updateProgram(vo);
if(result<1) throw BizRuntimeException.create(String.format("%s 실패. 일치하는 자료가 없습니다.", action.getKorNm()));
return result;
}
@Override
@Transactional
public int removeProgram(final String programFileNm) {
return mapper.deleteProgram(programFileNm);
}
}

@ -1,50 +0,0 @@
package cokr.xit.fims.framework.biz.mng.menu.web;
import cokr.xit.foundation.web.AbstractController;
import cokr.xit.fims.framework.biz.mng.menu.MenuCreateMngVO;
import cokr.xit.fims.framework.biz.mng.menu.service.MenuByRoleMgtService;
import cokr.xit.fims.framework.core.constants.FrameworkConstants;
import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer;
import cokr.xit.fims.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import java.util.Map;
@RequiredArgsConstructor
@Controller
@RequestMapping(name = "", value = "/framework/biz/mng/menu")
public class MenuByRoleMgtController extends AbstractController {
private final MenuByRoleMgtService service;
@RequestMapping(name = "", value = "/mngMenuByRoleMgtPopup")
public ModelAndView mngMenuByRoleMgtPopup(final MenuCreateMngVO vo) {
ModelAndView mav = new ModelAndView();
mav.addObject("list_menulist", service.findMenuInfoByRoleList(vo));
mav.addObject("resultVO", vo);
mav.addObject("pageTitle", "권한별 메뉴");
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/menu/mngMenuByRoleMgtPopup.popup");
return mav;
}
@GetMapping(name = "", value = "/findMenuByRoleList")
public ModelAndView findMenus(@RequestParam final Map<String,Object> paraMap) {
return new ModelAndView("jsonView").addObject("result",service.findRoleInfos(paraMap));
}
@PostMapping(name = "", value = "/saveMenuByRoleList")
public ModelAndView saveMenuByRoleList(@RequestBody final Map<String, Object> paraMap){
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
service.saveMenuByRoleList(paraMap);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav;
}
}

@ -1,133 +0,0 @@
package cokr.xit.fims.framework.biz.mng.menu.web;
import cokr.xit.foundation.web.AbstractController;
import cokr.xit.fims.framework.biz.mng.menu.ProgramMngVO;
import cokr.xit.fims.framework.biz.mng.menu.service.ProgramMgtService;
import cokr.xit.fims.framework.core.constants.FrameworkConstants;
import cokr.xit.fims.framework.support.mybatis.MybatisUtils;
import cokr.xit.fims.framework.support.util.AjaxMessageMapRenderer;
import cokr.xit.fims.framework.support.util.Checks;
import cokr.xit.fims.framework.support.util.ValidationError;
import cokr.xit.fims.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import java.util.Map;
/**
*
* @: Controller
* @:
* @: 2020. 3. 25. 4:05:40
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Slf4j
@RequiredArgsConstructor
@Controller
@RequestMapping(name = "", value = "/framework/biz/mng/menu")
public class ProgramMgtController extends AbstractController {
private final ProgramMgtService service;
@RequestMapping(name = "", value = "/mngProgramSchPopup")
public ModelAndView mngProgramSchPopup(@RequestParam final Map<String, Object> paraMap) {
ModelAndView mav = new ModelAndView();
mav.addAllObjects(paraMap);
mav.addObject("pageTitle", "프로그램 조회");
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/menu/mngProgramSchPopup.popup");
return mav;
}
/**
* / popup page
* @param pgrmFileNm :
* @return ModelAndView
*/
@RequestMapping(name = "", value = "/mngProgramMgtPopup")
public ModelAndView mngProgramMgtPopup(final String pgrmFileNm) {
ModelAndView mav = new ModelAndView();
if(Checks.isEmpty(pgrmFileNm)){
mav.addObject("progrmMngVO", new ProgramMngVO());
mav.addObject("pageTitle", "프로그램 정보 등록");
} else {
mav.addObject("progrmMngVO", service.findProgram(pgrmFileNm));
mav.addObject("pageTitle", "프로그램 정보 변경");
}
mav.setViewName(FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/menu/mngProgramMgtPopup.popup");
return mav;
}
/**
* :
* Paging : parameter Map
* @RequestParam
* @param paraMap
* @return String
* @author:
* @date: 2022. 10. 13.
*/
/*@PostMapping(name = "", value = "ProgramMng_list.do")*/
@GetMapping(name = "", value = "/findPrograms")
public ModelAndView findPrograms(@RequestParam final Map<String,Object> paraMap) {
return new ModelAndView("jsonView").addObject("result",service.findPrograms(paraMap, MybatisUtils.getPagingInfo(paraMap)));
}
/**
*
* @param vo
* @param bindingResult
* @return ModelAndView
*/
@PostMapping(name = "", value = "/addProgram")
public ModelAndView addProgram(@ModelAttribute final ProgramMngVO vo, final BindingResult bindingResult) {
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
//유효성 확인
ValidationError.of("progrmMngVO", vo, bindingResult);
service.addProgram(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_INSERT_SUCCESS);
return mav;
}
/**
*
* @param vo
* @param bindingResult
* @return ModelAndView
*/
@PostMapping(name = "", value = "/modifyProgram")
public ModelAndView modifyProgram(
@ModelAttribute final ProgramMngVO vo, final BindingResult bindingResult) {
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
//유효성 확인
ValidationError.of("progrmMngVO", vo, bindingResult);
service.modifyProgram(vo);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS);
return mav;
}
/**
*
* @param pgrmFileNm
* @return ModelAndView
*/
@PostMapping(name = "", value = "/removeProgram")
public ModelAndView removeProgram(final String pgrmFileNm) {
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
service.removeProgram(pgrmFileNm);
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_DELETE_SUCCESS);
return mav;
}
}

@ -132,16 +132,16 @@ public class UserMgtServiceBean extends AbstractServiceBean implements UserMgtSe
//업무사용자 삭제
Map<String,Object> userInfoCheckMap = mapper.selectCheckUserInfo(userId);
String userId = String.valueOf(userInfoCheckMap.get("user_id"));
String targetUserId = String.valueOf(userInfoCheckMap.get("user_id"));
//사용자보안설정 삭제
if(Checks.isNotEmpty(mapper.selectUserScrtySetup(userId))) {
mapper.deleteUserScrtySetup(userId);
if(Checks.isNotEmpty(mapper.selectUserScrtySetup(targetUserId))) {
mapper.deleteUserScrtySetup(targetUserId);
}
//사용자정보변경내역 전체 삭제
mapper.deleteUserInfoChangeDtlsList(userId);
mapper.deleteUserInfoChangeDtlsList(targetUserId);
//업무사용자(직원)삭제
mapper.deleteUserInfo(userId);
mapper.deleteUserInfo(targetUserId);
}

@ -67,12 +67,12 @@ public class MenuIntercepter extends HandlerInterceptorAdapter {
XitLoginVO loginVO = (XitLoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
//사용자별 메뉴 목록 조회
allMenuList = CacheServiceUtils.findMenuListByUser(loginVO.getUniqId());
allMenuList = null;
}
else {
//익명사용자 메뉴 목록 조회
allMenuList = CacheServiceUtils.findMenuListByAuthId("ROLE_ANONYMOUS");
allMenuList =null;
}
// main page만 메뉴목록 / 공지사항 조회

@ -30,12 +30,7 @@
FROM xit_orgnzt_info
</when>
<when test='type != null and type == "GROUP"'>
/* 그룹 코드 */
SELECT grp_id AS code
, group_nm AS code_val
FROM xit_author_group_info
</when>
<when test='type != null and type == "AUTHOR"'>
/* 권한 코드 */
@ -44,12 +39,7 @@
FROM TB_AUTHORITY
</when>
<when test='type != null and type == "AUTHOR_GRP"'>
/* 권한 그룹 코드 */
SELECT grp_id AS code
, group_nm AS code_val
FROM xit_author_group_info
</when>
<when test='type != null and type == "CMM_CFN"'>
/* 분류코드 */

@ -1,113 +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.framework.biz.cache.dao.CacheMenuMapper">
<select id="selectMenuListAll" parameterType="string" resultType="java.util.Map">
/* cachemenu-mysql-mapper|selectMenuListAll-전체 메뉴 조회|julim */
<include refid="sqlTree"/>
SELECT D.menu_id AS "menuSid"
, D.menu_name AS "menuName"
, (CASE B.ACTION WHEN '/' THEN '#' ELSE B.ACTION END) AS "menuView"
, D.menu_depth AS "menuDepth"
, D.parnt_menu_id AS "parentSid"
, D.menu_full_path AS "menuPath"
, D.menu_full_path_name AS "menuPathname"
, '' AS "superYn"
, ( SELECT COUNT(1)
FROM TREE_QUERY SA
WHERE SA.parnt_menu_id = D.menu_id) AS "childCnt"
, '' AS "iconClass"
FROM tb_menu B
INNER JOIN tree_query D
ON B.menu_no = D.menu_id
ORDER BY D.parnt_menu_id, B.srt_ord
</select>
<select id="selectMenuListByUser" parameterType="string" resultType="java.util.Map">
/* cachemenu-mysql-mapper|selectMenuListByUser-사용자별 메뉴 조회|julim */
<include refid="sqlTree"/>
SELECT D.menu_id AS "menuSid"
, D.menu_name AS "menuName"
, (CASE B.ACTION WHEN '/' THEN '#' ELSE B.ACTION END) AS "menuView"
, D.menu_depth AS "menuDepth"
, D.parnt_menu_id AS "parentSid"
, D.menu_full_path AS "menuPath"
, D.menu_full_path_name AS "menuPathname"
, '' AS "superYn"
, ( SELECT COUNT(1)
FROM TREE_QUERY SA
WHERE SA.parnt_menu_id = D.menu_id) AS "childCnt"
, D.icon_class AS "iconClass"
FROM xit_menu_creat_dtls A
INNER JOIN tb_menu B
ON A.menu_no = B.menu_no
INNER JOIN (
SELECT FA.auth_Id, FA.USER_ID
FROM xit_user_scrty_setup FA
WHERE FA.USER_ID = #{uniqId}
) C
ON A.auth_Id = C.auth_Id
INNER JOIN tree_query D
ON B.menu_no = D.menu_id
ORDER BY D.parnt_menu_id, B.srt_ord
</select>
<select id="selectMenuListByAuthId" parameterType="string" resultType="java.util.Map">
/* cachemenu-mysql-mapper|selectMenuListByAuthId-권한별 메뉴 조회|julim */
<include refid="sqlTree"/>
SELECT D.menu_id AS "menuSid"
, D.menu_name AS "menuName"
, (CASE B.ACTION WHEN '/' THEN '#' ELSE B.ACTION END) AS "menuView"
, D.menu_depth AS "menuDepth"
, D.parnt_menu_id AS "parentSid"
, D.menu_full_path AS "menuPath"
, D.menu_full_path_name AS "menuPathname"
, '' AS "superYn"
, (SELECT COUNT(1)
FROM TREE_QUERY SA
WHERE SA.parnt_menu_id = D.menu_id) AS "childCnt"
, D.icon_class AS "iconClass"
FROM xit_menu_creat_dtls A
JOIN tb_menu B
ON A.menu_no = B.menu_no
JOIN tree_query D
ON B.menu_no = D.menu_id
WHERE A.auth_Id = #{authId}
ORDER BY D.parnt_menu_id, B.srt_ord
</select>
<sql id="sqlTree">
WITH RECURSIVE tree_query(
menu_id
, PARNT_menu_id
, menu_name
, menu_full_path
, menu_full_path_name
, menu_depth
, icon_class
) AS (
SELECT A.menu_no AS "menu_id"
, A.prnt_no AS "parnt_menu_id"
, A.menu_nm AS "menu_name"
, CAST(CONCAT('', A.menu_no) AS VARCHAR(100))
, CAST(CONCAT('', A.menu_nm) AS VARCHAR(1000))
, 1 AS "menu_depth"
, '' AS "icon_class"
FROM tb_menu A
WHERE A.prnt_no = 0
UNION ALL
SELECT A.menu_no AS "menu_id"
, A.prnt_no AS "parnt_menu_id"
, A.menu_nm AS "menu_name"
, CONCAT(B.menu_full_path, '_', A.menu_no) AS "menu_full_path"
, CONCAT(B.menu_full_path_name, ' > ', A.menu_nm) AS "menu_full_path_name"
, B.menu_depth + 1 AS "menu_depth"
, '' AS "icon_class"
FROM tb_menu A
INNER JOIN tree_query B
ON A.prnt_no = B.menu_id
WHERE B.menu_id != 0
)
</sql>
</mapper>

@ -70,20 +70,7 @@
<select id="findGroupCodes" resultType="cokr.xit.fims.framework.core.XitCodeVO">
/** findGroupCodes */
/** 그룹코드 목록 조회 */
SELECT
#{tableNm} AS "grpId"
,GRP_ID AS "code"
,GROUP_NM AS "codeVal"
,DSCRP AS "dscrp"
FROM XIT_AUTHOR_GROUP_INFO
WHERE 1=1
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(grpId)">
AND GRP_ID LIKE #{grpId}
</if>
</select>
<select id="instCdToSggCd" resultType="java.lang.String">
SELECT SGG_CD

@ -2,71 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cokr.xit.fims.framework.biz.cmm.dao.XitFrameCrudMapper">
<select id="findXitAuthorGroupInfos" resultType="cokr.xit.fims.framework.biz.mng.auth.XitAuthorGroupInfoVO">
/** findXitAuthorGroupInfos */
/** 권한그룹정보 다건 조회 */
SELECT GRP_ID
,GROUP_NM
,GROUP_CREAT_DE
,DSCRP
,auth_Id
FROM XIT_AUTHOR_GROUP_INFO
WHERE 1=1
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notempty(grpId)">AND GRP_ID = #{grpId}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(groupNm)">AND GROUP_NM = #{groupNm}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(groupCreatDe)">AND GROUP_CREAT_DE = #{groupCreatDe}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(dscrp)">AND DSCRP = #{dscrp}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(authId)">AND auth_Id = #{authId}</if>
</select>
<select id="findXitAuthorGroupInfo" resultType="cokr.xit.fims.framework.biz.mng.auth.XitAuthorGroupInfoVO">
/** findXitAuthorGroupInfo */
/** 권한그룹정보 조회 */
SELECT GRP_ID
,GROUP_NM
,GROUP_CREAT_DE
,DSCRP
,auth_Id
FROM XIT_AUTHOR_GROUP_INFO
WHERE 1=1
AND GRP_ID = #{grpId}
</select>
<insert id="addXitAuthorGroupInfo">
/** addXitAuthorGroupInfo */
/** 권한그룹정보 등록 */
INSERT INTO XIT_AUTHOR_GROUP_INFO(
GRP_ID
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(groupNm)">,GROUP_NM</if>
,GROUP_CREAT_DE
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(dscrp)">,DSCRP</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(authId)">,auth_Id</if>
)VALUES(
#{grpId}
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(groupNm)">,#{groupNm}</if>
,DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(dscrp)">,#{dscrp}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(authId)">,#{authId}</if>
)
</insert>
<update id="modifyXitAuthorGroupInfo">
/** modifyXitAuthorGroupInfo */
/** 권한그룹정보 수정 */
UPDATE XIT_AUTHOR_GROUP_INFO
SET
GROUP_CREAT_DE = GROUP_CREAT_DE
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notBlank(groupNm)">,GROUP_NM = #{groupNm}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notBlank(dscrp)">,DSCRP = #{dscrp}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notBlank(authId)">,auth_Id = #{authId}</if>
WHERE 1=1
AND GRP_ID = #{grpId}
</update>
<delete id="removeXitAuthorGroupInfo">
/** removeXitAuthorGroupInfo */
/** 권한그룹정보 삭제 */
DELETE FROM XIT_AUTHOR_GROUP_INFO
WHERE 1=1
AND GRP_ID = #{grpId}
</delete>
@ -132,62 +68,7 @@
</delete>
<select id="findXitAuthorRoleRelates" resultType="cokr.xit.fims.framework.biz.cmm.XitAuthorRoleRelateVO">
/** findXitAuthorRoleRelates */
/** 권한역할관계 다건 조회 */
SELECT auth_Id
,ROLE_CODE
,CREAT_DT
FROM XIT_AUTHOR_ROLE_RELATE
WHERE 1=1
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(authId)">AND auth_Id = #{authId}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(roleCode)">AND ROLE_CODE = #{roleCode}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(creatDt)">AND CREAT_DT = #{creatDt}</if>
</select>
<select id="findXitAuthorRoleRelate" resultType="cokr.xit.fims.framework.biz.cmm.XitAuthorRoleRelateVO">
/** findXitAuthorRoleRelate */
/** 권한역할관계 조회 */
SELECT auth_Id
,ROLE_CODE
,CREAT_DT
FROM XIT_AUTHOR_ROLE_RELATE
WHERE 1=1
AND auth_Id = #{authId}
AND ROLE_CODE = #{roleCode}
</select>
<insert id="addXitAuthorRoleRelate">
/** addXitAuthorRoleRelate */
/** 권한역할관계 등록 */
INSERT INTO XIT_AUTHOR_ROLE_RELATE(
auth_Id
,ROLE_CODE
,CREAT_DT
)VALUES(
#{authId}
,#{roleCode}
,NOW()
)
</insert>
<update id="modifyXitAuthorRoleRelate">
/** modifyXitAuthorRoleRelate */
/** 권한역할관계 수정 */
<!-- UPDATE XIT_AUTHOR_ROLE_RELATE -->
<!-- SET -->
<!-- WHERE 1=1 -->
<!-- AND auth_Id = #{authId} -->
<!-- AND ROLE_CODE = #{roleCode} -->
</update>
<delete id="removeXitAuthorRoleRelate">
/** removeXitAuthorRoleRelate */
/** 권한역할관계 삭제 */
DELETE FROM XIT_AUTHOR_ROLE_RELATE
WHERE 1=1
AND auth_Id = #{authId}
AND ROLE_CODE = #{roleCode}
</delete>
@ -1311,63 +1192,7 @@
</delete>
<select id="findXitMenuCreatDtlss" resultType="cokr.xit.fims.framework.biz.cmm.XitMenuCreatDtlsVO">
/** findXitMenuCreatDtlss */
/** 메뉴생성내역 다건 조회 */
SELECT MENU_NO
,auth_Id
,MAPNG_CREAT_ID
FROM XIT_MENU_CREAT_DTLS
WHERE 1=1
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(menuNo)">AND MENU_NO = #{menuNo}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(authId)">AND auth_Id = #{authId}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(mapngCreatId)">AND MAPNG_CREAT_ID = #{mapngCreatId}</if>
</select>
<select id="findXitMenuCreatDtls" resultType="cokr.xit.fims.framework.biz.cmm.XitMenuCreatDtlsVO">
/** findXitMenuCreatDtls */
/** 메뉴생성내역 조회 */
SELECT MENU_NO
,auth_Id
,MAPNG_CREAT_ID
FROM XIT_MENU_CREAT_DTLS
WHERE 1=1
AND MENU_NO = #{menuNo}
AND auth_Id = #{authId}
</select>
<insert id="addXitMenuCreatDtls">
/** addXitMenuCreatDtls */
/** 메뉴생성내역 등록 */
INSERT INTO XIT_MENU_CREAT_DTLS(
MENU_NO
,auth_Id
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(mapngCreatId)">,MAPNG_CREAT_ID</if>
)VALUES(
#{menuNo}
,#{authId}
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(mapngCreatId)">,#{mapngCreatId}</if>
)
</insert>
<update id="modifyXitMenuCreatDtls">
/** modifyXitMenuCreatDtls */
/** 메뉴생성내역 수정 */
UPDATE XIT_MENU_CREAT_DTLS
SET
MAPNG_CREAT_ID = IFNULL(#{mapngCreatId}, MAPNG_CREAT_ID)
WHERE 1=1
AND MENU_NO = #{menuNo}
AND auth_Id = #{authId}
</update>
<delete id="removeXitMenuCreatDtls">
/** removeXitMenuCreatDtls */
/** 메뉴생성내역 삭제 */
DELETE FROM XIT_MENU_CREAT_DTLS
WHERE 1=1
AND MENU_NO = #{menuNo}
AND auth_Id = #{authId}
</delete>
@ -1516,216 +1341,12 @@
<select id="findXitProgrmLists" resultType="cokr.xit.fims.framework.biz.cmm.ProgrmListVO">
/** findXitProgrmLists */
/** 프로그램목록 다건 조회 */
SELECT pgrm_file_nm
,PROGRM_STRE_COURS
,PROGRM_KOREAN_NM
,DSCRP
,URL
FROM XIT_PROGRM_LIST
WHERE 1=1
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(pgrmFileNm)">AND PGRM_FILE_NM = #{pgrmFileNm}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(progrmStreCours)">AND PROGRM_STRE_COURS = #{progrmStreCours}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(progrmKoreanNm)">AND PROGRM_KOREAN_NM = #{progrmKoreanNm}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(dscrp)">AND DSCRP = #{dscrp}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(url)">AND URL = #{url}</if>
</select>
<select id="findXitProgrmList" resultType="cokr.xit.fims.framework.biz.cmm.ProgrmListVO">
/** findXitProgrmList */
/** 프로그램목록 조회 */
SELECT PGRM_FILE_NM
,PROGRM_STRE_COURS
,PROGRM_KOREAN_NM
,DSCRP
,URL
FROM XIT_PROGRM_LIST
WHERE 1=1
AND PGRM_FILE_NM = #{pgrmFileNm}
</select>
<insert id="addXitProgrmList">
/** addXitProgrmList */
/** 프로그램목록 등록 */
INSERT INTO XIT_PROGRM_LIST(
pgrm_file_nm
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(progrmStreCours)">,PROGRM_STRE_COURS</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(progrmKoreanNm)">,PROGRM_KOREAN_NM </if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(dscrp)">,DSCRP </if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(url)">,URL </if>
)VALUES(
#{pgrmFileNm}
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(progrmStreCours)">,#{progrmStreCours}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(progrmKoreanNm)">,#{progrmKoreanNm}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(dscrp)">,#{dscrp}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(url)">,#{url}</if>
)
</insert>
<update id="modifyXitProgrmList">
/** modifyXitProgrmList */
/** 프로그램목록 수정 */
UPDATE XIT_PROGRM_LIST
SET
PROGRM_KOREAN_NM = IFNULL(#{progrmKoreanNm}, PROGRM_KOREAN_NM)
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notBlank(progrmStreCours)">,PROGRM_STRE_COURS = #{progrmStreCours}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notBlank(dscrp)">,DSCRP = #{dscrp}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notBlank(url)">,URL = #{url}</if>
WHERE 1=1
AND pgrm_file_nm = #{pgrmFileNm}
</update>
<delete id="removeXitProgrmList">
/** removeXitProgrmList */
/** 프로그램목록 삭제 */
DELETE FROM XIT_PROGRM_LIST
WHERE 1=1
AND pgrm_file_nm = #{pgrmFileNm}
</delete>
<select id="findXitRoleInfos" resultType="cokr.xit.fims.framework.biz.mng.auth.XitRoleInfoVO">
/** findXitRoleInfos */
/** 역할정보 다건 조회 */
SELECT ROLE_CODE
,ROLE_NM
,ROLE_PTTRN
,DSCRP
,ROLE_TY
,ROLE_SORT
,ROLE_CREAT_DE
FROM XIT_ROLE_INFO
WHERE 1=1
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(roleCode)">AND ROLE_CODE = #{roleCode}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(roleNm)">AND ROLE_NM = #{roleNm}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(rolePttrn)">AND ROLE_PTTRN = #{rolePttrn}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(dscrp)">AND DSCRP = #{dscrp}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(roleTy)">AND ROLE_TY = #{roleTy}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(roleSort)">AND ROLE_SORT = #{roleSort}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(roleCreatDe)">AND ROLE_CREAT_DE =
#{roleCreatDe}
</if>
</select>
<select id="findXitRoleInfo" resultType="cokr.xit.fims.framework.biz.mng.auth.XitRoleInfoVO">
/** findXitRoleInfo */
/** 역할정보 조회 */
SELECT ROLE_CODE
,ROLE_NM
,ROLE_PTTRN
,DSCRP
,ROLE_TY
,ROLE_SORT
,ROLE_CREAT_DE
FROM XIT_ROLE_INFO
WHERE 1=1
AND ROLE_CODE = #{roleCode}
</select>
<insert id="addXitRoleInfo">
/** addXitRoleInfo */
/** 역할정보 등록 */
INSERT INTO XIT_ROLE_INFO(
ROLE_CODE
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(roleNm)">,ROLE_NM </if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(rolePttrn)">,ROLE_PTTRN </if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(dscrp)">,DSCRP </if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(roleTy)">,ROLE_TY </if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(roleSort)">,ROLE_SORT </if>
,ROLE_CREAT_DE
)VALUES(
#{roleCode}
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(roleNm)">,#{roleNm}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(rolePttrn)">,#{rolePttrn}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(dscrp)">,#{dscrp}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(roleTy)">,#{roleTy}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(roleSort)">,#{roleSort}</if>
,DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
)
</insert>
<update id="modifyXitRoleInfo">
/** modifyXitRoleInfo */
/** 역할정보 수정 */
UPDATE XIT_ROLE_INFO
SET
ROLE_NM = IFNULL(#{roleNm}, ROLE_NM)
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notBlank(rolePttrn)">,ROLE_PTTRN = #{rolePttrn}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notBlank(dscrp)">,DSCRP = #{dscrp}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notBlank(roleTy)">,ROLE_TY = #{roleTy}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notBlank(roleSort)">,ROLE_SORT = #{roleSort}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notBlank(roleCreatDe)">,ROLE_CREAT_DE = #{roleCreatDe}</if>
WHERE 1=1
AND ROLE_CODE = #{roleCode
</update>
<delete id="removeXitRoleInfo">
/** removeXitRoleInfo */
/** 역할정보 삭제 */
DELETE FROM XIT_ROLE_INFO
WHERE 1=1
AND ROLE_CODE = #{roleCode}
</delete>
<select id="findXitRoleSclsrtRescues" resultType="cokr.xit.fims.framework.biz.mng.auth.XitRoleSclsrtRescueVO">
/** findXitRoleSclsrtRescues */
/** 역할계층구조 다건 조회 */
SELECT PARNTS_ROLE
,CHLDRN_ROLE
FROM XIT_ROLE_SCLSRT_RESCUE
WHERE 1=1
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(parntsRole)">AND PARNTS_ROLE = #{parntsRole}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(chldrnRole)">AND CHLDRN_ROLE = #{chldrnRole}</if>
</select>
<select id="findXitRoleSclsrtRescue" resultType="cokr.xit.fims.framework.biz.mng.auth.XitRoleSclsrtRescueVO">
/** findXitRoleSclsrtRescue */
/** 역할계층구조 조회 */
SELECT PARNTS_ROLE
,CHLDRN_ROLE
FROM XIT_ROLE_SCLSRT_RESCUE
WHERE 1=1
AND PARNTS_ROLE = #{parntsRole}
AND CHLDRN_ROLE = #{chldrnRole}
</select>
<insert id="addXitRoleSclsrtRescue">
/** addXitRoleSclsrtRescue */
/** 역할계층구조 등록 */
INSERT INTO XIT_ROLE_SCLSRT_RESCUE(
PARNTS_ROLE
,CHLDRN_ROLE
)VALUES(
#{parntsRole}
,#{chldrnRole}
)
</insert>
<update id="modifyXitRoleSclsrtRescue">
/** modifyXitRoleSclsrtRescue */
/** 역할계층구조 수정 */
<!-- UPDATE XIT_ROLE_SCLSRT_RESCUE -->
<!-- SET -->
<!-- WHERE 1=1 -->
<!-- AND PARNTS_ROLE = #{parntsRole} -->
<!-- AND CHLDRN_ROLE = #{chldrnRole} -->
</update>
<delete id="removeXitRoleSclsrtRescue">
/** removeXitRoleSclsrtRescue */
/** 역할계층구조 삭제 */
DELETE FROM XIT_ROLE_SCLSRT_RESCUE
WHERE 1=1
AND PARNTS_ROLE = #{parntsRole}
AND CHLDRN_ROLE = #{chldrnRole}
</delete>
<delete id="removesXitRoleSclsrtRescue">
/** removesXitRoleSclsrtRescue */
/** 역할계층구조 다건 삭제 */
DELETE FROM XIT_ROLE_SCLSRT_RESCUE
WHERE 1=1
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(parntsRole)">AND PARNTS_ROLE = #{parntsRole}</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(chldrnRole)">AND CHLDRN_ROLE = #{chldrnRole}</if>
</delete>
<select id="findXitSysLogSumrys" resultType="cokr.xit.fims.framework.biz.cmm.XitSysLogSumryVO">
/** findXitSysLogSumrys */
@ -2526,7 +2147,7 @@
/** addXitUserScrtySetup */
/** 사용자보안설정 등록 */
INSERT
INTO xit_user_scrty_setup (
INTO tb_auth_user (
USER_ID
, auth_Id
) VALUES (

@ -2,86 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cokr.xit.fims.framework.biz.cmm.dao.XitFrameUnitMapper">
<sql id="menuTree">
WITH recursive TREE_QUERY(MENU_ID, PARNT_MENU_ID, MENU_NAME, MENU_FULL_PATH, MENU_FULL_PATH_NAME, MENU_DEPTH) AS
(
SELECT
A.MENU_NO AS "MENU_ID"
, A.prnt_no AS "PARNT_MENU_ID"
, A.MENU_NM AS "MENU_NAME"
, CONCAT('',A.MENU_NO) AS "MENU_FULL_PATH"
, CONCAT('',A.MENU_NM) AS "MENU_FULL_PATH_NAME"
, 1 AS "MENU_DEPTH"
FROM tb_menu A
INNER JOIN XIT_PROGRM_LIST B ON A.pgrm_file_nm=B.pgrm_file_nm
WHERE A.prnt_no = 0
UNION ALL
SELECT
A.MENU_NO AS "MENU_ID"
, A.prnt_no AS "PARNT_MENU_ID"
, A.MENU_NM AS "MENU_NAME"
, CONCAT(B.MENU_FULL_PATH,'_',A.MENU_NO) AS "MENU_FULL_PATH"
, CONCAT(B.MENU_FULL_PATH_NAME,' > ',A.MENU_NM) AS "MENU_FULL_PATH_NAME"
, B.MENU_DEPTH+1 AS "MENU_DEPTH"
FROM tb_menu A
INNER JOIN TREE_QUERY B ON A.prnt_no = B.MENU_ID
WHERE B.MENU_ID != 0
)
</sql>
<select id="findMenuListByUser" resultType="java.util.Map">
/** XitFrameUnitMapper.findMenuListByUser */
/** 사용자별 메뉴 목록 조회 */
<include refid="menuTree"/>
SELECT
D.MENU_ID AS "menuSid"
,D.MENU_NAME AS "menuName"
,(SELECT CASE SA.URL WHEN '/' THEN '#' ELSE SA.URL END FROM XIT_PROGRM_LIST SA WHERE B.pgrm_file_nm = SA.pgrm_file_nm) AS "menuView"
,D.MENU_DEPTH AS "menuDepth"
,D.PARNT_MENU_ID AS "parentSid"
,D.MENU_FULL_PATH AS "menuPath"
,D.MENU_FULL_PATH_NAME AS "menuPathname"
,'' AS "superYn"
,(SELECT COUNT(1) FROM TREE_QUERY SA WHERE SA.PARNT_MENU_ID=D.MENU_ID) AS "childCnt"
FROM XIT_MENU_CREAT_DTLS A
INNER JOIN tb_menu B ON A.MENU_NO = B.MENU_NO
INNER JOIN (SELECT FA.auth_Id, FA.USER_ID
FROM TB_AUTH_USER FA
WHERE FA.USER_ID = #{uniqId}
) C ON A.auth_Id = C.auth_Id
INNER JOIN TREE_QUERY D ON B.MENU_NO=D.MENU_ID
WHERE 1=1
<!-- 2020.11.05. 박민규 - tb_menu.srt_ord의 설정값대로 정렬이 되지 않아 수정 함 (MENU_NO를 PARNT_MENU_ID로 변경) -->
<!-- ORDER BY B.MENU_NO, B.srt_ord -->
ORDER BY D.PARNT_MENU_ID, B.srt_ord
</select>
<select id="findMenuListByAuthId" resultType="java.util.Map">
/** XitFrameUnitMapper.findMenuListByAuthId */
/** 권한코드별 메뉴 목록 조회 */
<include refid="menuTree"/>
SELECT
D.MENU_ID AS "menuSid"
,D.MENU_NAME AS "menuName"
,(SELECT CASE SA.URL WHEN '/' THEN '#' ELSE SA.URL END FROM XIT_PROGRM_LIST SA WHERE B.pgrm_file_nm = SA.pgrm_file_nm) AS "menuView"
,D.MENU_DEPTH AS "menuDepth"
,D.PARNT_MENU_ID AS "parentSid"
,D.MENU_FULL_PATH AS "menuPath"
,D.MENU_FULL_PATH_NAME AS "menuPathname"
,'' AS "superYn"
,(SELECT COUNT(1) FROM TREE_QUERY SA WHERE SA.PARNT_MENU_ID=D.MENU_ID) AS "childCnt"
FROM XIT_MENU_CREAT_DTLS A
INNER JOIN tb_menu B ON A.MENU_NO = B.MENU_NO
INNER JOIN TREE_QUERY D ON B.MENU_NO=D.MENU_ID
WHERE 1=1
AND A.auth_Id=#{authId}
<!-- 2020.11.05. 박민규 - tb_menu.srt_ord의 설정값대로 정렬이 되지 않아 수정 함 (MENU_NO를 PARNT_MENU_ID로 변경) -->
<!-- ORDER BY B.MENU_NO, B.srt_ord -->
ORDER BY D.PARNT_MENU_ID, B.srt_ord
</select>
<select id="findMaxFileSn" resultType="int">

@ -1,66 +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.framework.biz.cmm.dao.XitMainMapper">
<select id="findMainMenuHeads" resultType="cokr.xit.fims.framework.core.XitMenuManageVO">
/** findMainMenuHeads */
/** 화면 상단 메뉴목록 조회 */
SELECT
B.MENU_NO AS "menuNo"
,B.srt_ord AS "srtOrd"
,B.MENU_NM AS "menuNm"
,B.prnt_no AS "prntNo"
,B.dscrp AS "dscrp"
,B.img_cnf AS "relateImagePath"
,B.img_nm AS "imgNm"
,B.pgrm_file_nm AS "pgrmFileNm"
,(SELECT SA.URL FROM XIT_PROGRM_LIST SA WHERE B.pgrm_file_nm = SA.pgrm_file_nm) AS "chkURL"
,C.USER_ID
FROM XIT_MENU_CREAT_DTLS A
INNER JOIN tb_menu B ON A.MENU_NO = B.MENU_NO
INNER JOIN (SELECT FA.auth_Id, FA.USER_ID
FROM TB_AUTH_USER FA
WHERE FA.USER_ID = #{tmpUniqId}
) C ON A.auth_Id = C.auth_Id
WHERE 1=1
AND B.MENU_NO &gt; 0
AND B.prnt_no = 0
ORDER BY B.srt_ord
</select>
<select id="findtMainMenuLefts" resultType="cokr.xit.fims.framework.core.XitMenuManageVO">
/** findtMainMenuLefts */
/** 화면 좌측 메뉴목록 조회 */
SELECT
B.MENU_NO AS "menuNo"
,B.srt_ord AS "srtOrd"
,B.MENU_NM AS "menuNm"
,B.prnt_no AS "prntNo"
,B.img_cnf AS "relateImagePath"
,B.img_nm AS "imgNm"
,(SELECT SA.URL FROM XIT_PROGRM_LIST SA WHERE B.pgrm_file_nm = SA.pgrm_file_nm) AS "chkURL"
FROM XIT_MENU_CREAT_DTLS A
INNER JOIN tb_menu B ON A.MENU_NO = B.MENU_NO
INNER JOIN (SELECT FA.auth_Id, FA.USER_ID
FROM TB_AUTH_USER FA
WHERE FA.USER_ID = #{tmpUniqId}
) C ON A.auth_Id = C.auth_Id
WHERE 1=1
ORDER BY B.srt_ord
</select>
<select id="findMenuPath" resultType="String">
SELECT A.ACTION
FROM tb_menu A
WHERE A.MENU_NO = #{menuNo}
</select>
<select id="findMenuPath2" resultType="String">
SELECT A.ACTION
FROM tb_menu A
, XIT_PROGRM_LIST B
WHERE A.pgrm_file_nm = B.pgrm_file_nm
AND B.pgrm_file_nm = #{pgmId}
</select>
</mapper>

@ -1,165 +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.framework.biz.mng.auth.dao.AuthAuthorMgtMapper">
<!-- *************************************************************************************************************
* TB_AUTHORITY : 권한 정보
************************************************************************************************************** -->
<sql id="sqlAuthorInfo">
SELECT auth_Id
, AUTH_NM
, dscrp
, REG_DT
FROM TB_AUTHORITY
<where>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(authId)">
AND auth_Id = #{authId}
</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(authNm)">
AND INSTR(AUTH_NM, #{authNm}) > 0
</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(dscrp)">
AND INSTR(dscrp, #{dscrp}) > 0
</if>
</where>
</sql>
<select id="selectAuthorInfos" resultType="cokr.xit.fims.framework.biz.mng.auth.XitAuthorInfoVO">
/* auth-author-mysql-mapper|selectAuthorInfos-권한 목록 조회|julim */
<include refid="sqlAuthorInfo"/>
ORDER BY REG_DT DESC
</select>
<select id="selectAuthorInfo" resultType="cokr.xit.fims.framework.biz.mng.auth.XitAuthorInfoVO">
/* auth-author-mysql-mapper|selectAuthorInfo-권한 정보 조회|julim */
<include refid="sqlAuthorInfo"/>
</select>
<insert id="insertAuthorInfo" parameterType="cokr.xit.fims.framework.biz.mng.auth.XitAuthorInfoVO">
/* auth-author-mysql-mapper|insertAuthorInfo-권한 정보 등록|julim */
INSERT INTO TB_AUTHORITY (
auth_Id
, AUTH_NM
, dscrp
, REG_DT
) VALUES (
#{authId}
,#{authNm}
,#{dscrp}
,DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
)
</insert>
<update id="updateAuthorInfo" parameterType="cokr.xit.fims.framework.biz.mng.auth.XitAuthorInfoVO">
/* auth-author-mysql-mapper|updateAuthorInfos-권한 정보 변경|julim */
UPDATE TB_AUTHORITY
SET AUTH_NM = IF(AUTH_NM = #{authNm}, AUTH_NM, #{authNm})
, dscrp = IF(dscrp = #{dscrp}, dscrp, #{dscrp})
WHERE auth_Id = #{authId}
</update>
<delete id="deleteAuthorInfo" parameterType="cokr.xit.fims.framework.biz.mng.auth.XitAuthorInfoVO">
/* auth-author-mysql-mapper|deleteAuthorInfos-권한 정보 삭제|julim */
DELETE
FROM TB_AUTHORITY
WHERE auth_Id = #{authId}
</delete>
<select id="selectAuthRoleGrantList" resultType="cokr.xit.fims.framework.biz.mng.auth.XitRoleInfoVO">
/* auth-author-mysql-mapper|selectAuthRoleGrantList- 권한별 롤 조회|julim */
SELECT xri.role_code
, xri.role_nm
, xri.role_pttrn
, xri.dscrp
, xri.role_ty
, xri.role_sort
, DATE_FORMAT(arr.creat_dt, '%Y%m%d%H%i%s') AS creatDt
, IF(arr.role_code IS NULL, 'N', 'Y') AS "regYn"
FROM xit_role_info xri
LEFT OUTER JOIN ( SELECT auth_Id
, role_code
, creat_dt
FROM xit_author_role_relate
WHERE auth_Id = #{authId}
) arr
ON xri.role_code = arr.role_code
ORDER BY arr.role_code DESC, xri.role_sort
</select>
<delete id="deleteRoleGrant" parameterType="map">
/* auth-author-mysql-mapper|deleteRoleGrant-권한 롤 삭제|julim */
DELETE
FROM xit_author_role_relate
WHERE auth_Id = #{authId}
AND role_code = #{roleCode}
</delete>
<insert id="saveRoleGrant" parameterType="map">
/* auth-author-mysql-mapper|saveRoleGrant-권한 롤 등록|julim */
INSERT INTO xit_author_role_relate (
auth_Id
, role_code
, creat_dt
) VALUES (
#{authId}
, #{roleCode}
, NOW()
)
ON DUPLICATE KEY UPDATE
creat_dt = NOW()
</insert>
<!-- *************************************************************************************************************
* xit_role_sclsrt_rescue : 역할 계층 정보
************************************************************************************************************** -->
<select id="selectRoleSclsrtRescues" parameterType="cokr.xit.fims.framework.biz.mng.auth.XitRoleSclsrtRescueVO" resultType="cokr.xit.fims.framework.biz.mng.auth.XitRoleSclsrtRescueVO">
/* auth-author-mysql-mapper|selectRoleSclsrtRescues-역할계층 조회|julim */
SELECT parnts_role
, chldrn_role
FROM xit_role_sclsrt_rescue
<where>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(parntsRole)">
AND parnts_role = #{parntsRole}
</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(chldrnRole)">
AND chldrn_role = #{chldrnRole}
</if>
</where>
</select>
<select id="selectRoleSclsrtRescue" parameterType="cokr.xit.fims.framework.biz.mng.auth.XitRoleSclsrtRescueVO" resultType="cokr.xit.fims.framework.biz.mng.auth.XitRoleSclsrtRescueVO">
/* auth-author-mysql-mapper|selectRoleSclsrtRescue-역할계층 정보 조회|julim */
SELECT parnts_role
, chldrn_role
FROM xit_role_sclsrt_rescue
WHERE parnts_role = #{parntsRole}
AND chldrn_role = #{chldrnRole}
</select>
<insert id="insertRoleSclsrtRescue" parameterType="cokr.xit.fims.framework.biz.mng.auth.XitRoleSclsrtRescueVO">
/* auth-author-mysql-mapper|insertRoleSclsrtRescue-역할계층 정보 등록|julim */
INSERT
INTO xit_role_sclsrt_rescue(
parnts_role
, chldrn_role
)VALUES(
#{parntsRole}
, #{chldrnRole}
)
</insert>
<delete id="deleteRoleSclsrtRescue" parameterType="cokr.xit.fims.framework.biz.mng.auth.XitRoleSclsrtRescueVO">
/* auth-author-mysql-mapper|deleteRoleSclsrtRescue-역할계층 삭제 조회|julim */
DELETE
FROM xit_role_sclsrt_rescue
<where>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(parntsRole)">
AND parnts_role = #{parntsRole}
</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(chldrnRole)">
AND chldrn_role = #{chldrnRole}
</if>
</where>
</delete>
</mapper>

@ -19,7 +19,7 @@
, user_nm user_nm
, grp_id
FROM tb_user ) xui
LEFT OUTER JOIN xit_user_scrty_setup uss
LEFT OUTER JOIN tb_auth_user uss
ON xui.USER_ID = uss.USER_ID
LEFT OUTER JOIN tb_cmn_code cdc
ON cdc.grp_id = 'XIT012'

@ -1,70 +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.framework.biz.mng.auth.dao.AuthGrpMgtMapper">
<!-- *************************************************************************************************************
* xit_author_group_info : 권한그룹 정보
************************************************************************************************************** -->
<select id="selectAuthorGroupInfos" resultType="cokr.xit.fims.framework.biz.mng.auth.XitAuthorGroupInfoVO">
/* auth-grp-mysql-mapper|selectAuthorGroupInfos-권한그룹 목록 조회|julim */
SELECT agi.grp_id
, agi.group_nm
, agi.dscrp
, agi.auth_Id
, xai.AUTH_NM
, agi.group_creat_de
FROM xit_author_group_info agi
LEFT OUTER JOIN TB_AUTHORITY xai
ON agi.auth_Id = xai.auth_Id
<where>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(groupNm)">
AND agi.group_nm = #{groupNm}
</if>
</where>
</select>
<select id="selectAuthorGroupInfo" resultType="cokr.xit.fims.framework.biz.mng.auth.XitAuthorGroupInfoVO">
/* auth-grp-mysql-mapper|selectAuthorGroupInfo-권한그룹 정보 조회|julim */
SELECT grp_id
, group_nm
, dscrp
, auth_Id
, group_creat_de
FROM xit_author_group_info
WHERE grp_id = #{grpId}
</select>
<insert id="insertAuthorGroupInfo">
/* auth-grp-mysql-mapper|insertAuthorGroupInfo-권한그룹 등록|julim */
INSERT INTO xit_author_group_info(
grp_id
, group_nm
, dscrp
, auth_Id
, group_creat_de
)VALUES(
#{grpId}
, #{groupNm}
, #{dscrp}
, #{authId}
, DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
)
</insert>
<update id="updateAuthorGroupInfo">
/* auth-grp-mysql-mapper|updateAuthorGroupInfo-권한그룹 정보 변경|julim */
UPDATE xit_author_group_info
SET group_nm = IF(group_nm = #{groupNm}, group_nm, #{groupNm})
, dscrp = IF(dscrp = #{dscrp}, dscrp, #{dscrp})
, auth_Id = IF(auth_Id = #{authId}, auth_Id, #{authId})
WHERE grp_id = #{grpId}
</update>
<delete id="deleteAuthorGroupInfo">
/* auth-grp-mysql-mapper|deleteAuthorGroupInfo-권한그룹 삭제|julim */
DELETE
FROM xit_author_group_info
WHERE grp_id = #{grpId}
</delete>
</mapper>

@ -1,81 +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.framework.biz.mng.auth.dao.AuthRoleMgtMapper">
<!-- *************************************************************************************************************
* xit_role_info : 롤(역할) 정보
************************************************************************************************************** -->
<sql id="sqlRoleInfo">
SELECT role_code
, role_nm
, role_pttrn
, dscrp
, role_ty
, role_sort
, role_creat_de
FROM xit_role_info
<where>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(roleCode)">
AND role_code = #{roleCode}
</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(roleNm)">
AND INSTR(role_nm, #{roleNm}) > 0
</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(roleTy)">
AND role_ty = #{roleTy}
</if>
</where>
</sql>
<select id="selectAuthRoles" parameterType="map" resultType="cokr.xit.fims.framework.biz.mng.auth.XitAuthRuleMngVO">
/* auth-role-mysql-mapper|selectAuthRoles-롤목록 조회|julim */
<include refid="sqlRoleInfo"/>
</select>
<select id="selectAuthRole" resultType="cokr.xit.fims.framework.biz.mng.auth.XitRoleInfoVO">
/* auth-role-mysql-mapper|selectAuthRole-롤 정보 조회|julim */
<include refid="sqlRoleInfo"/>
</select>
<insert id="insertAuthRole" parameterType="cokr.xit.fims.framework.biz.mng.auth.XitRoleInfoVO">
/* auth-role-mysql-mapper|insertAuthRole-롤 정보 등록|julim */
INSERT
INTO xit_role_info (
role_code
, role_nm
, role_pttrn
, dscrp
, role_ty
, role_sort
, role_creat_de
) VALUES (
#{roleCode}
, #{roleNm}
, #{rolePttrn}
, #{dscrp}
, #{roleTy}
, #{roleSort}
, DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
)
</insert>
<update id="updateAuthRole" parameterType="cokr.xit.fims.framework.biz.mng.auth.XitRoleInfoVO">
/* auth-role-mysql-mapper|updateAuthRole-롤 정보 변경|julim */
UPDATE xit_role_info
SET role_nm = IF(role_nm = #{roleNm}, role_nm, #{roleNm})
, role_pttrn = IF(role_pttrn = #{rolePttrn}, role_pttrn, #{rolePttrn})
, dscrp = IF(dscrp = #{dscrp}, dscrp, #{dscrp})
, role_ty = IF(role_ty = #{roleTy}, role_ty, #{roleTy})
, role_sort = IF(role_sort = #{roleSort}, role_sort, #{roleSort})
WHERE role_code = #{roleCode}
</update>
<delete id="deleteAuthRole" parameterType="string">
/* auth-role-mysql-mapper|deleteAuthRole-롤 정보 삭제|julim */
DELETE
FROM xit_role_info
WHERE role_code = #{roleCode}
</delete>
</mapper>

@ -1,80 +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.framework.biz.mng.menu.dao.MenuByRoleMgtMapper">
<!-- *************************************************************************************************************
* TB_AUTHORITY : 권한 정보
************************************************************************************************************** -->
<sql id="sqlAuthorInfo">
SELECT xai.auth_Id
, xai.AUTH_NM
, xai.dscrp
, xai.REG_DT
, (SELECT COUNT(auth_Id)
FROM xit_menu_creat_dtls
WHERE xai.auth_Id = auth_Id ) AS chkYeoBu
FROM TB_AUTHORITY xai
<where>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(authId)">
AND INSTR(xai.auth_Id, #{authId})
</if>
</where>
</sql>
<select id="selectRoleInfos" resultType="cokr.xit.fims.framework.biz.mng.menu.MenuCreateMngVO">
/* menu-by-role-mysql-mapper|selectRoleInfos-권한 목록 조회|julim */
<include refid="sqlAuthorInfo"/>
</select>
<select id="selectRoleInfo" resultType="cokr.xit.fims.framework.biz.mng.menu.MenuCreateMngVO">
/* menu-by-role-mysql-mapper|selectRoleInfo-권한 정보 조회|julim */
<include refid="sqlAuthorInfo"/>
</select>
<!-- *************************************************************************************************************
* tb_menu : 메뉴 정보
************************************************************************************************************** -->
<select id="selectMenuInfoByRoleList" resultType="cokr.xit.fims.framework.biz.mng.menu.MenuCreateMngVO">
/* menu-by-role-mysql-mapper|selectMenuInfoByRoleList-권한별 메뉴 목록 조회|julim */
SELECT
A.menu_no
, A.srt_ord
, A.menu_nm
, A.prnt_no
, (SELECT count(B.menu_no)
FROM xit_menu_creat_dtls B
WHERE B.menu_no = A.menu_no
AND B.auth_Id = #{authId}) AS chkYeoBu
FROM tb_menu A
WHERE A.menu_no &gt; 0
ORDER BY A.srt_ord
</select>
<!-- *************************************************************************************************************
* xit_menu_creat_dtls : 권한별 메뉴
************************************************************************************************************** -->
<delete id="deleteMenuCreatDtls">
/* menu-by-role-mysql-mapper|deleteMenuCreatDtls-권한별 메뉴 삭제|julim */
DELETE
FROM xit_menu_creat_dtls
WHERE auth_Id = #{authId}
</delete>
<insert id="insertMenuCreatDtls">
/* menu-by-role-mysql-mapper|insertMenuCreatDtls-권한별 메뉴 등록|julim */
INSERT
INTO xit_menu_creat_dtls (
menu_no
, auth_Id
, mapng_creat_id
) VALUES (
#{menuNo}
, #{authId}
, #{mapngCreatId}
)
</insert>
</mapper>

@ -44,7 +44,7 @@
<select id="selectMenuCreatDtls" resultType="cokr.xit.fims.framework.biz.mng.menu.XitMenuInfoVO">
/* menu-mysql-mapper|selectMenuCreatDtls-메뉴생성내역 권한 데이터 조회|julim */
SELECT menu_no
FROM xit_menu_creat_dtls
FROM tb_menu
<where>
AND menu_no = #{menuNo}
</where>
@ -107,7 +107,7 @@
<delete id="deleteMenuCreatDtlsList">
/* menu-mysql-mapper|deleteMenuCreatDtlsList-메뉴생성내역 권한 데이터 삭제|julim */
DELETE
FROM xit_menu_creat_dtls
FROM tb_menu
WHERE menu_no = #{menuNo}
</delete>
@ -115,7 +115,7 @@
<delete id="deleteAllMenuCreatDtlsList">
/* menu-mysql-mapper|deleteAllMenuCreatDtlsList-메뉴생성내역 전체데이터 삭제|julim */
DELETE
FROM xit_menu_creat_dtls
FROM tb_menu
</delete>
@ -144,10 +144,7 @@
, A.srt_ord AS "srtOrd"
, A.MENU_NM AS "menuNm"
, A.prnt_no AS "prntNo"
, (SELECT count(B.MENU_NO)
FROM XIT_MENU_CREAT_DTLS B
WHERE B.MENU_NO = A.MENU_NO
AND B.auth_Id = #{authId}) AS "chkYeoBu"
, '' AS "chkYeoBu"
FROM tb_menu A
WHERE A.MENU_NO &gt; 0
ORDER BY A.srt_ord

@ -1,70 +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.framework.biz.mng.menu.dao.ProgramMgtMapper">
<!-- *************************************************************************************************************
* xit_progrm_list : 프로그램 정보
************************************************************************************************************** -->
<sql id="sqlProgram">
SELECT pgrm_file_nm
, progrm_stre_cours
, progrm_stre_cours AS progrmStrePath
, progrm_korean_nm
/*, CONCAT(SUBSTRING(dscrp, 10, 1),'...') AS dscrp -->*/
, dscrp
, url
FROM xit_progrm_list
</sql>
<select id="selectPrograms" resultType="cokr.xit.fims.framework.biz.mng.menu.ProgramMngVO">
/* program-mysql-mapper|selectPrograms-프로그램 목록 조회|julim */
<include refid="sqlProgram"/>
<where>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(progrmKoreanNm)">
AND INSTR(progrm_korean_nm, #{progrmKoreanNm}) > 0
</if>
</where>
</select>
<select id="selectProgram" parameterType="string" resultType="cokr.xit.fims.framework.biz.mng.menu.ProgramMngVO">
/* program-mysql-mapper|selectProgram-프로그램 정보 조회|julim */
<include refid="sqlProgram"/>
WHERE pgrm_file_nm = #{pgrmFileNm}
</select>
<insert id="insertProgram" parameterType="cokr.xit.fims.framework.biz.mng.menu.ProgramMngVO">
/* program-mysql-mapper|insertProgram-프로그램 등록|julim */
INSERT
INTO xit_progrm_list(
pgrm_file_nm
, progrm_stre_cours
, progrm_korean_nm
, dscrp
, url
) VALUES (
#{pgrmFileNm}
, #{progrmStrePath}
, #{progrmKoreanNm}
, #{dscrp}
, #{URL}
)
</insert>
<update id="updateProgram" parameterType="cokr.xit.fims.framework.biz.mng.menu.ProgramMngVO">
/* program-mysql-mapper|updateProgram-프로그램 정보 변경|julim */
UPDATE xit_progrm_list
SET progrm_korean_nm = #{progrmKoreanNm}
, progrm_stre_cours = #{progrmStrePath}
, dscrp = #{dscrp}
, url = #{URL}
WHERE pgrm_file_nm = #{pgrmFileNm}
</update>
<delete id="deleteProgram" parameterType="string">
/* program-mysql-mapper|deleteProgram-프로그램 정보 삭제|julim */
DELETE
FROM xit_progrm_list
WHERE pgrm_file_nm = #{pgrmFileNm}
</delete>
</mapper>

@ -179,46 +179,16 @@
<!-- *************************************************************************************************************
* xit_author_group_info : 권한그룹 정보
************************************************************************************************************** -->
<select id="selectAuthorGroupInfo" parameterType="map" resultType="caseMap">
/* user-mysql-mapper|selectAuthorGroupInfo-권한그룹정보 조회|julim */
SELECT grp_id
, group_nm
, group_creat_de
, dscrp
, auth_Id
FROM xit_author_group_info
<where>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(grpId)">
AND grp_id = #{grpId}
</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(groupNm)">
AND group_nm = #{groupNm}
</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(groupCreatDe)">
AND group_creat_de = #{groupCreatDe}
</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(dscrp)">
AND dscrp = #{dscrp}
</if>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(authId)">
AND auth_Id = #{authId}
</if>
</where>
</select>
<!-- *************************************************************************************************************
* xit_user_scrty_setup : 사용자 보안 설정
* 사용자 보안 설정
************************************************************************************************************** -->
<select id="selectUserScrtySetups" parameterType="cokr.xit.fims.framework.biz.mng.user.XitUserScrtySetupVO" resultType="cokr.xit.fims.framework.biz.mng.user.XitUserScrtySetupVO">
/* user-mysql-mapper|selectUserScrtySetups-사용자보안설정 목록 조회|julim */
SELECT USER_ID
, auth_Id
FROM xit_user_scrty_setup
FROM tb_auth_user
<where>
<if test="@cokr.xit.fims.framework.core.utils.XitCmmnUtil@notEmpty(userId)">
AND USER_ID = #{userId}
@ -233,14 +203,14 @@
/* user-mysql-mapper|selectUserScrtySetup-사용자보안설정 조회|julim */
SELECT USER_ID
, auth_Id
FROM xit_user_scrty_setup
FROM tb_auth_user
WHERE USER_ID = #{userId}
</select>
<insert id="insertUserScrtySetup" parameterType="cokr.xit.fims.framework.biz.mng.user.XitUserScrtySetupVO">
/* user-mysql-mapper|insertUserScrtySetup-사용자보안설정 등록|julim */
INSERT
INTO xit_user_scrty_setup (
INTO tb_auth_user (
USER_ID
, auth_Id
) VALUES (
@ -251,7 +221,7 @@
<update id="updateUserScrtySetup" parameterType="cokr.xit.fims.framework.biz.mng.user.XitUserScrtySetupVO">
/* user-mysql-mapper|updateUserScrtySetup-사용자보안설정 변경|julim */
UPDATE xit_user_scrty_setup
UPDATE tb_auth_user
SET auth_Id = IF(auth_Id = #{authId}, auth_Id, #{authId})
WHERE USER_ID = #{userId}
</update>
@ -259,7 +229,7 @@
<delete id="deleteUserScrtySetup" parameterType="string">
/* user-mysql-mapper|deleteUserScrtySetup-사용자보안설정 삭제|julim */
DELETE
FROM xit_user_scrty_setup
FROM tb_auth_user
WHERE USER_ID = #{userId}
</delete>

Loading…
Cancel
Save