Browse Source

修改通讯录查询

DESKTOP-USV654P\pc 1 year ago
parent
commit
118d937a47

+ 16 - 3
src/main/java/com/xjrsoft/module/concat/controller/ConcatController.java

@@ -63,11 +63,24 @@ public class ConcatController {
                 " left join xjr_dictionary_detail t6 on t1.gender = t6.code" +
                 " WHERE t1.delete_mark = 0" +
                 " AND t3.role_id = 2";
-        if(dto.getDeptId() != null){
+//        if(dto.getDeptId() != null){
+//            sql += " AND t5.hierarchy LIKE '%" + dto.getDeptId() + "%'";
+//        }else if(!StrUtil.isNotEmpty(dto.getName())){
+//            sql += " AND t5.id = " + parentId;
+//        }
+
+        if(StrUtil.isNotEmpty(dto.getName())&&dto.getDeptId() != null) {
             sql += " AND t5.hierarchy LIKE '%" + dto.getDeptId() + "%'";
-        }else if(!StrUtil.isNotEmpty(dto.getName())){
-            sql += " AND t5.id = " + parentId;
         }
+
+        if(!StrUtil.isNotEmpty(dto.getName())) {
+            if(dto.getDeptId() != null){
+                sql += " AND t5.id = " + dto.getDeptId();
+            }else {
+                sql += " AND t5.id = " + parentId;
+            }
+        }
+
         if(StrUtil.isNotEmpty(dto.getName())){
             concatList = new ArrayList<>();
             sql += "AND (t1.mobile = '%" + dto.getName() + "%' OR t1.name LIKE '%" + dto.getName() + "%')";