智慧保安后台管理-外网项目备份
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -1241,4 +1241,77 @@
        </if>
    </select>
    <!--保安人员详情-->
    <select id="selectUIn" resultType="java.util.HashMap">
        SELECT
        u.real_name,
        u.securitynumber,
        u.cardid,
        u.phone,
        u.hold,
        u.soil,
        u.photo,
        u.examination_type,
        u.dispatch,
        bd.dept_name enterpriseName
        FROM
        blade_user u
        LEFT JOIN blade_dept bd ON bd.id = u.dept_id
        WHERE
        u.role_id = '1412226235153731586'
        AND u.is_deleted = 0
        AND u.`status` = 1
        and bd.is_deleted = 0
        <if test="deptid!=null and deptid!=''">
            and bd.id in
            (
            select id from blade_dept where id = #{deptid}
            union all
            (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 := #{deptid} ) t2
            ) t3
            WHERE
            ischild != 0
            )
            )
        </if>
        <if test="name!=null and name!=''">
            and real_name like concat('%', #{name},'%')
        </if>
        <if test="hold!=null and hold!=''">
            <if test="hold==0">
                and hold=#{hold}
            </if>
            <if test="hold==1">
                and hold=#{hold}
            </if>
        </if>
        <if test="photo!=null and photo!=''">
            <if test="photo==0">
                AND avatar is not null and avatar!=""
            </if>
            <if test="photo==1">
                AND (avatar is null or avatar = "")
            </if>
        </if>
        <if test="examinationtype!=null and examinationtype!=''">
            and examination_type=#{examinationtype}
        </if>
        <if test="dispatch!=null and dispatch!=''">
            and dispatch=#{dispatch}
        </if>
        <if test="soil !=null and soil !=''">
            and soil =#{soil}
        </if>
    </select>
</mapper>