package incheon.ags.ias.tmprUserAuthrt.mapper;

import incheon.ags.ias.tmprUserAuthrt.vo.TmprUserAuthrtMenuMpngVO;
import incheon.ags.ias.tmprUserAuthrt.vo.TmprUserAuthrtSearchVO;
import incheon.ags.ias.tmprUserAuthrt.vo.TmprUserAuthrtSysMpngVO;
import incheon.com.config.annotation.MainDB;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;

import java.util.List;
import java.util.Map;

@org.egovframe.rte.psl.dataaccess.mapper.Mapper @incheon.com.config.annotation.MainDB
public interface TmprUserAuthrtMapper {

    // 임시 사용자 권한 목록 조회
    List<Map<String, Object>> selectTmprUserAuthrtList(TmprUserAuthrtSearchVO searchVO) throws Exception;

    // 임시 사용자 권한 총 개수 조회
    int selectTmprUserAuthrtListTotCnt(TmprUserAuthrtSearchVO searchVO) throws Exception;

    // 임시 사용자 권한 상세 조회
    Map<String, Object> selectTmprUserAuthrtDetail(Map<String, Object> params) throws Exception;

    // 임시 사용자 메뉴 권한 매핑 목록 조회
    List<Map<String, Object>> selectTmprUserMenuAuthrtList(Map<String, Object> params) throws Exception;

    // 임시 사용자 시스템 권한 매핑 목록 조회
    List<Map<String, Object>> selectTmprUserSysAuthrtList(Map<String, Object> params) throws Exception;

    // 역할 목록 조회 (ROLETY999 고정)
    List<Map<String, Object>> selectRoleList() throws Exception;

    // 권한 목록 조회
    List<Map<String, Object>> selectAuthrtList(String sysCd) throws Exception;

    // 시스템 목록 조회
    List<Map<String, Object>> selectSysList() throws Exception;

    // 메뉴 목록 조회 (계층 구조)
    List<Map<String, Object>> selectMenuListBySysCd(String sysCd) throws Exception;

    // 메뉴별 할당 가능한 권한 목록 조회 - 추가
    List<Map<String, Object>> selectMenuAuthrtListBySysCd(String sysCd) throws Exception;

    // 시스템 전역 권한 목록 조회 - 추가
    List<Map<String, Object>> selectSysAuthrtListBySysCd(String sysCd) throws Exception;

    // 시스템 전역 권한 설정 목록 조회
    List<Map<String, Object>> selectSysAuthrtStngList(String sysCd) throws Exception;

    // 메뉴 권한 설정 목록 조회
    List<Map<String, Object>> selectMenuAuthrtStngList(String sysCd) throws Exception;

    // 권한 설정 등록 (AuthrtStngVO는 sysMenuAuthrt 패키지에서 재사용)
    int insertAuthrtStng(Map<String, Object> params) throws Exception;

    // 메뉴-역할-권한 매핑 등록
    int insertMenuRoleAuthrtMpng(TmprUserAuthrtMenuMpngVO tmprUserAuthrtMenuMpngVO) throws Exception;

    // 메뉴-역할-권한 매핑 삭제
    int deleteMenuRoleAuthrtMpng(Map<String, Object> params) throws Exception;

    // 시스템-역할-권한 매핑 등록
    int insertSysRoleAuthrtMpng(TmprUserAuthrtSysMpngVO tmprUserAuthrtSysMpngVO) throws Exception;

    // 시스템-역할-권한 매핑 삭제
    int deleteSysRoleAuthrtMpng(Map<String, Object> params) throws Exception;

    // 사용자 검색 (사용자 ID, 사용자명으로 검색)
    List<Map<String, Object>> searchUsers(Map<String, Object> params) throws Exception;

    int insertTmprUserAuthrt(Map<String, Object> params) throws Exception;

    // 사용자별 모든 임시 권한 삭제
    int deleteAllTmprUserAuthrtByUserId(String userId) throws Exception;

    // 사용자별 모든 메뉴 권한 매핑 삭제
    int deleteAllMenuRoleAuthrtMpngByUserId(String userId) throws Exception;

    // 사용자별 모든 시스템 권한 매핑 삭제
    int deleteAllSysRoleAuthrtMpngByUserId(String userId) throws Exception;

    // 사용자별 특정 시스템 임시 권한 삭제
    int deleteTmprUserAuthrtByUserIdAndRoleCd(String userId, String roleCd, String sysCd) throws Exception;

    // 사용자별 특정 시스템 메뉴 권한 매핑 삭제
    int deleteMenuRoleAuthrtMpngByUserIdAndRoleCd(String userId, String roleCd, String sysCd) throws Exception;

    // 사용자별 특정 시스템 시스템 권한 매핑 삭제
    int deleteSysRoleAuthrtMpngByUserIdAndRoleCd(String userId, String roleCd, String sysCd) throws Exception;
}