UserRepository.java 889 Bytes
Newer Older
manxiaoqiang committed
1 2 3 4 5 6 7 8 9 10 11 12 13
package common.repository;

import common.model.Menu;
import common.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
public interface UserRepository extends JpaRepository<User, Long> {

manxiaoqiang committed
14
	@Query(value="select * from user where email = ?1 and password = ?2 and del_flag is not true",nativeQuery=true)
manxiaoqiang committed
15 16
	User login(String email, String pwd);

manxiaoqiang committed
17 18 19 20 21 22 23 24 25
	@Query(value="select * from user where role = ?1 and del_flag is not true",nativeQuery=true)
	List<User> findOneDepartment(Long role);

	@Query(value="select * from user where del_flag is not true",nativeQuery=true)
	List<User> findAll();

	@Query(value="select * from user where email = ?1 and del_flag is not true",nativeQuery=true)
	User login(String email);

manxiaoqiang committed
26
}