<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.unis.visualization.modular.grainOilReserve.mapper.MonitorAIMapper">

    <select id="selectMonitorCount" resultType="java.lang.Integer">
        SELECT COUNT(id) AS totalCameras
        FROM monitor_camera where isremove=1
    </select>
    <select id="selectFaultMonitorCount" resultType="java.lang.Integer">
        SELECT COUNT(id) AS faultyCameras
        FROM monitor_camera
        WHERE isremove=1 and status IN (0, 2)

    </select>
    <select id="selectMonitorProportion" resultType="java.lang.Integer">
        SELECT COUNT(id) AS total_cameras
        FROM monitor_camera where isremove=1 and `status`=1
    </select>
</mapper>