From 689ec41f737aa299eac2d6b7b79606926f5b871c Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Thu, 26 May 2022 17:58:46 +0800
Subject: [PATCH] 1、资讯模糊匹配修改

---
 src/main/java/org/springblade/modules/system/mapper/UserMapper.xml    |   32 +++++++++------
 src/main/java/org/springblade/modules/zc/controller/ZcController.java |   20 ++++++++++
 src/main/java/org/springblade/modules/zc/vo/ZcVO.java                 |    1 
 src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml          |    3 +
 src/main/resources/application-dev.yml                                |   18 ++++----
 5 files changed, 52 insertions(+), 22 deletions(-)

diff --git a/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml b/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
index 754b61d..53b2200 100644
--- a/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
+++ b/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -81,7 +81,10 @@
             and account like concat('%',#{user.account},'%')
         </if>
         <if test="user.jurisdiction!=null and user.jurisdiction != ''">
-            and jurisdiction like concat('%',#{user.jurisdiction},'%')
+            and (jurisdiction = #{user.jurisdiction} or workjurisdiction = #{user.jurisdiction})
+        </if>
+        <if test="user.workjurisdiction!=null and user.workjurisdiction != ''">
+            and workjurisdiction = #{user.workjurisdiction}
         </if>
         <if test="user.realName!=null and user.realName != ''">
             and real_name like concat('%',#{user.realName},'%')
@@ -89,19 +92,22 @@
         <if test="user.userType!=null and user.userType != ''">
             and user_type = #{user.userType}
         </if>
-        <if test="deptIdList!=null and deptIdList.size>0">
-            and id in (
-            SELECT
-            user_id
-            FROM
-            blade_user_dept
-            WHERE
-            dept_id IN
-            <foreach collection="deptIdList" index="index" item="item" open="(" separator="," close=")">
-                #{item}
-            </foreach>
-            )
+        <if test="user.deptId!=null and user.deptId != ''">
+            and (jurisdiction = #{user.deptId} or workjurisdiction = #{user.deptId})
         </if>
+<!--        <if test="deptIdList!=null and deptIdList.size>0">-->
+<!--            and id in (-->
+<!--            SELECT-->
+<!--            user_id-->
+<!--            FROM-->
+<!--            blade_user_dept-->
+<!--            WHERE-->
+<!--            dept_id IN-->
+<!--            <foreach collection="deptIdList" index="index" item="item" open="(" separator="," close=")">-->
+<!--                #{item}-->
+<!--            </foreach>-->
+<!--            )-->
+<!--        </if>-->
         ORDER BY id
     </select>
 
diff --git a/src/main/java/org/springblade/modules/zc/controller/ZcController.java b/src/main/java/org/springblade/modules/zc/controller/ZcController.java
index 68ce16b..a352db4 100644
--- a/src/main/java/org/springblade/modules/zc/controller/ZcController.java
+++ b/src/main/java/org/springblade/modules/zc/controller/ZcController.java
@@ -141,6 +141,26 @@
 			}
 		}
 
+		for (int j = 0; j < page.getRecords().size(); j++) {
+			if (page.getRecords().get(j).getJurisdiction() != null && !page.getRecords().get(j).getWorkjurisdiction().equals("")) {
+				String[] split = page.getRecords().get(j).getJurisdiction().split(",");
+				List<String> list = Arrays.asList(split);
+				StringBuffer deptNameBuiffer = new StringBuffer();
+				//数据匹配封装
+				for (String deptId : list) {
+					for (DeptVo deptVo : xqVos) {
+						if (deptId.equals(deptVo.getId().toString())) {
+							deptNameBuiffer.append(deptVo.getDeptName()).append(",");
+						}
+					}
+				}
+				//封装部门名称数据
+				if (deptNameBuiffer.length() > 0) {
+					page.getRecords().get(j).setWorkname(deptNameBuiffer.substring(0, deptNameBuiffer.length() - 1));
+				}
+			}
+		}
+
 		return R.data(page);
 	}
 
diff --git a/src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml b/src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml
index a771aaf..7486814 100644
--- a/src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml
+++ b/src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml
@@ -44,6 +44,9 @@
         <if test="zc.examination_type != null and zc.examination_type != '' ">
             and examination_type = #{zc.examination_type}
         </if>
+        <if test="zc.jurisdiction != null and zc.jurisdiction != '' ">
+            and (jurisdiction = #{zc.jurisdiction} or workjurisdiction = #{zc.jurisdiction})
+        </if>
         and type != 1 ORDER BY zctime DESC
     </select>
 
diff --git a/src/main/java/org/springblade/modules/zc/vo/ZcVO.java b/src/main/java/org/springblade/modules/zc/vo/ZcVO.java
index 1034939..e03e297 100644
--- a/src/main/java/org/springblade/modules/zc/vo/ZcVO.java
+++ b/src/main/java/org/springblade/modules/zc/vo/ZcVO.java
@@ -34,4 +34,5 @@
 	private static final long serialVersionUID = 1L;
 	private String deptName;
 	private String XQName;
+	private String workname;
 }
diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml
index 4e47030..9c8d644 100644
--- a/src/main/resources/application-dev.yml
+++ b/src/main/resources/application-dev.yml
@@ -2,11 +2,11 @@
 spring:
   redis:
     ##redis 单机环境配置
-#    host: 127.0.0.1
-#    port: 6379
+    host: 127.0.0.1
+    port: 6379
 
-    host: 192.168.90.24
-    port: 6382
+#    host: 192.168.90.24
+#    port: 6382
     password:
     database: 0
     ssl: false
@@ -17,14 +17,14 @@
   datasource:
     # MySql
 #
-    url: jdbc:mysql://192.168.90.24:2083/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true
-    username: root
-    password: ZHba@0112
-
-#    url: jdbc:mysql://61.131.136.25:2083/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true
+#    url: jdbc:mysql://192.168.90.24:2083/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true
 #    username: root
 #    password: ZHba@0112
 
+    url: jdbc:mysql://61.131.136.25:2083/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true
+    username: root
+    password: ZHba@0112
+#
 #      url: jdbc:mysql://localhost:2083/qfqkpublic?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true
 #      username: root
 #      password: ZHba@0112

--
Gitblit v1.9.3