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

import com.yihu.jw.entity.hospital.team.WlyyAdminTeamMemberDO;
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 javax.persistence.criteria.CriteriaBuilder;
import java.util.List;

public interface WlyyAdminTeamMemberDao extends PagingAndSortingRepository<WlyyAdminTeamMemberDO, Integer>, JpaSpecificationExecutor<WlyyAdminTeamMemberDO> {
    @Query("from WlyyAdminTeamMemberDO t where t.teamId=?1 and t.available=1")
    List<WlyyAdminTeamMemberDO> findByTeamId(Long teamId, Pageable pageRequest);
}
