From 54ef548d58771a5ceaf8e83543bf76d80d051fd7 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Fri, 12 Nov 2021 12:41:20 +0800
Subject: [PATCH] 培训导入,成绩导入新增测试导入,用户查询修改

---
 src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml |   40 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 39 insertions(+), 1 deletions(-)

diff --git a/src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml b/src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml
index 5728425..f399fb7 100644
--- a/src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml
+++ b/src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml
@@ -11,7 +11,11 @@
             bu.sex,bu.cardid idCardNo,
             bu.securitynumber securityNumber,
             bu.avatar,
-            ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING( bu.cardid,7,4),0) age
+            ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING( bu.cardid,7,4),0) age,
+            bu1.real_name applyName,
+            bt1.dept_name applyUnit,
+            bu.registered,
+            bu.user_type userType
         FROM
             sys_accreditation_records sar
         left join
@@ -22,6 +26,22 @@
             blade_dept bt
         ON
             bu.dept_id = bt.id
+        left join
+        blade_user bu1
+        on
+        sar.create_user = bu1.id
+        LEFT JOIN
+        blade_dept bt1
+        ON
+        bu1.dept_id = bt1.id
+        left join
+        sys_information si
+        on
+        bt.id = si.departmentid
+        left join
+        sys_jurisdiction sj
+        on
+        sj.id = si.jurisdiction
         WHERE
             1=1
         and bu.status = 1
@@ -35,12 +55,30 @@
         <if test="accreditationRecords.idCardNo!=null and  accreditationRecords.idCardNo!=''">
             and bu.cardid like concat('%', #{accreditationRecords.idCardNo},'%')
         </if>
+        <if test="accreditationRecords.applyUnit!=null and  accreditationRecords.applyUnit!=''">
+            and bt1.dept_name like concat('%', #{accreditationRecords.applyUnit},'%')
+        </if>
         <if test="accreditationRecords.securityNumber!=null and  accreditationRecords.securityNumber!=''">
             and bu.securitynumber like concat('%', #{accreditationRecords.securityNumber},'%')
         </if>
+        <if test="accreditationRecords.jurisdiction!=null and accreditationRecords.jurisdiction!='' and accreditationRecords.jurisdiction!='1372091709474910209'">
+            and (sj.id = #{accreditationRecords.jurisdiction} or sj.parent_id = #{accreditationRecords.jurisdiction})
+        </if>
         <if test="accreditationRecords.status!=null">
             and sar.status = #{accreditationRecords.status}
         </if>
+        <if test="accreditationRecords.createUser!=null">
+            and sar.create_user = #{accreditationRecords.createUser}
+        </if>
+        <if test="accreditationRecords.deptId!=null">
+            and bt.id = #{accreditationRecords.deptId}
+        </if>
+        <if test="accreditationRecords.type!=null">
+            and sar.type = #{accreditationRecords.type}
+        </if>
+        <if test="accreditationRecords.auditStatus!=null">
+            and sar.audit_status = #{accreditationRecords.auditStatus}
+        </if>
         <if test="accreditationRecords.isAvatar==1">
             and bu.avatar is not null and bu.avatar!=""
         </if>

--
Gitblit v1.9.3