Sfoglia il codice sorgente

查询下级部门人员

1550076451 2 anni fa
parent
commit
1cebfeb35e

+ 6 - 3
zxkf-api/src/main/java/api/controller/system/UserController.java

57
         if (input.getDeptId() != null &&input.getDeptId()>0)
57
         if (input.getDeptId() != null &&input.getDeptId()>0)
58
         {
58
         {
59
             //查询下级部门所有人员
59
             //查询下级部门所有人员
60
-            qw.inSql(User::getDeptId, "select dept_id from sys_dept where  " +
61
-                    " ancestors REGEXP CONCAT((select  ancestors from sys_dept where dept_id="+input.getDeptId()+"),',',"
62
-                    +input.getDeptId()+") ") ;
60
+            qw.and(wq->{
61
+                wq.inSql(User::getDeptId, "select dept_id from sys_dept where  " +
62
+                        " ancestors REGEXP CONCAT((select  ancestors from sys_dept where dept_id="+input.getDeptId()+"),',',"
63
+                        +input.getDeptId()+") ") ;
64
+                wq.or().like(User::getDeptId,input.getDeptId());
65
+            });
63
         }
66
         }
64
         qw.like(!StringHelper.isEmpty(input.getUserName()), User::getUserName, input.getUserName());
67
         qw.like(!StringHelper.isEmpty(input.getUserName()), User::getUserName, input.getUserName());
65
         qw.like(!StringHelper.isEmpty(input.getNickName()), User::getNickName, input.getNickName());
68
         qw.like(!StringHelper.isEmpty(input.getNickName()), User::getNickName, input.getNickName());