智慧保安后台管理-外网项目备份
钟日健
2026-06-01 62eb499b0c969f246d3245d1429a97da4de1ce28
src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml
@@ -12,41 +12,30 @@
            bu.cardid idCardNo,
            bu.securitynumber securityNumber,
            bu.avatar,
            bud.permanent_residence_address as registered,
            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
            bu.user_type userType,
            bu.paper_time as userPaperTime
        FROM
            sys_accreditation_records sar
        left join
            blade_user bu
        on
            sar.user_id = bu.id
        LEFT JOIN
            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
        LEFT JOIN blade_user_detail bud ON bud.user_id = bu.id
        LEFT JOIN  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
        and bu.is_deleted = 0
        <if test="accreditationRecords.userPaperTime != null and accreditationRecords.userPaperTime !=''">
            AND DATE_FORMAT(bu.paper_time,'%Y-%m-%d')  = #{accreditationRecords.userPaperTime}
        </if>
        <if test="accreditationRecords.deptName!=null and  accreditationRecords.deptName!=''">
            and bt.dept_name like concat('%', #{accreditationRecords.deptName},'%')
        </if>
@@ -128,7 +117,7 @@
    </select>
    <!--导出保安员证信息-->
    <!--导出保安员证信息(上岗证)-->
    <select id="exportSecurityPaperList" resultType="org.springblade.modules.accreditation.vo.AccreditationRecordsVo">
        SELECT
        sar.*,
@@ -214,6 +203,9 @@
        <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}
        </if>
@@ -238,7 +230,8 @@
        ELT(sar.audit_status,"待审核","审核通过","审核不通过") auditStatus,
        sar.audit_time auditTime,
        sar.audit_detail auditDetail,
        if(bu.user_type=6,"是","否") userType
        if(bu.user_type=6,"是","否") userType,
        DATE_FORMAT(bu.paper_time,'%Y-%m-%d') as userPaperTime
        FROM
        sys_accreditation_records sar
        left join
@@ -269,6 +262,9 @@
        1=1
        and bu.status = 1
        and bu.is_deleted = 0
        <if test="accreditationRecords.userPaperTime != null and accreditationRecords.userPaperTime !=''">
            AND DATE_FORMAT(bu.paper_time,'%Y-%m-%d')  = #{accreditationRecords.userPaperTime}
        </if>
        <if test="accreditationRecords.deptName!=null and  accreditationRecords.deptName!=''">
            and bt.dept_name like concat('%', #{accreditationRecords.deptName},'%')
        </if>
@@ -340,38 +336,16 @@
        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
        blade_user bu
        on
        sar.user_id = bu.id
        LEFT JOIN
        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
        and bu.is_deleted = 0
        left join blade_user bu on sar.user_id = bu.id
        LEFT JOIN 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 and bu.is_deleted = 0
        <if test="accreditationRecords.deptName!=null and  accreditationRecords.deptName!=''">
            and bt.dept_name like concat('%', #{accreditationRecords.deptName},'%')
        </if>