package com.yihu.jw.hospital.survey.dao;

import com.yihu.jw.entity.hospital.survey.WlyySurveyTemplateOptionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by Trick on 2019/9/6.
 */
public interface SurveyTemplateOptionDao extends PagingAndSortingRepository<WlyySurveyTemplateOptionDO, String>, JpaSpecificationExecutor<WlyySurveyTemplateOptionDO> {
    @Query("From WlyySurveyTemplateOptionDO c WHERE c.questionCode = ?1 and c.templateCode = ?2 and c.del = ?3 order by c.sort asc ")
    List<WlyySurveyTemplateOptionDO> findByQuestionCodeAndDelOrderBySortAsc(String questionCode,String templateCode,String del);

    List<WlyySurveyTemplateOptionDO> findByTemplateCodeAndDelOrderBySortAsc(String templateCode,String del);
}
