feat: 권한관리 - AuthRole 진행

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save