package com.example.removetolocal.newuser.dao;

import com.example.removetolocal.newuser.domin.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserDao extends JpaRepository<User, Integer>, JpaSpecificationExecutor<User> {
    User findByUsername(String userName);

    List<User> findAllByUnitsId(Integer unitsId);

    List<User> findAllByUnitsIdIn(List<Integer> ids);

    List<User> findAllByUserIdIn(List<Integer> userIds);

    User findByOldCode(String code);

    User findByOldId(String oldId);
}
