| | |
| | | */ |
| | | package me.zhengjie.modules.system.repository; |
| | | |
| | | import me.zhengjie.modules.system.domain.Dept; |
| | | import me.zhengjie.modules.system.domain.User; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| | |
| | | int countByRoles(Set<Long> ids); |
| | | |
| | | /** |
| | | * 根据状态查询 |
| | | * @param enabled |
| | | * @return |
| | | */ |
| | | List<User> findAllByEnabled(Boolean enabled); |
| | | |
| | | /** |
| | | * 根据排班查询 |
| | | * @param ids / |
| | | * @return / |
| | | */ |
| | | @Query(value = "SELECT count(1) FROM sys_user WHERE rostering_id IN ?1", nativeQuery = true) |
| | | int countByRosterings(Long[] ids); |
| | | |
| | | /** |
| | | * 根据级别查询 |
| | | * @param ids / |
| | | * @return / |
| | | */ |
| | | @Query(value = "SELECT count(1) FROM sys_user WHERE level_id IN ?1", nativeQuery = true) |
| | | int countByLevels(Long[] ids); |
| | | |
| | | /** |
| | | * 根据ID查询 |
| | | * @param userIds |
| | | * @return |
| | | */ |
| | | List<User> findByIdIn(List<Long> userIds); |
| | | |
| | | /** |
| | | * 根据部门查询 |
| | | * @param dept |
| | | * @return |
| | | */ |
| | | List<User> findByDeptAndEnabled(Dept dept, Boolean enabled); |
| | | |
| | | @Query(value = "SELECT * FROM sys_user WHERE dept_id IN ?1 AND enabled = ?2", nativeQuery = true) |
| | | List<User> findByDeptIdInAndEnabled(List<Long> deptIds, Boolean enabled); |
| | | } |