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

import com.its.op.entity.its.unit.TbUnitSyst;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TbUnitSystRepository extends JpaRepository<TbUnitSyst, String>, JpaSpecificationExecutor<TbUnitSyst> {

    @Query("select p from TbUnitSyst p left outer join fetch p.state where p.sttsDsplYn = 'Y'")
    List<TbUnitSyst> findAll();

    @Query("select p from TbUnitSyst p left outer join fetch p.state where p.delYn = 'N' and p.sttsDsplYn = 'Y'")
    List<TbUnitSyst> findAllList();

    @Query("select p from TbUnitSyst p left outer join fetch p.state where p.delYn = 'N'")
    List<TbUnitSyst> findAllUnitSystList();
}
