From 1a65f5d53d2212c893a1d3858846a5af2f0df5a2 Mon Sep 17 00:00:00 2001
From: huanghongfa <18228131219@163.com>
Date: 星期二, 19 一月 2021 15:06:54 +0800
Subject: [PATCH] 人口管理

---
 springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java |   29 +++++++++++++++++------------
 1 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java
index d1bb4c7..f0f7215 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java
@@ -50,20 +50,20 @@
             "u.phone,\n" +
             "u.id_card,\n" +
             "u.face_state,\n" +
-            "c.name,\n" +
+            "c.area_name communityName,\n" +
             "u.create_at \n" +
             "FROM\n" +
             "sys_user u\n" +
-            "JOIN com_act c ON u.community_id = c.community_id \n" +
-            "<if test='loginUserInfoVO.name != null and loginUserInfoVO.name.trim() != &quot;&quot;'>" +
-            "AND c.`name` = #{loginUserInfoVO.name} \n" +
+            "JOIN com_mng_struct_area c ON u.area_id = c.id \n" +
+            "<if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != &quot;&quot;'>" +
+            "AND c.`area_name` like concat(#{loginUserInfoVO.communityName},'%')  \n" +
             " </if> " +
             " where u.face_state is not null and u.type=1" +
-            "<if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != &quot;&quot;'>" +
-            "and u.`name` = #{loginUserInfoVO.communityName} \n" +
+            "<if test='loginUserInfoVO.name != null and loginUserInfoVO.name.trim() != &quot;&quot;'>" +
+            "and u.`name` like concat(#{loginUserInfoVO.name},'%')  \n" +
             " </if> " +
             "<if test='loginUserInfoVO.phone != null and loginUserInfoVO.phone.trim() != &quot;&quot;'>" +
-            "AND u.phone = #{loginUserInfoVO.phone}" +
+            "AND u.phone like concat(#{loginUserInfoVO.phone},'%') " +
             " </if> " +
             " order by u.face_state asc,u.create_at asc " +
             "</script>")
@@ -77,21 +77,26 @@
             "u.phone,\n" +
             "u.id_card,\n" +
             "u.job,\n" +
-            "c.name,\n" +
+            "c.area_name communityName,\n" +
             "u.tags,\n" +
             "u.create_at \n" +
             "FROM\n" +
             "sys_user u\n" +
-            "LEFT JOIN com_act c ON u.community_id = c.community_id \n" +
+            "<if test='loginUserInfoVO.name != null and loginUserInfoVO.name.trim() != &quot;&quot;'>" +
+            " JOIN com_mng_struct_area c ON u.area_id = c.id \n" +
+            " </if> " +
+            "<if test='loginUserInfoVO.name == null or loginUserInfoVO.name.trim() == &quot;&quot;'>" +
+            "LEFT JOIN com_mng_struct_area c ON u.area_id = c.id \n" +
+            " </if> " +
             "<if test='loginUserInfoVO.communityName != null and loginUserInfoVO.communityName.trim() != &quot;&quot;'>" +
-            "AND c.`name` = #{loginUserInfoVO.communityName} \n" +
+            "AND c.`area_name` like concat(#{loginUserInfoVO.communityName},'%')  \n" +
             " </if> " +
             " <where>" +
             "<if test='loginUserInfoVO.name != null and loginUserInfoVO.name.trim() != &quot;&quot;'>" +
-            " and u.`name` = #{loginUserInfoVO.name} \n" +
+            " and u.`name` like concat(#{loginUserInfoVO.name},'%')  \n" +
             " </if> " +
             "<if test='loginUserInfoVO.phone != null and loginUserInfoVO.phone.trim() != &quot;&quot;'>" +
-            "AND u.phone = #{loginUserInfoVO.phone}" +
+            "AND u.phone like concat(#{loginUserInfoVO.phone},'%') " +
             " </if> " +
             " </where>" +
             "</script>")

--
Gitblit v1.7.1