package com.qmth.qrzk.dao.repositories;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.qmth.qrzk.repository.user.model.User;

public interface UserRepo extends JpaRepository<User, Integer>{

	@Query("select u from User u join u.roles r where r.code = ?1 and u.isEnabled = 1")
	List<User> findByRole(String roleCode);
	
	List<User> findByLoginName(String loginName);
}
