package com.its.api.its.repository.vms;

import com.its.api.its.model.entity.vms.TbVmsSymbIfsc;
import com.its.api.its.model.entity.vms.TbVmsSymbIfscKey;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TbVmsSymbIfscRepository extends JpaRepository<TbVmsSymbIfsc, TbVmsSymbIfscKey>, JpaSpecificationExecutor<TbVmsSymbIfsc> {

    @Query("select p from TbVmsSymbIfsc p where p.symbLibNmbr = :id")
    List<TbVmsSymbIfsc> findDataById(@Param("id") Integer id);

    @Modifying
    @Query("delete from TbVmsSymbIfsc p where p.symbLibNmbr = :id")
    void deleteDataById(@Param("id") Integer id);
}
