package com.eactive.eai.rms.data.entity.onl.inflow;

import java.util.List;
import java.util.Optional;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.eactive.eai.data.entity.onl.inflow.InflowControlGroupMapping;
import com.eactive.eai.data.jpa.BaseRepository;

public interface InflowControlGroupMappingRepository extends BaseRepository<InflowControlGroupMapping, String> {

	List<InflowControlGroupMapping> findByGroupId(String groupId);

	@Modifying
	@Query("DELETE FROM InflowControlGroupMapping m WHERE m.groupId = :groupId")
	void deleteByGroupId(@Param("groupId") String groupId);

	/**
	 * 인터페이스 ID로 매핑 조회 (중복 체크용)
	 */
	Optional<InflowControlGroupMapping> findByInterfaceId(String interfaceId);
}
