From ef33401f486d455a15059f2c89431df7021db0c6 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Tue, 30 Nov 2021 19:42:47 +0800
Subject: [PATCH] 枪支数据导入接口新增

---
 src/main/java/org/springblade/modules/system/mapper/UserMapper.xml |   33 +++++++++++++++++++++++++++------
 1 files changed, 27 insertions(+), 6 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 1d95074..9210673 100644
--- a/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
+++ b/src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -157,11 +157,12 @@
         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
-        and bd.parent_id!=1425365577303621633
-        and bd.id != 1425365577303621633
-        and bd.id != 1432625856013971457
         <if test="user.realName!=null and user.realName != ''">
             and bu.real_name like concat(concat('%', #{user.realName}),'%')
         </if>
@@ -175,7 +176,12 @@
             and bu.nativeplace = #{user.nativeplace}
         </if>
         <if test="user.examinationType!=null and user.examinationType != ''">
-            and bu.examination_type = #{user.examinationType}
+            <if test="user.examinationType == 0">
+                and (bu.examination_type = #{user.examinationType} or bu.examination_type is null or bu.examination_type ='')
+            </if>
+            <if test="user.examinationType == 1">
+                and bu.examination_type = #{user.examinationType}
+            </if>
         </if>
         <if test="user.sex!=null and user.sex != ''">
             and bu.sex = #{user.sex}
@@ -184,7 +190,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}
@@ -220,6 +226,12 @@
         and bd.id != 1432625856013971457
         <if test="user.cardid!=null and user.cardid != ''">
             and bu.cardid like concat(concat('%', #{user.cardid}),'%')
+        </if>
+        <if test="user.examinationType==0">
+            and (bu.examination_type = #{user.examinationType} or bu.examination_type is null or bu.examination_type="")
+        </if>
+        <if test="user.examinationType==1">
+            and bu.examination_type = #{user.examinationType}
         </if>
         <if test="user.realName!=null and user.realName != ''">
             and bu.real_name like concat(concat('%', #{user.realName}),'%')
@@ -320,4 +332,13 @@
         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}
+        and is_deleted = 0
+        and status = 1
+    </select>
+
 </mapper>

--
Gitblit v1.9.3