From f0e2074cb81056813fe8b34aa6b7d8a2419e1bdf Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Thu, 11 Nov 2021 20:49:06 +0800
Subject: [PATCH] 新增制证审核

---
 src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml |   23 ++++++++++++++++++++++-
 1 files changed, 22 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..5d289ab 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,14 @@
             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
         WHERE
             1=1
         and bu.status = 1
@@ -35,12 +47,21 @@
         <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.status!=null">
             and sar.status = #{accreditationRecords.status}
         </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