|
@ -6,6 +6,7 @@
|
|
|
package com.yihu.wlyy.repository.followup;
|
|
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
@ -27,7 +28,35 @@ public interface FollowUpDao extends PagingAndSortingRepository<Followup, Long>,
|
|
|
|
|
|
@Query(value = "select a.* from wlyy_followup a where a.doctor_code in ?1 and a.patient_code = ?2 and a.followup_class=?3 and a.status ='1' order by a.followup_date DESC limit 1",nativeQuery = true)
|
|
|
Followup findLastFollowup(String[] doctors,String patientCode,String followClass) throws Exception;
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查找所有的随访数据
|
|
|
* @param patient
|
|
|
* @param teamCode
|
|
|
* @param pageable
|
|
|
* @return
|
|
|
*/
|
|
|
@Query("select d.code,d.name,d.photo,a.followupType,a.followupClass,a.status,a.createTime,a.updateTime,a.followupManagerStatus,c.code,c.name,c.photo" + ",a.followupDate,a.followupPlanDate,a.followupNextDate,a.id,a.followupNo from Followup a, Doctor d, Doctor c where a.doctorCode = d.code and a.creater = c.code and a.patientCode = ?1 and a.adminTeamCode = ?2 and a.status > 0")
|
|
|
Page<Object> findByPatientAndTeam(String patient, Long teamCode, Pageable pageable);
|
|
|
|
|
|
/**
|
|
|
* 查找所有的随访计划(未开始的归类为计划)
|
|
|
* @param patient
|
|
|
* @param teamCode
|
|
|
* @param pageable
|
|
|
* @return
|
|
|
*/
|
|
|
@Query("select d.code,d.name,d.photo,a.followupType,a.followupClass,a.status,a.createTime,a.updateTime,a.followupManagerStatus,c.code,c.name,c.photo" + ",a.followupDate,a.followupPlanDate,a.followupNextDate,a.id,a.followupNo from Followup a, Doctor d, Doctor c where a.doctorCode = d.code and a.creater = c.code and a.patientCode = ?1 and a.adminTeamCode = ?2 and a.status = '2'")
|
|
|
Page<Object> findPlanByPatientAndTeam(String patient, Long teamCode, Pageable pageable);
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查找所有的随访记录(进行中的,已完整的的归类为计划)
|
|
|
* @param patient
|
|
|
* @param teamCode
|
|
|
* @param pageable
|
|
|
* @return
|
|
|
*/
|
|
|
@Query("select d.code,d.name,d.photo,a.followupType,a.followupClass,a.status,a.createTime,a.updateTime,a.followupManagerStatus,c.code,c.name,c.photo" + ",a.followupDate,a.followupPlanDate,a.followupNextDate,a.id,a.followupNo from Followup a, Doctor d, Doctor c where a.doctorCode = d.code and a.creater = c.code and a.patientCode = ?1 and a.adminTeamCode = ?2 and (a.status = '1' or a.status = '3')")
|
|
|
Page<Object> findRecordByPatientAndTeam(String patient, Long teamCode, Pageable pageable);
|
|
|
}
|