package com.dbnt.faisp.main.faStatistics.internationalCrimeArrest.repository;

import com.dbnt.faisp.main.faStatistics.internationalCrimeArrest.model.SuspectPersonInfo;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


public interface SuspectPersonInfoRepository extends JpaRepository<SuspectPersonInfo, SuspectPersonInfo> {
    List<SuspectPersonInfo> findByIcaKey(Integer icaKey);
    @Transactional
    @Modifying
    @Query("delete from SuspectPersonInfo s where s.spiKey in :idList")
    void deleteAllByIdInQuery(@Param("idList") List<Integer> deleteKeyList);
}
