智慧保安后台管理-外网项目备份
guoshilong
2023-12-23 ffba4c1baea0c7cedd2a70cfc56101fb0b58da25
src/main/java/org/springblade/modules/accreditation/mapper/AccreditationRecordsMapper.xml
@@ -12,10 +12,10 @@
            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
        FROM
            sys_accreditation_records sar
@@ -23,28 +23,13 @@
            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.deptName!=null and  accreditationRecords.deptName!=''">
@@ -343,38 +328,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>