package com.huimv.video.repo;

import com.huimv.video.domain.SjHkAq;
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 SjHkAqRepository extends JpaRepository<SjHkAq, Integer>, JpaSpecificationExecutor<SjHkAq> {
	
	@Query(nativeQuery = true ,value = "select * from sj_hk_aq where lqid like %?1% limit ?2 , ?3")
    List<SjHkAq> findAll(String name, Integer startPage, Integer pageSize);

//    @Query(nativeQuery = true ,value = "select * from sj_hk_aq where lqid like %?1% limit ?2 , ?3")

    @Query(nativeQuery = true ,value = "select * from sj_hk_aq where lqid = ?1 order by id DESC limit 0 , 1")
    List<SjHkAq> findByLqidOrderById(Integer LQID);

}
