package incheon.ags.pss.commission.mapper;

import incheon.ags.pss.commission.vo.ScAgndMstVO;
import incheon.ags.pss.commission.vo.ScCmtMstVO;
import incheon.ags.pss.project.vo.ProjectVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;

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

    // --- 위원회 (Committee) ---
    void insertCmtMst(ScCmtMstVO vo) throws Exception;
    void updateCmtMst(ScCmtMstVO vo) throws Exception;
    void deleteCmtMst(int cmtId) throws Exception;

    // 단건 조회
    ScCmtMstVO selectCmtMst(int cmtId) throws Exception;

    // 목록 조회 (페이징 + 검색)
    List<ScCmtMstVO> selectCmtMstList(ScCmtMstVO vo) throws Exception;

    // 총 갯수 조회 (페이징용)
    int selectCmtMstListCnt(ScCmtMstVO vo) throws Exception;

    // --- 안건 (Agenda) ---
    void insertAgndMst(ScAgndMstVO vo) throws Exception;
    void updateAgndMst(ScAgndMstVO vo) throws Exception;
    void deleteAgndMst(int agndId) throws Exception;

    // 안건 목록 조회
    List<ScAgndMstVO> selectAgndMstList(ScAgndMstVO vo) throws Exception;

    // 크롤링 갱신용 (특정 위원회의 특정 등록자 데이터 삭제)
    void deleteAgndByCmtIdAndRegId(@Param("cmtId") int cmtId, @Param("frstRegId") String frstRegId) throws Exception;

    // 위원회 삭제 시 하위 안건 전체 삭제
    void deleteAgndByCmtId(int cmtId) throws Exception;

    ScCmtMstVO selectCmtMstByCmtCdAndNmAndDt(ScCmtMstVO searchVO);

    void upsertComCd(Map<String, Object> params);

    // 안건 ID로 연결된 안건지도 목록 조회
    List<ProjectVO> selectProjectListByAgndId(int agndId) throws Exception;
}
