From 8d965e584b9be28a81d3f9fa587f6d0b18cd8dff Mon Sep 17 00:00:00 2001
From: yaozc <yaozc@yhzhg.cn>
Date: Mon, 10 Jul 2023 00:54:45 +0000
Subject: [PATCH] toMongo init
---
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java
index eb35f0a..c397b58 100644
--- a/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java
+++ b/eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserRepository.java
@@ -15,6 +15,7 @@
*/
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;
@@ -150,4 +151,21 @@
*/
@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);
}
--
Gitblit v1.9.3