package com.yihu.jw.hospital.team.dao;

import com.yihu.jw.entity.hospital.team.WlyyAdminTeamDO;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

public interface WlyyAdminTeamDao extends PagingAndSortingRepository<WlyyAdminTeamDO, Integer>, JpaSpecificationExecutor<WlyyAdminTeamDO> {
    @Query("from WlyyAdminTeamDO  t where t.orgCode=?1 and t.available=1")
    List<WlyyAdminTeamDO> findTeamByOrgCode(String orgCode, Pageable pageRequest);

    @Query("from WlyyAdminTeamDO  t where t.available=1")
    List<WlyyAdminTeamDO> findTeamAndAvailable();

}
