智慧保安后台管理-外网
Administrator
2021-11-12 5cceb01ea15fa807ebe0011c5b38780cb3e3e2c3
src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml
@@ -34,6 +34,14 @@
        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
@@ -53,8 +61,17 @@
        <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}
@@ -123,6 +140,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
@@ -139,6 +172,21 @@
        <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.applyUnit!=null and  accreditationRecords.applyUnit!=''">
            and bt1.dept_name like concat('%', #{accreditationRecords.applyUnit},'%')
        </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.status!=null">
            and sar.status = #{accreditationRecords.status}
        </if>
@@ -156,4 +204,97 @@
        </if>
        order by sar.create_time desc
    </select>
    <!--导出证书制证信息-->
    <select id="exportSecurityBookPaper" resultType="org.springblade.modules.accreditation.excel.ExportSecurityBookPaperExcel">
        SELECT
        bu.real_name realName,
        bu.sex,bu.cardid idCardNo,
        bt.dept_name AS deptName,
        bu.securitynumber securityNumber,
        bu1.real_name applyName,
        bt1.dept_name applyUnit,
        sar.create_time createTime,
        ELT(sar.audit_status,"待审核","审核通过","审核不通过") auditStatus,
        sar.audit_time auditTime,
        sar.audit_detail auditDetail,
        if(bu.user_type=6,"是","否") 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
        <if test="accreditationRecords.deptName!=null and  accreditationRecords.deptName!=''">
            and bt.dept_name like concat('%', #{accreditationRecords.deptName},'%')
        </if>
        <if test="accreditationRecords.realName!=null and  accreditationRecords.realName!=''">
            and bu.real_name like concat('%', #{accreditationRecords.realName},'%')
        </if>
        <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>
        <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>
        <if test="accreditationRecords.endTime!=null and accreditationRecords.endTime!='' and accreditationRecords.endTime!='undefined'">
            and sar.create_time &lt;= #{accreditationRecords.endTime}
        </if>
        order by sar.create_time desc
    </select>
</mapper>