package com.huimv.video.repo;

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

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