fuliqi
2024-08-09 b04753affc29f1042d0eb75b0af87824a0f4a8aa
ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml
@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ycl.platform.mapper.CheckIndexVideoMapper">
    <resultMap type="com.ycl.platform.domain.entity.CheckIndexVideo" id="CheckIndexVideoResult">
        <result property="id"    column="id"    />
        <result property="deptId"    column="dept_id"    />
@@ -38,10 +38,12 @@
    <select id="selectCheckIndexVideoList" parameterType="CheckIndexVideo" resultMap="CheckIndexVideoResult">
        select tciv.*,sd.dept_name
        from t_check_index_video tciv left join sys_dept sd on tciv.dept_id = sd.dept_id
        <where>
            <if test="deptId != null "> and dept_id = #{deptId}</if>
        <where>
            <if test="deptId != null "> and tciv.dept_id = #{deptId}</if>
            <if test="examineTag != null "> and examine_tag = #{examineTag}</if>
            <if test="date != null "> and  date_format(tciv.create_time,'%Y-%m') = #{date}</if>
            <if test="day != null "> and  date(tciv.create_time) = #{day}</if>
            <if test="createTime != null "> and  date(tciv.create_time) = #{createTime}</if>
            <if test="platformOnline != null "> and platform_online = #{platformOnline}</if>
            <if test="monitorQualification != null "> and monitor_qualification = #{monitorQualification}</if>
            <if test="monitorRegistration != null "> and monitor_registration = #{monitorRegistration}</if>
@@ -62,14 +64,19 @@
            <if test="videoTransmissionDangerousAssetsScore != null "> and video_transmission_dangerous_assets_score = #{videoTransmissionDangerousAssetsScore}</if>
            <if test="videoTransmissionBoundaryIntegrityDetection != null "> and video_transmission_boundary_integrity_detection = #{videoTransmissionBoundaryIntegrityDetection}</if>
            <if test="operatingRate != null "> and operating_rate = #{operatingRate}</if>
            <if test="deptIds != null ">and tciv.dept_id in
            <foreach collection="deptIds" separator="," open="(" close=")" item="deptId">
                #{deptId}
            </foreach>
            </if>
        </where>
    </select>
    <select id="selectCheckIndexVideoById"  resultMap="CheckIndexVideoResult">
        <include refid="selectCheckIndexVideoVo"/>
        where id = #{id}
    </select>
    <insert id="insertCheckIndexVideo" useGeneratedKeys="true" keyProperty="id">
        insert into t_check_index_video
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -159,9 +166,56 @@
    </delete>
    <delete id="deleteCheckIndexVideoByIds" >
        delete from t_check_index_video where id in
        delete from t_check_index_video where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
    <select id="selectToday">
        select * from t_check_index_video where DATE(create_time) = #{today}
    </select>
    <select id="dashboard" resultType="com.ycl.platform.domain.entity.CheckIndexVideo">
        SELECT
        IFNULL(ROUND(AVG(platform_online * 100), 2), 0) AS platform_online,
        IFNULL(ROUND(AVG(monitor_qualification * 100), 2), 0) AS monitor_qualification,
        IFNULL(ROUND(AVG(monitor_registration * 100), 2), 0) AS monitor_registration,
        IFNULL(ROUND(AVG(archives_rate * 100), 2), 0) AS archives_rate,
        IFNULL(ROUND(AVG(site_online * 100), 2), 0) AS site_online,
        IFNULL(ROUND(AVG(video_available * 100), 2), 0) AS video_available,
        IFNULL(ROUND(AVG(annotation_accuracy * 100), 2), 0) AS annotation_accuracy,
        IFNULL(ROUND(AVG(timing_accuracy * 100), 2), 0) AS timing_accuracy,
        IFNULL(ROUND(AVG(key_site_online * 100), 2), 0) AS key_site_online,
        IFNULL(ROUND(AVG(key_video_available * 100), 2), 0) AS key_video_available,
        IFNULL(ROUND(AVG(key_annotation_accuracy * 100), 2), 0) AS key_annotation_accuracy,
        IFNULL(ROUND(AVG(key_timing_accuracy * 100), 2), 0) AS key_timing_accuracy,
        IFNULL(ROUND(AVG(key_command_image_inspection * 100), 2), 0) AS key_command_image_inspection,
        IFNULL(ROUND(AVG(key_command_image_directory_tree * 100), 2), 0) AS key_command_image_directory_tree,
        IFNULL(ROUND(AVG(online_inspection_platform * 100), 2), 0) AS online_inspection_platform,
        IFNULL(ROUND(AVG(video_transmission_assets_accuracy * 100), 2), 0) AS video_transmission_assets_accuracy,
        IFNULL(ROUND(AVG(video_transmission_assets_weak_password_score * 100), 2), 0) AS video_transmission_assets_weak_password_score,
        IFNULL(ROUND(AVG(video_transmission_dangerous_assets_score * 100), 2), 0) AS video_transmission_dangerous_assets_score,
        IFNULL(ROUND(AVG(video_transmission_boundary_integrity_detection * 100), 2), 0) AS video_transmission_boundary_integrity_detection,
        IFNULL(ROUND(AVG(operating_rate * 100), 2), 0) AS operating_rate,
        IFNULL(ROUND(AVG(key_command_image_online * 100), 2), 0) AS key_command_image_online
        FROM
        t_check_index_video
        <where>
            <if test="deptId != null">
                AND dept_id = #{deptId}
            </if>
            <if test="dataScope == 1">
                AND examine_tag = 1
            </if>
        </where>
        ORDER BY
        create_time DESC
        <if test="deptId == null">
            LIMIT 7
        </if>
        <if test="deptId != null">
            LIMIT 1
        </if>
    </select>
</mapper>