package com.cirle.scientific.dao;

import com.cirle.scientific.dto.UserOderDto;
import com.cirle.scientific.po.QkjIntegralDetail;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

public interface QkjIntegralDetailDao extends
        PagingAndSortingRepository<QkjIntegralDetail, Long>, JpaSpecificationExecutor<QkjIntegralDetail> {

	@Query(value = "SELECT * FROM qkj_integral_detail WHERE mem_card = ?1 ORDER BY change_time DESC LIMIT ?2,?3" ,nativeQuery = true)
    List<QkjIntegralDetail> findByMemCard(String memCard,Integer start,Integer size);

    @Query(value = "SELECT * FROM qkj_integral_detail WHERE mem_card = ?1 ORDER BY change_time DESC" ,nativeQuery = true)
    List<QkjIntegralDetail> findUserOder(String memCard);

	@Query(value = "SELECT * FROM qkj_integral_detail ORDER BY change_time DESC LIMIT ?1,?2" ,nativeQuery = true)
    List<QkjIntegralDetail> findByNewChange(Integer start,Integer size);
}
