南昌市物联网技防平台-后台
Administrator
2021-05-07 87051d81f28facb8447fb65b9ba294ea3827563a
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/equipment/mapper/EquipmentMapper.xml
@@ -478,4 +478,29 @@
    <select id="selectEqCg" resultType="Integer">
        select COUNT(*) from sys_equipment where heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=3
    </select>
    <!--查询所有的设备,不包含故障和警情状态-->
    <select id="selAllEq" resultType="org.springblade.jfpt.equipment.entity.Equipment">
       select id,dtype,heartbeat from sys_equipment where dtype!=2 and dtype!=3
    </select>
    <!--批量更新设备状态改为在线-->
    <update id="updateEqListz" parameterType="java.util.Map">
        UPDATE sys_equipment
            SET dtype = 1
        WHERE id IN
        <foreach collection="equipmentListz" index="index" item="id" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>
    <!--批量更新设备状态改为离线-->
    <update id="updateEqListl" parameterType="java.util.Map">
        UPDATE sys_equipment
            SET dtype = 0
        WHERE id IN
        <foreach collection="equipmentListl" index="index" item="id" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>
</mapper>