guoyujia 1 éve
szülő
commit
036bdcaed0

+ 10 - 0
src/main/java/cn/ezhizao/project/system/domain/SysUser.java

@@ -135,6 +135,16 @@ public class SysUser extends BaseEntity {
 
     private Long roleId;
 
+    private Long deptId;
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
     public Long getRoleId() {
         return roleId;
     }

+ 3 - 5
src/main/resources/mybatis/system/SysUserMapper.xml

@@ -104,7 +104,7 @@
 		       u.login_date,
 		       u.create_by,
 		       u.create_time,
-		       u.remark FROM sys_user u
+		       u.remark FROM sys_user u left join sys_dept_user d on u.user_id = d.user_id
 		WHERE u.del_flag = '0'
 		<if test="userId != null and userId != 0">
 			AND u.user_id = #{userId}
@@ -112,11 +112,9 @@
 		<if test="tenantId != null and tenantId != 0">
 			AND u.tenant_id = #{tenantId}
 		</if>
-		<!--
-		<if test="tenantId != null and tenantId != 0">
-			AND u.user_id IN (SELECT user_id FROM biz_user_tenant WHERE deleted = 0 AND tenant_id = #{tenantId} )
+		<if test="deptId != null and deptId != 0">
+			AND d.dept_id = #{deptId}
 		</if>
-		-->
 		<if test="userName != null and userName != ''">
 			AND u.user_name LIKE concat('%', #{userName}, '%')
 		</if>