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

import com.its.op.entity.its.code.TbSectGradStup;
import com.its.op.entity.its.code.TbSectGradStupKey;
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 TbSectGradStupRepository extends JpaRepository<TbSectGradStup, TbSectGradStupKey>, JpaSpecificationExecutor<TbSectGradStup> {

    @Query(value = "select p from TbSectGradStup p inner join fetch p.sect")
    List<TbSectGradStup> findAll();

    @Query(value = "select p from TbSectGradStup p inner join fetch p.sect where p.sectGradCd = :sectGradCd")
    List<TbSectGradStup> findAllGradeList(@Param("sectGradCd") String sectGradCd);
}
