From ae0bbf65648dec5be4cbf62b381f0151b019369f Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Tue, 13 Jul 2021 22:40:32 +0800
Subject: [PATCH] 1.派遣记录接口修改 2.保安列表接口修改

---
 src/main/java/org/springblade/modules/system/mapper/UserMapper.xml |   33 +++++++++++++++++++++++----------
 1 files changed, 23 insertions(+), 10 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 d19aae1..4357963 100644
--- a/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
+++ b/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -40,30 +40,43 @@
     </resultMap>
 
     <select id="selectUserPage" resultMap="userResultMap">
-        select * from blade_user where is_deleted = 0
+        select bu.* from
+            blade_user bu
+        left join
+            blade_dept bd
+        on
+            bu.dept_id = bd.id
+        where
+            bu.is_deleted = 0
         <if test="tenantId!=null and tenantId != ''">
-            and tenant_id = #{tenantId}
+            and bu.tenant_id = #{tenantId}
         </if>
         <if test="user.tenantId!=null and user.tenantId != ''">
-            and tenant_id = #{user.tenantId}
+            and bu.tenant_id = #{user.tenantId}
         </if>
         <if test="user.account!=null and user.account != ''">
-            and account = #{user.account}
+            and bu.account = #{user.account}
+        </if>
+        <if test="user.hold!=null and user.hold != ''">
+            and bu.hold = #{user.hold}
         </if>
         <if test="user.deptId!=null and user.deptId != ''">
-            and dept_id = #{user.deptId}
+            and (bd.parent_id = #{user.deptId} or bd.id = #{user.deptId})
+        </if>
+        <if test="user.roleId!=null and user.roleId != ''">
+            and bu.role_id = #{user.roleId}
         </if>
         <if test="user.status!=null and user.status != ''">
-            and status = #{user.status}
+            and bu.status = #{user.status}
         </if>
         <if test="user.realName!=null and user.realName != ''">
-            and real_name like concat('%', #{user.realName},'%')
+            and bu.real_name like concat('%', #{user.realName},'%')
         </if>
         <if test="user.userType!=null and user.userType != ''">
-            and user_type = #{user.userType}
+            and bu.user_type = #{user.userType}
         </if>
         <if test="deptIdList!=null and deptIdList.size>0">
-            and id in (
+            and bu.id in (
                 SELECT
                     user_id
                 FROM
@@ -75,7 +88,7 @@
                 </foreach>
             )
         </if>
-        ORDER BY id
+        ORDER BY bu.id
     </select>
 
     <select id="getUser" resultMap="userResultMap">

--
Gitblit v1.9.3