From 8853292babb2ad94de4a3207966f1e83b767cd2d Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Sun, 17 Sep 2023 16:38:34 +0800
Subject: [PATCH] 新增流程节点进程查询接口

---
 src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml |   32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 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 677b211..a79c897 100644
--- a/src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml
+++ b/src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml
@@ -45,6 +45,8 @@
         sj.id = si.jurisdiction
         WHERE
             1=1
+        and bu.status = 1
+        and bu.is_deleted = 0
         <if test="accreditationRecords.deptName!=null and  accreditationRecords.deptName!=''">
             and bt.dept_name like concat('%', #{accreditationRecords.deptName},'%')
         </if>
@@ -63,7 +65,10 @@
         <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">
+        <if test="accreditationRecords.status==1">
+            and sar.status = #{accreditationRecords.status}
+        </if>
+        <if test="accreditationRecords.status==2">
             and sar.status = #{accreditationRecords.status}
         </if>
         <if test="accreditationRecords.createUser!=null">
@@ -123,7 +128,7 @@
     </select>
 
 
-    <!--导出保安员证信息-->
+    <!--导出保安员证信息(上岗证)-->
     <select id="exportSecurityPaperList" resultType="org.springblade.modules.accreditation.vo.AccreditationRecordsVo">
         SELECT
         sar.*,
@@ -173,6 +178,12 @@
         <if test="accreditationRecords.idCardNo!=null and  accreditationRecords.idCardNo!=''">
             and bu.cardid like concat('%', #{accreditationRecords.idCardNo},'%')
         </if>
+        <if test="accreditationRecords.status==1">
+            and sar.status = #{accreditationRecords.status}
+        </if>
+        <if test="accreditationRecords.status==2">
+            and sar.status = #{accreditationRecords.status}
+        </if>
         <if test="accreditationRecords.securityNumber!=null and  accreditationRecords.securityNumber!=''">
             and bu.securitynumber like concat('%', #{accreditationRecords.securityNumber},'%')
         </if>
@@ -202,6 +213,9 @@
         </if>
         <if test="accreditationRecords.isAvatar==2">
             and (bu.avatar is null or bu.avatar="")
+        </if>
+        <if test="accreditationRecords.auditStatus!=null">
+            and sar.audit_status = #{accreditationRecords.auditStatus}
         </if>
         <if test="accreditationRecords.startTime!=null and accreditationRecords.startTime!='' and accreditationRecords.startTime!='undefined'">
             and sar.create_time &gt;= #{accreditationRecords.startTime}
@@ -272,6 +286,12 @@
         </if>
         <if test="accreditationRecords.securityNumber!=null and  accreditationRecords.securityNumber!=''">
             and bu.securitynumber like concat('%', #{accreditationRecords.securityNumber},'%')
+        </if>
+        <if test="accreditationRecords.status==1">
+            and sar.status = #{accreditationRecords.status}
+        </if>
+        <if test="accreditationRecords.status==2">
+            and sar.status = #{accreditationRecords.status}
         </if>
         <if test="accreditationRecords.jurisdiction!=null and accreditationRecords.jurisdiction!='' and accreditationRecords.jurisdiction!='1372091709474910209'">
             and (sj.id = #{accreditationRecords.jurisdiction} or sj.parent_id = #{accreditationRecords.jurisdiction})
@@ -376,6 +396,12 @@
         <if test="accreditationRecords.status!=null">
             and sar.status = #{accreditationRecords.status}
         </if>
+        <if test="accreditationRecords.status==1">
+            and sar.status = #{accreditationRecords.status}
+        </if>
+        <if test="accreditationRecords.status==2">
+            and sar.status = #{accreditationRecords.status}
+        </if>
         <if test="accreditationRecords.createUser!=null">
             and sar.create_user = #{accreditationRecords.createUser}
         </if>
@@ -414,6 +440,6 @@
 
     <!--根据用户 id 查询当前人员是否有待审核和审核通过的记录数-->
     <select id="getAccreditationRecordsByUserIdAuditCount" resultType="java.lang.Integer">
-        select count(*) from sys_accreditation_records where (audit_status = 1 or audit_status = 3) and user_id = #{userId} and type = 2
+        select count(*) from sys_accreditation_records where (audit_status = 1 or audit_status = 2) and user_id = #{userId} and type = #{type}
     </select>
 </mapper>

--
Gitblit v1.9.3