فهرست منبع

Merge branch 'dev' of zd_123/patient-co-management into dev

trick9191 7 سال پیش
والد
کامیت
49d7ef206b

+ 30 - 30
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientHealthGuidanceDao.java

@ -1,6 +1,6 @@
/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
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> {
	@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);
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcEduArticleController.java

@ -40,7 +40,7 @@ import javax.jms.TextMessage;
import java.util.*;
/**
 * Created by chenweida on 2017/8/30.
 * Created by chenweida on 2017/8/30...
 */
@Controller
@RequestMapping(value = "/wlyygc/doctor/edu/article", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)