智慧保安后台管理-外网项目备份
tangzy
2021-08-27 733edfcd6ad1c38dcf4aa761a417f4e4bfd754b2
src/main/java/org/springblade/modules/dispatcher/mapper/DispatcherMapper.xml
@@ -10,25 +10,32 @@
        <result column="dispatcher" property="dispatcher"/>
        <result column="dispatcherTime" property="dispatchertime"/>
        <result column="dispatcherAddress" property="dispatcheraddress"/>
        <result column="dispatchercompany" property="dispatchercompany"/>
    </resultMap>
<!--    <select id="selectDispatcherPage" resultMap="dispatcherResultMap">-->
<!--        select * from sys_dispatcher where is_deleted = 0-->
<!--    </select>-->
    <!--派遣记录分页数据-->
    <select id="selectDispatcherPage" resultType="org.springblade.modules.dispatcher.vo.DispatcherVO">
        select
            sd.*,sdu.name dispatcherCompany
            sd.*,bu.real_name securityName,sdu.name dispatcherCompany,bu.cardid
        from
            sys_dispatcher sd
        left join
            sys_dispatcher_unit sdu
        on
            sdu.id = sd.dispatcher_unit_id
        left join
            blade_user bu
        on
            bu.id = sd.user_ids
        where 1=1
        <if test="dispatcher.dispatcherUnitId!=null">
            and sd.dispatcher_unit_id = #{dispatcher.dispatcherUnitId}
        </if>
        <if test="dispatcher.deptId!=null">
            and sd.dept_id = #{dispatcher.deptId}
        </if>
        <if test="dispatcher.userIds!=null and  dispatcher.userIds!=''">
            and sd.user_ids like concat('%', #{dispatcher.userIds},'%')
        </if>
        <if test="dispatcher.name!=null and  dispatcher.name!=''">
            and sd.name like concat('%', #{dispatcher.name},'%')
        </if>
@@ -37,6 +44,12 @@
        </if>
        <if test="dispatcher.dispatcherCompany!=null and  dispatcher.dispatcherCompany!=''">
            and sdu.name like concat('%', #{dispatcher.dispatcherCompany},'%')
        </if>
        <if test="dispatcher.beginTime!=null and  dispatcher.beginTime!=''">
            and sd.dispatcherTime &gt;  #{dispatcher.beginTime}
        </if>
        <if test="dispatcher.overTime!=null and  dispatcher.overTime!=''">
            and sd.end_time &lt;  #{dispatcher.overTime}
        </if>
    </select>
@@ -56,4 +69,12 @@
        </if>
    </select>
    <!--派遣记录条数-->
    <select id="getDispatcherCount" resultType="java.lang.Integer">
        select ifnull(count(*),0) count from sys_dispatcher
        where
        1=1
        and dispatcher_unit_id = #{dispatcherUnitVO1.id}
    </select>
</mapper>