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

import com.its.op.entity.its.weather.TbAtmpPltnPnst;
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 TbAtmpPltnPnstRepository extends JpaRepository<TbAtmpPltnPnst, Long>, JpaSpecificationExecutor<TbAtmpPltnPnst> {

    @Query("select p from TbAtmpPltnPnst p inner join fetch p.atmp")
    List<TbAtmpPltnPnst> findAll();

    @Query("select p from TbAtmpPltnPnst p inner join fetch p.atmp m where m.delYn = 'N' and p.msrmDt >= to_char(sysdate-120/1440, 'YYYYMMDDHH24MISS')")
    List<TbAtmpPltnPnst> findAllList();
}
