|
@ -1,6 +1,6 @@
|
|
/*******************************************************************************
|
|
/*******************************************************************************
|
|
* Copyright (c) 2005, 2014 springside.github.io
|
|
* Copyright (c) 2005, 2014 springside.github.io
|
|
*
|
|
|
|
|
|
* <p>
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
*******************************************************************************/
|
|
*******************************************************************************/
|
|
package com.yihu.wlyy.repository.patient;
|
|
package com.yihu.wlyy.repository.patient;
|
|
@ -18,43 +18,43 @@ import com.yihu.wlyy.entity.patient.PatientHealthGuidance;
|
|
|
|
|
|
public interface PatientHealthGuidanceDao extends PagingAndSortingRepository<PatientHealthGuidance, Long>, JpaSpecificationExecutor<PatientHealthGuidance> {
|
|
public interface PatientHealthGuidanceDao extends PagingAndSortingRepository<PatientHealthGuidance, Long>, JpaSpecificationExecutor<PatientHealthGuidance> {
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.createTime,b.level,a.readStatus from PatientHealthGuidance a, Doctor b where a.patient = ?1 and a.doctor = b.code and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByPatient(String patient, Pageable pageRequest);
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.createTime,b.level,a.readStatus from PatientHealthGuidance a, Doctor b where a.patient = ?1 and a.doctor = b.code and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByPatient(String patient, Pageable pageRequest);
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.createTime,b.level,a.readStatus from PatientHealthGuidance a, Doctor b where a.patient = ?1 and a.doctor = b.code and a.id < ?2 and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByPatient(String patient, long id, Pageable pageRequest);
|
|
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = b.code and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByDoctor(String doctor, Pageable pageRequest);
|
|
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.id < ?2 and a.patient = b.code and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByDoctor(String doctor, long id, Pageable pageRequest);
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.createTime,b.level,a.readStatus from PatientHealthGuidance a, Doctor b where a.patient = ?1 and a.doctor = b.code and a.id < ?2 and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByPatient(String patient, long id, Pageable pageRequest);
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = ?2 and a.patient = b.code and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByDoctor(String doctor, String patient, Pageable pageRequest);
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = b.code and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByDoctor(String doctor, Pageable pageRequest);
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = ?2 and a.patient = b.code and a.id < ?3 and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByDoctor(String doctor, String patient, long id, Pageable pageRequest);
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.id < ?2 and a.patient = b.code and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByDoctor(String doctor, long id, Pageable pageRequest);
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.czrq between ?2 and ?3 and a.patient = b.code and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByDoctor(String doctor, Date begin, Date end, Pageable pageRequest);
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = ?2 and a.patient = b.code and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByDoctor(String doctor, String patient, Pageable pageRequest);
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.czrq between ?2 and ?3 and a.id < ?4 and a.patient = b.code and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByDoctor(String doctor, Date begin, Date end, long id, Pageable pageRequest);
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = ?2 and a.patient = b.code and a.id < ?3 and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByDoctor(String doctor, String patient, long id, Pageable pageRequest);
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = ?2 and a.czrq between ?3 and ?4 and a.patient = b.code and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByDoctor(String doctor, String patient, Date begin, Date end, Pageable pageRequest);
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.czrq between ?2 and ?3 and a.patient = b.code and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByDoctor(String doctor, Date begin, Date end, Pageable pageRequest);
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = ?2 and a.czrq between ?3 and ?4 and a.id < ?5 and a.patient = b.code and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByDoctor(String doctor, String patient, Date begin, Date end, long id, Pageable pageRequest);
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.czrq between ?2 and ?3 and a.id < ?4 and a.patient = b.code and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByDoctor(String doctor, Date begin, Date end, long id, Pageable pageRequest);
|
|
|
|
|
|
//查找昨天的健康指导
|
|
|
|
@Query("SELECT a FROM PatientHealthGuidance a WHERE unix_timestamp(a.czrq)>=unix_timestamp(?1) and unix_timestamp(a.czrq)<unix_timestamp(?2) ")
|
|
|
|
List<PatientHealthGuidance> findByCzrqyYesterday(String yesterday,String now );
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = ?2 and a.czrq between ?3 and ?4 and a.patient = b.code and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByDoctor(String doctor, String patient, Date begin, Date end, Pageable pageRequest);
|
|
|
|
|
|
@Query("SELECT count(a) from PatientHealthGuidance a WHERE a.patient=?2 and a.doctor=?1 ")
|
|
|
|
Integer findbydoctorAndPatient(String doctor, String patientCode);
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = ?2 and a.czrq between ?3 and ?4 and a.id < ?5 and a.patient = b.code and a.del = '1' order by a.id desc")
|
|
|
|
Page<Object> findByDoctor(String doctor, String patient, Date begin, Date end, long id, Pageable pageRequest);
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, substring(a.content, 1, 50) as content, a.createTime,b.level,b.code,a.adminTeamCode from PatientHealthGuidance a, Doctor b where a.doctor = b.code and a.patient = ?1 and a.adminTeamCode = ?2 and a.del = '1'")
|
|
|
|
Page<Object> findByPatientAndTeamCode(String patient, Long teamCode, Pageable pageable);
|
|
|
|
|
|
//查找昨天的健康指导
|
|
|
|
@Query("SELECT a FROM PatientHealthGuidance a WHERE unix_timestamp(a.czrq)>=unix_timestamp(?1) and unix_timestamp(a.czrq)<unix_timestamp(?2) ")
|
|
|
|
List<PatientHealthGuidance> findByCzrqyYesterday(String yesterday, String now);
|
|
|
|
|
|
|
|
@Query("SELECT count(a) from PatientHealthGuidance a WHERE a.patient=?2 and a.doctor=?1 ")
|
|
|
|
Integer findbydoctorAndPatient(String doctor, String patientCode);
|
|
|
|
|
|
|
|
@Query("select b.name, b.photo, a.id, substring(a.content, 1, 50) as content, a.createTime,b.level,b.code,a.adminTeamCode from PatientHealthGuidance a, Doctor b where a.doctor = b.code and a.patient = ?1 and a.adminTeamCode = ?2 and a.del = '1'")
|
|
|
|
Page<Object> findByPatientAndTeamCode(String patient, Long teamCode, Pageable pageable);
|
|
}
|
|
}
|