package com.cirle.scientific.dao;


import com.cirle.scientific.po.QkjCatalogs;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface QkjCatalogsDao extends PagingAndSortingRepository<QkjCatalogs, Long>, JpaSpecificationExecutor<QkjCatalogs> {

    @Query(value = "select * from qkj_catalogs where fu_id = ?1 order by sqn asc", nativeQuery = true)
    List<QkjCatalogs> findByFuId(int fuId);

    @Query(value = "select * from qkj_catalogs", nativeQuery = true)
    List<QkjCatalogs> findAll();

    @Query(value = "select description from qkj_catalogs where id = ?1 ", nativeQuery = true)
    String findById(Integer id);
}
