From 6ad9c778d138d0806966ce044dd4ee2ee46d2ea2 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Sat, 18 Sep 2021 16:56:52 +0800
Subject: [PATCH] 分局预警接口修改

---
 src/main/java/org/springblade/modules/system/mapper/UserMapper.xml |   30 +++++++++++++++++++++++++-----
 1 files changed, 25 insertions(+), 5 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 bb58ace..84135c1 100644
--- a/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
+++ b/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -45,6 +45,7 @@
         <result column="my_picture" property="myPicture"/>
         <result column="soil" property="soil"/>
         <result column="healstats" property="healstats"/>
+        <result column="holdv" property="holdv"/>
     </resultMap>
 
 
@@ -92,7 +93,8 @@
     </resultMap>
 
     <select id="selectUserPage" resultMap="userResultMap">
-        select * from blade_user where is_deleted = 0
+        select * from blade_user
+        where is_deleted = 0
         <if test="user.tenantId!=null and user.tenantId != ''">
             and tenant_id = #{user.tenantId}
         </if>
@@ -155,7 +157,11 @@
         sys_information si
         on
         si.departmentid = bu.dept_id
-        where is_deleted = 0
+        left join
+        sys_jurisdiction sj
+        on
+        sj.id =si.jurisdiction
+        where bu.is_deleted = 0
         and status = 1
         <if test="user.realName!=null and user.realName != ''">
             and bu.real_name like concat(concat('%', #{user.realName}),'%')
@@ -179,7 +185,7 @@
             and bu.hold = #{user.hold}
         </if>
         <if test="user.jurisdiction!=null and user.jurisdiction != '' and user.jurisdiction != '1372091709474910209'">
-            and si.jurisdiction = #{user.jurisdiction}
+            and sj.parent_id = #{user.jurisdiction}
         </if>
         <if test="user.securitynumber!=null and user.securitynumber != ''">
             and bu.securitynumber = #{user.securitynumber}
@@ -200,12 +206,19 @@
         blade_dept bd
         on
         bu.dept_id = bd.id
+        left join
+        blade_role br
+        on
+        br.id = bu.role_id
         where
         bu.is_deleted = 0
         and
-        bd.dept_category = 1
+        br.role_alias = '安保人员'
         and
         bu.status = 1
+        and bd.parent_id!=1425365577303621633
+        and bd.id != 1425365577303621633
+        and bd.id != 1432625856013971457
         <if test="user.cardid!=null and user.cardid != ''">
             and bu.cardid like concat(concat('%', #{user.cardid}),'%')
         </if>
@@ -275,7 +288,7 @@
 
     <update id="updateUser">
         update blade_user
-        set hold=#{hold}
+        set hold=#{hold},holdv=#{holdv},holdvtime=#{time}
         where cardid = #{cardid}
     </update>
 
@@ -308,4 +321,11 @@
         where securitynumber = #{securityNumber}
     </select>
 
+    <!--通过 身份证号查询用户信息-->
+    <select id="getUserInfoByIdCardNo" resultType="org.springblade.modules.system.entity.User">
+        SELECT id, name, real_name RealName
+        FROM blade_user
+        where cardid = #{param1}
+    </select>
+
 </mapper>

--
Gitblit v1.9.3