package com.yihu.figure.dao.health;

import com.yihu.figure.model.health.HealthIndexStatistics;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by yeshijie on 2017/3/6.
 */
public interface HealthIndexStatisticsDao extends PagingAndSortingRepository<HealthIndexStatistics, Long> {

    @Query(value = "select a.* from wlyy_health_index_statistics a where a.user=?1 and a.type=1 order by a.czrq desc limit 21",nativeQuery = true)
    List<HealthIndexStatistics> findByPatientXT(String patient);

    @Query(value = "select a.* from wlyy_health_index_statistics a where a.user=?1 and a.type=2 order by a.czrq desc limit 9",nativeQuery = true)
    List<HealthIndexStatistics> findByPatientXY(String patient);
}
