package com.yihu.jw.order.dao;

import com.yihu.jw.entity.base.im.ConsultDo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;


/**
 * 咨询表DAO类
 * @author huangwenjie
 */
public interface ConsultOrderDao extends PagingAndSortingRepository<ConsultDo, String>, JpaSpecificationExecutor<ConsultDo> {
	
//	@Query("from ConsultDo a where a.relationCode = ?1")
//	ConsultDo findByRelationCode(String outpatientid);

//	// 查询患者咨询记录
//	Page<Object> findByPatient(String patient, String title, String id, PageRequest pageRequest);
//
//	// 查询患者咨询记录
//	Page<Object> findByPatient(String patient, String title, PageRequest pageRequest);
//
//	// 查询患者咨询记录
//	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate,a.signCode  from ConsultDo a,ConsultTeamDo b where a.code = b.consult and a.patient = ?1 and a.id < ?2 and a.del = '1' and a.type<>8 order by a.czrq desc")
//	Page<Object> findByPatient(String patient, String id, Pageable pageRequest);
//
//	// 查询患者咨询记录
//	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate,a.signCode  from ConsultDo a,ConsultTeamDo b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.type<>8 order by a.czrq desc")
//	Page<Object> findByPatient(String patient, Pageable pageRequest);
}
