chenweida 8 vuotta sitten
vanhempi
commit
875e14a722

+ 34 - 34
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultTeamDao.java

@ -33,27 +33,27 @@ public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam,
	int countByPatient(String patient,String doctor);
	// 被指定且未结束列表
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 ")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and b.from is null")
	Page<ConsultTeam> findDoctorList(String doctor, Pageable pageRequest);
	// 被指定且未结束列表
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.id < ?2 ")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.id < ?2 and b.from is null")
	Page<ConsultTeam> findDoctorList(String doctor, long id, Pageable pageRequest);
	// 被指定且未结束列表
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.patient = ?2 and b.to = ?1 ")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.patient = ?2 and b.to = ?1 and b.from is null")
	Page<ConsultTeam> findDoctorPatientList(String doctor,String patient,  Pageable pageRequest);
	// 被指定且未结束列表
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.patient = ?2 and b.to = ?1 and a.id < ?3  ")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.patient = ?2 and b.to = ?1 and a.id < ?3  and b.from is null")
	Page<ConsultTeam> findDoctorPatientList(String doctor,String patient, long id, Pageable pageRequest);
	// 被指定且未结束列表
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.status = 0 and a.del = '1' and b.del = '1' and a.type<3 ")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.status = 0 and a.del = '1' and b.del = '1' and a.type<3 and b.from is null")
	Page<ConsultTeam> findDoctorPointList(String doctor, Pageable pageRequest);
	// 被指定且未结束列表
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.id < ?2 and a.status = 0 and a.del = '1' and b.del = '1' and a.type<3 ")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.id < ?2 and a.status = 0 and a.del = '1' and b.del = '1' and a.type<3 and b.from is null")
	Page<ConsultTeam> findDoctorPointList(String doctor, long id, Pageable pageRequest);
	// 被指定且未结束列表
@ -65,17 +65,17 @@ public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam,
	Page<ConsultTeam> findDoctorAllList(String doctor, Pageable pageRequest);
	// 医生参与且未结束列表
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.status = 0 and b.reply = 1 and a.del = '1' and b.del = '1' and a.type<3")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.status = 0 and b.reply = 1 and a.del = '1' and b.del = '1' and a.type<3 and b.from is null")
	Page<ConsultTeam> findDoctorJoinList(String doctor, Pageable pageRequest);
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.id < ?2 and a.status = 0 and b.reply = 1 and a.del = '1' and b.del = '1' and a.type<3 ")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.id < ?2 and a.status = 0 and b.reply = 1 and a.del = '1' and b.del = '1' and a.type<3 and b.from is null")
	Page<ConsultTeam> findDoctorJoinList(String doctor, long id, Pageable pageRequest);
	// 医生参与并已结束列表
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.status = 1 and a.del = '1' and b.del = '1' and a.type<3")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.status = 1 and a.del = '1' and b.del = '1' and a.type<3 and b.from is null")
	Page<ConsultTeam> findDoctorFinishList(String doctor, Pageable pageRequest);
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.id < ?2 and a.status = 1 and a.del = '1' and b.del = '1' and a.type<3")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and b.to = ?1 and a.id < ?2 and a.status = 1 and a.del = '1' and b.del = '1' and a.type<3  and b.from is null")
	Page<ConsultTeam> findDoctorFinishList(String doctor, long id, Pageable pageRequest);
	// 医生关闭三师咨询
