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 |   37 ++++++++++++++++++++++++++++++++++++-
 1 files changed, 36 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 e207703..5d289ab 100644
--- a/src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml
+++ b/src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml
@@ -10,7 +10,12 @@
             bu.real_name realName,
             bu.sex,bu.cardid idCardNo,
             bu.securitynumber securityNumber,
-            ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING( bu.cardid,7,4),0) age
+            bu.avatar,
+            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
@@ -21,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
@@ -34,11 +47,26 @@
         <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>
+        <if test="accreditationRecords.isAvatar==2">
+            and (bu.avatar is null or bu.avatar="")
         </if>
         <if test="accreditationRecords.startTime!=null and accreditationRecords.startTime!='' and accreditationRecords.startTime!='undefined'">
             and sar.create_time &gt;= #{accreditationRecords.startTime}
@@ -57,6 +85,7 @@
         bu.real_name realName,
         bu.sex,bu.cardid idCardNo,
         bu.securitynumber securityNumber,
+        bu.avatar,
         ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING( bu.cardid,7,4),0) age
         FROM
         sys_accreditation_records sar
@@ -113,6 +142,12 @@
         <if test="accreditationRecords.status!=null">
             and sar.status = #{accreditationRecords.status}
         </if>
+        <if test="accreditationRecords.isAvatar==1">
+            and bu.avatar is not null and bu.avatar!=""
+        </if>
+        <if test="accreditationRecords.isAvatar==2">
+            and (bu.avatar is null or bu.avatar="")
+        </if>
         <if test="accreditationRecords.startTime!=null and accreditationRecords.startTime!='' and accreditationRecords.startTime!='undefined'">
             and sar.create_time &gt;= #{accreditationRecords.startTime}
         </if>

--
Gitblit v1.9.3