package com.yihu.wlyy.repository.doctor;

import com.yihu.wlyy.entity.doctor.survey.SurveyDimension;
import com.yihu.wlyy.entity.doctor.survey.SurveyDimensionDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by Reece on 2017/3/17.
 */
public interface SurveyDimensionDetailDao extends PagingAndSortingRepository<SurveyDimensionDetail, Long> {
    @Query("select d.dimensionName from SurveyDimensionDetail d where d.surveyCode = ?1 group by d.dimensionValue ")
    List<String> findByCode(String code);

    @Query("SELECT t.name FROM SurveyDimensionDetail t WHERE t.surveyCode=?1  AND t.dimensionName=?2 ")
    List<String> findByCode(String surveyCode,String dimensionName);

}