@ -175,51 +175,51 @@ public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam,
	@Query("SELECT a FROM ConsultTeam a WHERE a.patient=?1 and a.doctor = ?2 and a.status=0 and a.del=1 and a.type=6")
	ConsultTeam findFamousConsultByPatient(String uid,String doctor);
	//名医咨询 -全部
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and b.to = ?1 and a.id < ?2 and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and b.to = ?1 and a.id < ?2 and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findFamousDoctorAllList(String uid, long id, Pageable pageRequest);
	//名医咨询 -全部
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and b.to = ?1  and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and b.to = ?1  and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findFamousDoctorAllList(String uid, Pageable pageRequest);
	//名医咨询 -全部 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and b.to = ?1 and a.id < ?2 and a.symptoms like ?3 and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and b.to = ?1 and a.id < ?2 and a.symptoms like ?3 and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findFamousDoctorAllList(String uid, long id,String title, Pageable pageRequest);
	//名医咨询 -全部 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and b.to = ?1 and a.symptoms like ?2  and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and b.to = ?1 and a.symptoms like ?2  and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findFamousDoctorAllList(String uid,String title, Pageable pageRequest);
	//名医咨询 -根据status
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and b.to = ?1 and a.id < ?2 and a.status = ?3 and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and b.to = ?1 and a.id < ?2 and a.status = ?3 and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findFamousDoctorDoingList(String uid, long id,Integer type, Pageable pageRequest);
	//名医咨询 -根据status
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 )and b.to = ?1 and a.status = ?2  and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 )and b.to = ?1 and a.status = ?2  and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findFamousDoctorDoingList(String uid,Integer type, Pageable pageRequest);
	//名医咨询 -根据status 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and b.to = ?1 and a.id < ?2 and a.symptoms like ?3 and a.status = ?4 and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and b.to = ?1 and a.id < ?2 and a.symptoms like ?3 and a.status = ?4 and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findFamousDoctorDoingList(String uid, long id,String title,Integer type, Pageable pageRequest);
	//名医咨询 -根据status 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 )and b.to = ?1 and a.symptoms like ?2 and a.status = ?3 and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 )and b.to = ?1 and a.symptoms like ?2 and a.status = ?3 and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findFamousDoctorDoingList(String uid,String title,Integer type, Pageable pageRequest);
	@Query("select a from ConsultTeam a where  a.type=?3  and a.del = '1' and a.patient=?1 and a.doctor=?2 and  a.status=0 ")
	ConsultTeam findByParientCodeAndSignTypeAndDoctor(String patientCode, String doctor, int s);
	//名医咨询 -全部 带symptoms 未处理、未回复
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.symptoms like ?3 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.symptoms like ?3 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findFamousDoctorUnReplyReadList(String uid, long id,String title, Pageable pageRequest);
	//名医咨询 -全部 带symptoms 处理、未回复
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.symptoms like ?2 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.symptoms like ?2 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findFamousDoctorUnReplyReadList(String uid,String title, Pageable pageRequest);
	//名医咨询 -全部 处理、未回复
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.id < ?2 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findFamousDoctorUnReplyReadNoTitleList(String uid, long id, Pageable pageRequest);
	//三师家庭咨询 -全部
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type= 1 or a.type = 2) and b.to = ?1 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type= 1 or a.type = 2) and b.to = ?1 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findDoctorUnReplyReadNoTitleList(String uid, Pageable pageRequest);
	//三师家庭咨询 -全部 处理、未回复
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type= 1 or a.type = 2) and b.to = ?1 and a.id < ?2 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type= 1 or a.type = 2) and b.to = ?1 and a.id < ?2 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findDoctorUnReplyReadNoTitleList(String uid, long id, Pageable pageRequest);
	//名医咨询 -全部
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and a.type=6 and b.to = ?1 and a.status = 0 and (a.doctorRead > 0 or b.reply <> 1) and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findFamousDoctorUnReplyReadNoTitleList(String uid, Pageable pageRequest);
	//名医咨询 -全部 带symptoms 进行中
@ -239,11 +239,11 @@ public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam,
	Page<ConsultTeam> findFamousDoctorIngNoTitleList(String uid, Pageable pageRequest);
	//三师家庭咨询 -全部 进行中
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type= 1 or a.type = 2) and b.to = ?1 and a.id < ?2 and a.status = 0 and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type= 1 or a.type = 2) and b.to = ?1 and a.id < ?2 and a.status = 0 and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findDoctorIngNoTitleList(String uid, long id, Pageable pageRequest);
	//三师家庭咨询 -全部 进行中
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type= 1 or a.type = 2) and b.to = ?1 and a.status = 0 and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type= 1 or a.type = 2) and b.to = ?1 and a.status = 0 and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findDoctorIngNoTitleList(String uid, Pageable pageRequest);
    // 更新超过24小时未回复的项目,多加一分钟,防止过于频繁更新
@ -258,34 +258,34 @@ public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam,
	@Query("FROM ConsultTeam a where a.type=?1 and a.adminTeamId is null")
	List<ConsultTeam> findByTypeAndAdminTeamIdIsNull(Integer s);
	//名医咨询 -我咨询的全部 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.id < ?2 and a.symptoms like ?3 and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.id < ?2 and a.symptoms like ?3 and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findMyFamousDoctorAllList(String uid, long id, String title, Pageable pageRequest);
	//名医咨询 -我咨询的全部 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.symptoms like ?2 and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.symptoms like ?2 and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findMyFamousDoctorAllList(String uid, String title, Pageable pageRequest);
	//名医咨询 -我咨询的全部 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.id < ?2 and  a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.id < ?2 and  a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findMyFamousDoctorAllList(String uid, Long id, Pageable pageRequest);
	//名医咨询 -我咨询的全部 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1  and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1  and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findMyFamousDoctorAllList(String uid, Pageable pageRequest);
	//名医咨询 -我咨询的 带symptoms 根据status
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.status=?2 and a.id < ?3 and a.symptoms like ?4 and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.status=?2 and a.id < ?3 and a.symptoms like ?4 and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findMyFamousDoctorListByStatus(String uid, int status, long id, String title, Pageable pageRequest);
	//名医咨询 -我咨询的 带symptoms 根据status
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.status=?2  and a.symptoms like ?3 and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.status=?2  and a.symptoms like ?3 and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findMyFamousDoctorListByStatus(String uid, int status, String title, Pageable pageRequest);
	//名医咨询 -我咨询的 带symptoms根据status
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.status=?2  and a.id < ?3 and  a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.status=?2  and a.id < ?3 and  a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findMyFamousDoctorListByStatus(String uid, int status, long id, Pageable pageRequest);
	//名医咨询 -我咨询的 带symptoms根据status
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.status=?2  and a.del = '1' and b.del = '1'")
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.status=?2  and a.del = '1' and b.del = '1' and b.from is null")
	Page<ConsultTeam> findMyFamousDoctorListByStatus(String uid, int status, Pageable pageRequest);
}