DoctorTeamDao.java 1.3 KB

12345678910111213141516171819202122232425262728
  1. package com.yihu.wlyy.repository;
  2. import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
  3. import org.springframework.data.jpa.repository.Modifying;
  4. import org.springframework.data.jpa.repository.Query;
  5. import org.springframework.data.repository.PagingAndSortingRepository;
  6. import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeam;
  7. public interface DoctorTeamDao extends
  8. PagingAndSortingRepository<DoctorTeam, Long>,
  9. JpaSpecificationExecutor<DoctorTeam> {
  10. DoctorTeam findByCode(String code);
  11. @Query("select dt from DoctorTeam dt,DoctorTeamMember dtm where dt.code=dtm.team and dt.del=1 and dtm.del=1 and dtm.memberCode= ?1 and dtm.type= 5 and dtm.signType='2'")
  12. DoctorTeam findByParientCode(String parientCode);
  13. @Query("select dt from DoctorTeam dt,DoctorTeamMember dtm where dt.code=dtm.team and dt.del=1 and dtm.del=1 and dtm.memberCode= ?1 and dtm.type= 5 and dtm.signType='1'")
  14. DoctorTeam findBySanshiParientCode(String parientCode);
  15. @Query("select dt from DoctorTeam dt,DoctorTeamMember dtm where dt.code=dtm.team and dt.del=1 and dtm.del=1 and dtm.memberCode= ?1 and dtm.type= 5 and dtm.signType=?2")
  16. DoctorTeam findByParientCodeAndSignType(String parientCode,String type);
  17. @Modifying
  18. @Query("update DoctorTeam a set a.del =0 where a.code = ?1 and signType='2'")
  19. void deleteTeam(String teamCode);
  20. }