南昌市物联网技防平台-后台
zengh
2021-07-27 f3e1ec804ee6c86be99fdc1fd378d4fa467bb7b7
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/equipment/mapper/EquipmentMapper.xml
@@ -193,16 +193,19 @@
            and dtype=#{equipment.dtype}
        </if>
        <if test="dxtype!=null and dxtype == 0">
            and heartbeat &lt; DATE_SUB(NOW(),INTERVAL 1 DAY)  and dtype=0
            and  dtype=0
        </if>
        <if test="dxtype!=null and dxtype == 1">
            and heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=1
            and  dtype=1
        </if>
        <if test="dxtype!=null and dxtype == 2">
            and heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=2
            and  dtype=2
        </if>
        <if test="dxtype!=null and dxtype == 3">
            and heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY)  and dtype=3
            and dtype=3
        </if>
        <if test="dxtype!=null and dxtype == 4">
            and dtype!=0
        </if>
        <if test="pid!=null and pid!=''">
            and deptId like concat('%',#{pid},'%')
@@ -412,9 +415,9 @@
   dept.id,
   dept.deviceName,
   dept.deviceNumber,
   dept.deviceType,
   dept.serialNumber,
    dept.serialNumber,
   dept.channelNumber,
   dept.deviceType,
   dept.ownership,
   dept.ownerId,
   dept.devicestate,
@@ -451,12 +454,12 @@
    <!--查询设备在线数量-->
    <select id="selectEqCz" resultType="Integer">
        select COUNT(*) from sys_equipment where heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=1
        select COUNT(*) from sys_equipment where dtype=1
    </select>
    <!--查询设备掉线数量-->
    <select id="selectEqCd" resultType="Integer">
        select COUNT(*) from sys_equipment where heartbeat &lt; DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=0
        select COUNT(*) from sys_equipment where dtype=0
    </select>
    <!--查询预警设备数量-->
@@ -477,12 +480,12 @@
    <!--查询预警设备数量-->
    <select id="selectEqCys" resultType="Integer">
        select COUNT(*) from sys_equipment where heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=2
        select COUNT(*) from sys_equipment where dtype=2
    </select>
    <!--查询设故障数量-->
    <select id="selectEqCg" resultType="Integer">
        select COUNT(*) from sys_equipment where heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=3
        select COUNT(*) from sys_equipment where dtype=3
    </select>
    <!--查询所有的设备,不包含故障和警情状态-->
@@ -510,4 +513,40 @@
        </foreach>
    </update>
    <!--查询在线设备数量-->
    <select id="selectOnlineEqNum" resultType="java.lang.Integer">
        select COUNT(*) from sys_equipment where dtype=1 or dtype=2 or dtype=3
    </select>
    <!--获取设备视频播放的信息-->
    <select id="selectEquimentPlayInfo" resultType="org.springblade.jfpt.equipment.entity.EquipmentPlayInfo">
        select * from equipment_play_info
            where
        bmp=#{bmp}
            and
        number=#{number}
            and
        manufacturer =#{manufacturer}
    </select>
<!--    select id,number,serial_number serialNumber,bmp,address from equipment_play_info-->
    <!--新增设备视频播放的信息-->
    <insert id="saveEquipmentPlayInfo">
        INSERT INTO equipment_play_info
        (number, serial_number, manufacturer, bmp, address, create_time)
            VALUES
        (#{number}, #{serialNumber}, #{manufacturer}, #{bmp}, #{address}, #{createTime});
    </insert>
    <!--修改设备视频播放的信息-->
    <update id="updateEquipmentPlayInfo">
        update equipment_play_info
            set
        bmp=#{bmp},address=#{address}
            where
        id=#{id}
    </update>
</mapper>