龚焕茏
2024-04-24 4da3b0321291a1ad8a1341f8f843a41d4b516903
ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
@@ -57,7 +57,7 @@
            <if test="siteType != null "> and site_type = #{siteType}</if>
            <if test="macAddr != null  and macAddr != ''"> and mac_addr = #{macAddr}</if>
            <if test="ip != null  and ip != ''"> and ip = #{ip}</if>
            <if test="cameraFunType != null  and cameraFunType != ''"> and camera_fun_type = #{cameraFunType}</if>
            <if test="cameraFunType != null  and cameraFunType != ''"> and camera_fun_type like concat('%', #{cameraFunType}, '%')</if>
            <if test="longitude != null  and longitude != ''"> and longitude = #{longitude}</if>
            <if test="latitude != null  and latitude != ''"> and latitude = #{latitude}</if>
            <if test="cameraCaptureArea != null  and cameraCaptureArea != ''"> and camera_capture_area = #{cameraCaptureArea}</if>
@@ -225,4 +225,28 @@
            #{id}
        </foreach>
    </delete>
    <select id="getVideoCount" resultType="java.util.Map">
        SELECT count(*)                                                          AS totalPosts,
               IFNULL(SUM(IF(on_state = 1, 1, 0)), 0)                            AS totalMembers,
               IFNULL(SUM(IF(on_state = 2, 1, 0)), 0)                            AS postsPercentage,
               IFNULL(SUM(IF(default_order = 1, 1, 0)), 0)                       AS totalViews,
               -1                                                                as noStore,
               -1                                                                as partStore,
               IFNULL(ROUND(SUM(IF(on_state = 1, 1, 0)) / count(*) * 100, 2), 0) as viewsPercentage,
               -1                                                                as totalFace,
               -1                                                                as totalCar
        FROM t_monitor
        WHERE camera_fun_type like concat('%', #{cameraFunType}, '%')
    </select>
    <select id="recoveryException" resultType="java.util.Map">
        SELECT count(*)                                                          AS totalPosts,
               IFNULL(SUM(IF(on_state = 1, 1, 0)), 0)                            AS totalMembers,
               IFNULL(SUM(IF(on_state = 2, 1, 0)), 0)                            AS postsPercentage,
               IFNULL(SUM(IF(default_order = 1, 1, 0)), 0)                       AS totalViews,
               IFNULL(ROUND(SUM(IF(on_state = 1, 1, 0)) / count(*) * 100, 2), 0) as viewsPercentage
        FROM t_monitor
        WHERE recovery = 1
    </select>
</mapper>