|  | @ -20,20 +20,48 @@ import java.util.List;
 | 
												
													
														
															|  | public interface DoctorAdminTeamDao extends
 |  | public interface DoctorAdminTeamDao extends
 | 
												
													
														
															|  |         PagingAndSortingRepository<AdminTeam, Long>,
 |  |         PagingAndSortingRepository<AdminTeam, Long>,
 | 
												
													
														
															|  |         JpaSpecificationExecutor<AdminTeam> {
 |  |         JpaSpecificationExecutor<AdminTeam> {
 | 
												
													
														
															|  | 
 |  |     /**
 | 
												
													
														
															|  | 
 |  |      * 全科医生团队内的签约数。
 | 
												
													
														
															|  | 
 |  |      *
 | 
												
													
														
															|  | 
 |  |      * @param doctorCode
 | 
												
													
														
															|  | 
 |  |      * @param patterns
 | 
												
													
														
															|  | 
 |  |      * @return
 | 
												
													
														
															|  | 
 |  |      */
 | 
												
													
														
															|  |     @Query("SELECT count(s) FROM SignFamily s WHERE doctor = :doctorCode AND doctorHealth IN (:patterns)")
 |  |     @Query("SELECT count(s) FROM SignFamily s WHERE doctor = :doctorCode AND doctorHealth IN (:patterns)")
 | 
												
													
														
															|  |     Integer getDoctorSignCount(@Param(value = "doctorCode") String doctorCode,
 |  |     Integer getDoctorSignCount(@Param(value = "doctorCode") String doctorCode,
 | 
												
													
														
															|  |                                @Param(value = "patterns") List<String> patterns);
 |  |                                @Param(value = "patterns") List<String> patterns);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     /**
 | 
												
													
														
															|  | 
 |  |      * 团队内,全科医生的签约患者。
 | 
												
													
														
															|  | 
 |  |      *
 | 
												
													
														
															|  | 
 |  |      * @param healthDoctorCode
 | 
												
													
														
															|  | 
 |  |      * @param patterns
 | 
												
													
														
															|  | 
 |  |      * @return
 | 
												
													
														
															|  | 
 |  |      */
 | 
												
													
														
															|  |     @Query("SELECT count(s) FROM SignFamily s WHERE doctorHealth = :healthDoctorCode AND doctor IN (:patterns)")
 |  |     @Query("SELECT count(s) FROM SignFamily s WHERE doctorHealth = :healthDoctorCode AND doctor IN (:patterns)")
 | 
												
													
														
															|  |     Integer getHealthDoctorSignCount(@Param(value = "healthDoctorCode") String healthDoctorCode,
 |  |     Integer getHealthDoctorSignCount(@Param(value = "healthDoctorCode") String healthDoctorCode,
 | 
												
													
														
															|  |                                      @Param(value = "patterns") List<String> patterns);
 |  |                                      @Param(value = "patterns") List<String> patterns);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     /**
 | 
												
													
														
															|  | 
 |  |      * 团队内,健康管理师的签约患者。
 | 
												
													
														
															|  | 
 |  |      *
 | 
												
													
														
															|  | 
 |  |      * @param healthDoctorCode
 | 
												
													
														
															|  | 
 |  |      * @param generalDoctors
 | 
												
													
														
															|  | 
 |  |      * @param pageable
 | 
												
													
														
															|  | 
 |  |      * @return
 | 
												
													
														
															|  | 
 |  |      */
 | 
												
													
														
															|  |     @Query("SELECT p FROM SignFamily s, Patient p WHERE s.doctorHealth = :healthDoctorCode AND s.doctor IN " +
 |  |     @Query("SELECT p FROM SignFamily s, Patient p WHERE s.doctorHealth = :healthDoctorCode AND s.doctor IN " +
 | 
												
													
														
															|  |             "(:generalDoctors) AND s.patient = p.code")
 |  |             "(:generalDoctors) AND s.patient = p.code")
 | 
												
													
														
															|  |     Page<Patient> getHealthDoctorSigningPatients(@Param(value = "healthDoctorCode") String healthDoctorCode,
 |  |     Page<Patient> getHealthDoctorSigningPatients(@Param(value = "healthDoctorCode") String healthDoctorCode,
 | 
												
													
														
															|  |                                                  @Param(value = "generalDoctors") List<String> generalDoctors,
 |  |                                                  @Param(value = "generalDoctors") List<String> generalDoctors,
 | 
												
													
														
															|  |                                                  Pageable pageable);
 |  |                                                  Pageable pageable);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     /**
 | 
												
													
														
															|  | 
 |  |      * 患者所签约团队。
 | 
												
													
														
															|  | 
 |  |      *
 | 
												
													
														
															|  | 
 |  |      * @param patientCode
 | 
												
													
														
															|  | 
 |  |      * @return
 | 
												
													
														
															|  | 
 |  |      */
 | 
												
													
														
															|  |     @Query("SELECT  t.id, t.name, d1.code, d1.name, d2.code, d2.name\n" +
 |  |     @Query("SELECT  t.id, t.name, d1.code, d1.name, d2.code, d2.name\n" +
 | 
												
													
														
															|  |             "FROM SignFamily f, Doctor d1, Doctor d2, AdminTeam t, AdminTeamMember m \n" +
 |  |             "FROM SignFamily f, Doctor d1, Doctor d2, AdminTeam t, AdminTeamMember m \n" +
 | 
												
													
														
															|  |             "WHERE d1.code = f.doctor AND f.doctorHealth = d2.code AND f.patient = :patientCode AND m.doctorCode = " +
 |  |             "WHERE d1.code = f.doctor AND f.doctorHealth = d2.code AND f.patient = :patientCode AND m.doctorCode = " +
 |