package com.example.removetolocal.newtrain.dao;

import com.example.removetolocal.newtrain.entity.TrainUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * @author zjm
 * @version 1.0.0
 * @ClassName TrainUserDao.java
 * @Description TODO
 * @createTime 2020年12月01日 13:55:00
 */
public interface TrainUserDao extends JpaRepository<TrainUser, Integer>, JpaSpecificationExecutor<TrainUser> {

    TrainUser findByUserIdAndTrainId(Integer userId,Integer trainId);

    List<TrainUser> findAllByIsSignUpAndTrainId(Integer IsSignUp,Integer trainId);

    List<TrainUser> findAllByTrainId(Integer trainId);

    List<TrainUser> findAllByUnitsIdAndTrainId(Integer unitId,Integer userId);
}
