package com.crunii.micro.domain.repo.main;

import com.crunii.micro.domain.common.BaseRepo;
import com.crunii.micro.domain.entity.main.YcqActivityApplyRecord;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface YcqActivityApplyRecordRepo extends BaseRepo<YcqActivityApplyRecord, Long> {

    YcqActivityApplyRecord findByActivityIdAndCreateId(Long activityId, Integer loginId);

    @Modifying
    @Query(value = "UPDATE YCQ_ACTIVITY_APPLY_RECORD SET is_delete = 1 WHERE activity_id = ?1", nativeQuery = true)
    int deleteByActivityId(Long id);
}
