package com.its.op.dao.repository.its.cctv;

import com.its.op.entity.its.cctv.TbCctvPset;
import com.its.op.entity.its.cctv.TbCctvPsetKey;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
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 TbCctvPsetRepository extends JpaRepository<TbCctvPset, TbCctvPsetKey>, JpaSpecificationExecutor<TbCctvPset> {

    @Query("select p from TbCctvPset p")
    List<TbCctvPset> findAll();

    @Query("select p from TbCctvPset p where p.cctvCtlrNmbr = :cctvCtlrNmbr")
    List<TbCctvPset> findListById(@Param("cctvCtlrNmbr") Long cctvCtlrNmbr);
}
