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

import com.its.op.entity.its.facility.TbFcltSttsAlrmStup;
import com.its.op.entity.its.facility.TbFcltSttsAlrmStupKey;
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 TbFcltSttsAlrmStupRepository extends JpaRepository<TbFcltSttsAlrmStup, TbFcltSttsAlrmStupKey>, JpaSpecificationExecutor<TbFcltSttsAlrmStup> {

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

    @Query("select p from TbFcltSttsAlrmStup p")
    List<TbFcltSttsAlrmStup> findAllList();

    @Query("select p from TbFcltSttsAlrmStup p where p.fcltType = :fcltType")
    List<TbFcltSttsAlrmStup> findListById(@Param("fcltType") String fcltType);

    @Query("select p from TbFcltSttsAlrmStup p where p.useYn = 'Y'")
    List<TbFcltSttsAlrmStup> findAllListUsed();

}
