From 813b80aeea6829d082d6461da33894a99f07edba Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Tue, 18 May 2021 14:47:49 +0800
Subject: [PATCH] 1.新增根据用户编号查询用户信息接口 2.修复考勤导出信息中考勤类型缺失bug

---
 blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml |   33 +++++++++++++++++++++++++++------
 1 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml b/blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml
index 36c8f8a..45f8c7a 100644
--- a/blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml
+++ b/blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml
@@ -55,6 +55,7 @@
         <result column="work_status" property="work_status"/>
         <result column="jd" property="jd"/>
         <result column="wd" property="wd"/>
+        <result column="dept_name" property="deptName"/>
     </resultMap>
 
     <select id="selectUserPage" resultMap="userResultMap">
@@ -100,6 +101,9 @@
         <if test="user.account!=null and user.account != ''">
             and s.account = #{user.account}
         </if>
+        <if test="user.id!=null and user.id != ''">
+            and s.id = #{user.id}
+        </if>
         <if test="user.realName!=null and user.realName != ''">
             and s.real_name = #{user.realName}
         </if>
@@ -136,14 +140,26 @@
     </select>
 
     <!--查询处警人员列表-->
-    <select id="selectSecurityUserPageList" resultType="org.springblade.system.user.vo.UsersVo">
-        SELECT bu.*,p.jd,p.wd FROM blade_user bu
-            LEFT JOIN
+    <select id="selectSecurityUserPageList" resultMap="userResultMaps">
+        SELECT bu.id,bu.name,bu.code,bu.real_name,bu.account,
+            bu.email,bu.phone,bu.birthday,bu.create_time,
+            bu.sex,ifnull(bu.online_status,0) online_status,
+        bd.dept_name,p.jd,p.wd FROM blade_user bu
+        LEFT JOIN
         jfpt.sys_position p
-            on
+        on
         p.snumber=bu.code
-            where
-        role_id = #{user.roleId}
+        left join
+        blade_dept bd
+        on
+        bd.id=bu.dept_id
+        left join
+        blade_role br
+        on
+        bu.role_id=br.id
+        where
+        br.role_alias ='处警员'
+        and bu.is_deleted=0
         <if test="user.realName!=null and user.realName !=''">
             <bind name="realName" value="'%'+user.realName+'%'"/>
             and bu.real_name like #{realName}
@@ -154,4 +170,9 @@
         </if>
         order by bu.code asc
     </select>
+
+    <!--根据用户编号查询用户信息-->
+    <select id="selUserByCode" resultType="org.springblade.system.user.entity.User">
+        select code,dept_id deptId from blade_user where is_deleted = 0 and code=#{code}
+    </select>
 </mapper>

--
Gitblit v1.9.3