package com.huimv.manage.eartag.dao.repo;

import com.huimv.manage.eartag.dao.entity.EtEarmarkEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface EarmarkRepo extends JpaRepository<EtEarmarkEntity, Integer>, JpaSpecificationExecutor<EtEarmarkEntity> {

    @Query(nativeQuery = true , value = "SELECT * FROM et_earmark ORDER BY id DESC Limit ?1")
    List<EtEarmarkEntity> listEarmark(int pageSize);
}