weicd
2023-11-21 a4077d90d300cf50c563f44953ed84322c5d5ff2
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java
@@ -134,4 +134,36 @@
     * @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);
    /**
     * 查询部门
     * @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);
}