智慧保安后台管理-外网项目备份
zhongrj
2023-09-17 8853292babb2ad94de4a3207966f1e83b767cd2d
src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherMapper.xml
@@ -15,7 +15,7 @@
    <!--派遣记录分页数据-->
    <select id="selectDispatcherPage" resultType="org.springblade.modules.dispatcher.vo.DispatcherVO">
        select
            sd.*,bu.real_name securityName,sdu.name dispatcherCompany,bu.cardid idCardNo
            sd.*,bu.real_name securityName,sdu.name dispatcherCompany,bu.cardid idCardNo,bd.dept_name deptName
        from
            sys_dispatcher sd
        left join
@@ -26,6 +26,10 @@
            blade_user bu
        on
            bu.id = sd.user_ids
        left join
            blade_dept bd
        on
            bd.id = bu.dept_id
        left join
            sys_jurisdiction sj
        on
@@ -40,9 +44,28 @@
            and sd.dispatcher_unit_id = #{dispatcher.dispatcherUnitId}
        </if>
        <if test="dispatcher.deptId!=null">
            and sd.dept_id = #{dispatcher.deptId}
            and sd.dept_id in
            (
                select id from blade_dept where id = #{dispatcher.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 := #{dispatcher.deptId} ) t2
                ) t3
                WHERE
                ischild != 0
            )
        </if>
        <if test="dispatcher.dispatch!=null and dispatcher.dispatch!=''">
            and bu.dispatch = #{dispatcher.dispatch}
            and sd.status = #{dispatcher.dispatch}
        </if>
        <if test="dispatcher.userIds!=null and  dispatcher.userIds!=''">
@@ -53,6 +76,9 @@
        </if>
        <if test="dispatcher.securityName!=null and  dispatcher.securityName!=''">
            and bu.real_name like concat('%', #{dispatcher.securityName},'%')
        </if>
        <if test="dispatcher.deptName!=null and  dispatcher.deptName!=''">
            and bd.dept_name like concat('%', #{dispatcher.deptName},'%')
        </if>
        <if test="dispatcher.cardid!=null and  dispatcher.cardid!=''">
            and sd.cardid like concat('%', #{dispatcher.cardid},'%')
@@ -90,6 +116,7 @@
        where
        1=1
        and dispatcher_unit_id = #{dispatcherUnitVO1.id}
        and status = 0
    </select>
    <!--查询用的派遣信息-->