| | |
| | | */ |
| | | package me.zhengjie.modules.system.repository; |
| | | |
| | | import io.swagger.models.auth.In; |
| | | import me.zhengjie.modules.system.domain.Dept; |
| | | import me.zhengjie.modules.system.domain.User; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | |
| | | |
| | | @Query(value = "select * from sys_user where dept_id = ?1 and enabled=?2", nativeQuery = true) |
| | | List<User> findByDeptIdInAndEnabledWithSingle(Long deptId, Boolean enabled); |
| | | |
| | | @Query(value = "select dept_id from sys_user where user_id = ?1",nativeQuery = true) |
| | | Long findDeptIdByUserId(Long userId); |
| | | |
| | | /** |
| | | * 查询部门 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Query(value = "SELECT u.* FROM sys_user u JOIN sys_dept d ON u.dept_id = d.dept_id WHERE d.dept_id = ?;", nativeQuery = true) |
| | | List<User> findByDeptId(Long dept_id); |
| | | |
| | | /** |
| | | * 查询用户 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Query(value = "SELECT * FROM sys_user WHERE user_id = ?;", nativeQuery = true) |
| | | List<User> findByUserId(Long user_id); |
| | | |
| | | @Query(value = "select * FROM sys_user WHERE user_id IN ?1 and enabled = true",nativeQuery = true) |
| | | void findByUserIdIn(List<Long> userIds, Long companyId); |
| | | |
| | | @Query(value = "select * FROM sys_user WHERE user_id IN ?1 and company_id = ?2 and enabled = true",nativeQuery = true) |
| | | void findByUserIdInAndCompanyId(List<Long> userIds, Long companyId); |
| | | |
| | | /** |
| | | * 根据用户昵称查询 |
| | | * |
| | | * @param nickName 用户昵称 |
| | | * @return / |
| | | */ |
| | | User findByNickName(String nickName); |
| | | } |