xiangpei
2024-09-09 6707cf22587cba66f79a29145cc735a7c029dd05
ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
@@ -300,12 +300,9 @@
        IFNULL(SUM(IF(on_state = 2, 1, 0)), 0) AS postsPercentage,
        IFNULL(ROUND(SUM(IF(on_state = 1, 1, 0)) / count(*) * 100, 2), 0) as viewsPercentage
        FROM t_monitor m
        left join t_yw_point p on m.serial_number = p.serial_number
        left join sys_dept d on p.dept_id = d.dept_id
        <where>
            camera_fun_type like concat('%', #{cameraFunType}, '%')
        </where>
        ${params.dataScope}
    </select>
    <select id="recoveryException" resultType="java.util.Map">
@@ -576,4 +573,26 @@
    <delete id="deleteAll">
        delete from t_monitor
    </delete>
    <select id="getGBbyGB" resultType="string">
        SELECT
            DISTINCT serial_number
        FROM
             t_monitor
        WHERE
              serial_number in <foreach collection="gbList" open="(" separator="," close=")" item="no">#{no}</foreach>
    </select>
    <select id="getDistinctIP" resultType="string">
        SELECT
            DISTINCT ip
        FROM
            t_monitor
    </select>
    <update id="updateOnline">
        update t_yw_ponit set online = #{online.online}, update_time = #{online.updateTime} WHERE EXISTS (
                                                                                                          SELECT 1 FROM t_monitor WHERE ip = #{online.ip} AND t_monitor.serial_number = t_yw_point.serial_number
                                                                                                      );
    </update>
</mapper>