|
@ -6,6 +6,7 @@ import com.yihu.wlyy.entity.doctor.team.admin.AdminTeamMember;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Pageable;
|
|
import org.springframework.data.domain.Pageable;
|
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
|
|
|
import org.springframework.data.jpa.repository.Modifying;
|
|
import org.springframework.data.jpa.repository.Query;
|
|
import org.springframework.data.jpa.repository.Query;
|
|
import org.springframework.data.repository.PagingAndSortingRepository;
|
|
import org.springframework.data.repository.PagingAndSortingRepository;
|
|
import org.springframework.data.repository.query.Param;
|
|
import org.springframework.data.repository.query.Param;
|
|
@ -27,11 +28,11 @@ public interface DoctorAdminTeamMemberDao extends
|
|
List<AdminTeam> findDoctorTeams(@Param(value = "doctorCode") String doctorCode);
|
|
List<AdminTeam> findDoctorTeams(@Param(value = "doctorCode") String doctorCode);
|
|
|
|
|
|
@Query("SELECT d FROM AdminTeamMember m, AdminTeam t, Doctor d WHERE t.id = :teamId AND t.id = m.teamId " +
|
|
@Query("SELECT d FROM AdminTeamMember m, AdminTeam t, Doctor d WHERE t.id = :teamId AND t.id = m.teamId " +
|
|
"AND m.doctorCode = d.code AND t.available = true ORDER BY d.level")
|
|
|
|
|
|
"AND m.doctorCode = d.code AND t.available = true AND m.available = true ORDER BY d.level")
|
|
List<Doctor> findAllMembers(@Param(value = "teamId") long teamId);
|
|
List<Doctor> findAllMembers(@Param(value = "teamId") long teamId);
|
|
|
|
|
|
@Query("SELECT case when count(A) > 0 then true else false END FROM AdminTeamMember A WHERE A.teamId = :teamId " +
|
|
@Query("SELECT case when count(A) > 0 then true else false END FROM AdminTeamMember A WHERE A.teamId = :teamId " +
|
|
"AND A.doctorCode = :doctorCode")
|
|
|
|
|
|
"AND A.doctorCode = :doctorCode AND A.available = true")
|
|
Boolean isMemberExist(@Param(value = "teamId") long teamId, @Param(value = "doctorCode") String doctorCode);
|
|
Boolean isMemberExist(@Param(value = "teamId") long teamId, @Param(value = "doctorCode") String doctorCode);
|
|
|
|
|
|
@Query("SELECT d from Hospital h, Doctor d WHERE d.name like :doctorName " +
|
|
@Query("SELECT d from Hospital h, Doctor d WHERE d.name like :doctorName " +
|
|
@ -42,6 +43,10 @@ public interface DoctorAdminTeamMemberDao extends
|
|
@Param(value = "teamId") long teamId,
|
|
@Param(value = "teamId") long teamId,
|
|
Pageable pageable);
|
|
Pageable pageable);
|
|
|
|
|
|
|
|
@Modifying
|
|
|
|
@Query("UPDATE AdminTeamMember t SET t.available = false where t.id = :teamId and doctorCode = :doctorCode")
|
|
|
|
void removeMember(@Param("teamId") long teamId, @Param("doctorCode") String doctorCode);
|
|
|
|
|
|
@Query("SELECT d FROM AdminTeamMember m, AdminTeam t, Doctor d WHERE t.id = ?1 AND t.id = m.teamId AND " +
|
|
@Query("SELECT d FROM AdminTeamMember m, AdminTeam t, Doctor d WHERE t.id = ?1 AND t.id = m.teamId AND " +
|
|
"m.doctorCode = d.code and d.code != ?2 AND t.available = true and d.level != 1 ")
|
|
"m.doctorCode = d.code and d.code != ?2 AND t.available = true and d.level != 1 ")
|
|
List<Doctor> findAllHeathExcludeThis(long teamId, String doctorCode);
|
|
List<Doctor> findAllHeathExcludeThis(long teamId, String doctorCode);
|