package com.ga.common.code;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CommonCodeMapper {

    // 그룹
    List<CommonCodeGroupVO> selectGroupList(@Param("keyword") String keyword);
    CommonCodeGroupVO selectGroup(@Param("groupCode") String groupCode);
    int insertGroup(CommonCodeGroupVO vo);
    int updateGroup(CommonCodeGroupVO vo);
    int deleteGroup(@Param("groupCode") String groupCode);

    // 상세 코드
    List<CommonCodeVO> selectCodes(@Param("groupCode") String groupCode);
    List<CommonCodeVO> selectActiveCodes(@Param("groupCode") String groupCode);
    CommonCodeVO selectCode(@Param("codeId") Long codeId);
    CommonCodeVO selectByGroupAndCode(@Param("groupCode") String groupCode, @Param("code") String code);
    int insertCode(CommonCodeVO vo);
    int updateCode(CommonCodeVO vo);
    int deleteCode(@Param("codeId") Long codeId);
    int existsByGroupAndCode(@Param("groupCode") String groupCode, @Param("code") String code);
}
