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

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

import java.util.List;

public interface YcqActivitySignRepo extends BaseRepo<YcqActivitySign, Long> {
    List<YcqActivitySign> findByIdIn(List<Long> ids);

    YcqActivitySign findByActivityId(Long id);
    List<YcqActivitySign> findByActivityIdIn(List<Long> ids);

    YcqActivitySign findByActivityIdAndSignType(Long activityId,Integer signType);

    @Modifying
    @Query(value = "UPDATE YCQ_ACTIVITY_SIGN SET is_delete = 1 WHERE activity_id = ?1", nativeQuery = true)
    void deleteByActivityId(Long activityId);
}
