Administrator
2021-11-29 f90bf0ad759738711466f82b3671f95356f34718
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -229,7 +229,25 @@
        and bd.id != 1425365577303621633
        and bd.id != 1432625856013971457
        <if test="user.deptId!=null and user.deptId!=''">
            and (bd.id = #{user.deptId} or bd.parent_id = #{user.deptId})
            and bd.id in
            (
                select id from blade_dept where id = #{user.deptId}
                union
                SELECT
                id
                FROM
                (
                SELECT
                t1.id,t1.parent_id,t1.dept_name,
                IF
                ( find_in_set( parent_id, @pids ) > 0, @pids := concat( @pids, ',', id ), 0 ) AS ischild
                FROM
                ( SELECT id, parent_id,dept_name FROM blade_dept t ORDER BY parent_id, id ) t1,
                ( SELECT @pids := #{user.deptId} ) t2
                ) t3
                WHERE
                ischild != 0
            )
        </if>
        <if test="user.cardid!=null and user.cardid != ''">
            and bu.cardid like concat(concat('%', #{user.cardid}),'%')
@@ -411,7 +429,25 @@
            and bu.securitynumber like concat('%', #{user.securitynumber},'%')
        </if>
        <if test="user.deptId!=null and user.deptId!=''">
            and (bd.id = #{user.deptId} or bd.parent_id = #{user.deptId})
            and bd.id in
            (
            select id from blade_dept where id = #{user.deptId}
            union
            SELECT
            id
            FROM
            (
            SELECT
            t1.id,t1.parent_id,t1.dept_name,
            IF
            ( find_in_set( parent_id, @pids ) > 0, @pids := concat( @pids, ',', id ), 0 ) AS ischild
            FROM
            ( SELECT id, parent_id,dept_name FROM blade_dept t ORDER BY parent_id, id ) t1,
            ( SELECT @pids := #{user.deptId} ) t2
            ) t3
            WHERE
            ischild != 0
            )
        </if>
        <if test="user.startTime!=null and user.startTime!=''">
            and bu.paper_time &gt;= #{user.startTime}