package com.dbnt.kcscbackend.admin.standardResearch.repository;

import com.dbnt.kcscbackend.admin.standardResearch.model.TnResearchLightweight;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;


public interface TnResearchRepositoryLightweight extends JpaRepository<TnResearchLightweight, Long> {
    @Query(value = "SELECT COUNT(1) FROM tn_research tr WHERE tr.use_yn = :use_yn", nativeQuery = true)
    Long countByUseYn(@Param("use_yn") String useYn);

    List<TnResearchLightweight> findByUseYn( String useYn, Pageable pageable);

}