package com.ga.core.mapper.attachment;

import com.ga.core.vo.attachment.AttachmentResp;
import com.ga.core.vo.attachment.AttachmentSearchParam;
import com.ga.core.vo.attachment.AttachmentVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AttachmentMapper {
    AttachmentResp selectById(@Param("attachmentId") Long attachmentId);
    /** ref_type + ref_id 기준 첨부 목록 — 도메인별 첨부 조회 핵심 메서드 */
    List<AttachmentResp> selectByRef(@Param("refType") String refType, @Param("refId") Long refId);
    List<AttachmentResp> selectList(AttachmentSearchParam param);
    int insert(AttachmentVO vo);
    int delete(@Param("attachmentId") Long attachmentId);
    /** ref_type + ref_id 전체 삭제 — 레코드 삭제 시 연동 */
    int deleteByRef(@Param("refType") String refType, @Param("refId") Long refId);
}
