From 3e9a6da99aae968123ee7bca352fc08becd7f1f2 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 29 八月 2024 17:29:21 +0800
Subject: [PATCH] 工单过程图接口更换
---
ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml | 139 ++++++++++++++++++++++++++++++----------------
1 files changed, 90 insertions(+), 49 deletions(-)
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml
index 9279f6a..1c42656 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml
+++ b/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" />
@@ -21,27 +21,23 @@
<result property="keyVideoAvailable" column="key_video_available" />
<result property="keyAnnotationAccuracy" column="key_annotation_accuracy" />
<result property="keyTimingAccuracy" column="key_timing_accuracy" />
- <result property="keyCommandImageInspection" column="key_command_image_inspection" />
- <result property="keyCommandImageDirectoryTree" column="key_command_image_directory_tree" />
- <result property="onlineInspectionPlatform" column="online_inspection_platform" />
- <result property="videoTransmissionAssetsAccuracy" column="video_transmission_assets_accuracy" />
- <result property="videoTransmissionAssetsWeakPasswordScore" column="video_transmission_assets_weak_password_score" />
- <result property="videoTransmissionDangerousAssetsScore" column="video_transmission_dangerous_assets_score" />
- <result property="videoTransmissionBoundaryIntegrityDetection" column="video_transmission_boundary_integrity_detection" />
- <result property="operatingRate" column="operating_rate" />
+ <result property="keyCommandImageOnline" column="key_command_image_online" />
+ <result property="imageResourceSecurity" column="image_resource_security" />
</resultMap>
<sql id="selectCheckIndexVideoVo">
- select id, dept_id, create_time, examine_tag, platform_online, monitor_qualification, monitor_registration, archives_rate, site_online, video_available, annotation_accuracy, timing_accuracy, key_site_online, key_video_available, key_annotation_accuracy, key_timing_accuracy, key_command_image_inspection, key_command_image_directory_tree, online_inspection_platform, video_transmission_assets_accuracy, video_transmission_assets_weak_password_score, video_transmission_dangerous_assets_score, video_transmission_boundary_integrity_detection, operating_rate from t_check_index_video
+ select id, dept_id, create_time, examine_tag, platform_online, monitor_qualification, monitor_registration, archives_rate, site_online, video_available, annotation_accuracy, timing_accuracy, key_site_online, key_video_available, key_annotation_accuracy, key_timing_accuracy, key_command_image_online,image_resource_security from t_check_index_video
</sql>
<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>
@@ -54,22 +50,21 @@
<if test="keyVideoAvailable != null "> and key_video_available = #{keyVideoAvailable}</if>
<if test="keyAnnotationAccuracy != null "> and key_annotation_accuracy = #{keyAnnotationAccuracy}</if>
<if test="keyTimingAccuracy != null "> and key_timing_accuracy = #{keyTimingAccuracy}</if>
- <if test="keyCommandImageInspection != null "> and key_command_image_inspection = #{keyCommandImageInspection}</if>
- <if test="keyCommandImageDirectoryTree != null "> and key_command_image_directory_tree = #{keyCommandImageDirectoryTree}</if>
- <if test="onlineInspectionPlatform != null "> and online_inspection_platform = #{onlineInspectionPlatform}</if>
- <if test="videoTransmissionAssetsAccuracy != null "> and video_transmission_assets_accuracy = #{videoTransmissionAssetsAccuracy}</if>
- <if test="videoTransmissionAssetsWeakPasswordScore != null "> and video_transmission_assets_weak_password_score = #{videoTransmissionAssetsWeakPasswordScore}</if>
- <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="keyCommandImageOnline != null "> and key_command_image_online = #{keyCommandImageOnline}</if>
+ <if test="imageResourceSecurity != null "> and image_resource_security = #{imageResourceSecurity}</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=",">
@@ -88,15 +83,9 @@
<if test="keyVideoAvailable != null">key_video_available,</if>
<if test="keyAnnotationAccuracy != null">key_annotation_accuracy,</if>
<if test="keyTimingAccuracy != null">key_timing_accuracy,</if>
- <if test="keyCommandImageInspection != null">key_command_image_inspection,</if>
- <if test="keyCommandImageDirectoryTree != null">key_command_image_directory_tree,</if>
- <if test="onlineInspectionPlatform != null">online_inspection_platform,</if>
- <if test="videoTransmissionAssetsAccuracy != null">video_transmission_assets_accuracy,</if>
- <if test="videoTransmissionAssetsWeakPasswordScore != null">video_transmission_assets_weak_password_score,</if>
- <if test="videoTransmissionDangerousAssetsScore != null">video_transmission_dangerous_assets_score,</if>
- <if test="videoTransmissionBoundaryIntegrityDetection != null">video_transmission_boundary_integrity_detection,</if>
- <if test="operatingRate != null">operating_rate,</if>
- </trim>
+ <if test="keyCommandImageOnline != null">key_command_image_online,</if>
+ <if test="imageResourceSecurity != null">image_resource_security,</if>
+ </trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deptId != null">#{deptId},</if>
<if test="createTime != null">#{createTime},</if>
@@ -113,14 +102,8 @@
<if test="keyVideoAvailable != null">#{keyVideoAvailable},</if>
<if test="keyAnnotationAccuracy != null">#{keyAnnotationAccuracy},</if>
<if test="keyTimingAccuracy != null">#{keyTimingAccuracy},</if>
- <if test="keyCommandImageInspection != null">#{keyCommandImageInspection},</if>
- <if test="keyCommandImageDirectoryTree != null">#{keyCommandImageDirectoryTree},</if>
- <if test="onlineInspectionPlatform != null">#{onlineInspectionPlatform},</if>
- <if test="videoTransmissionAssetsAccuracy != null">#{videoTransmissionAssetsAccuracy},</if>
- <if test="videoTransmissionAssetsWeakPasswordScore != null">#{videoTransmissionAssetsWeakPasswordScore},</if>
- <if test="videoTransmissionDangerousAssetsScore != null">#{videoTransmissionDangerousAssetsScore},</if>
- <if test="videoTransmissionBoundaryIntegrityDetection != null">#{videoTransmissionBoundaryIntegrityDetection},</if>
- <if test="operatingRate != null">#{operatingRate},</if>
+ <if test="keyCommandImageOnline != null">#{keyCommandImageOnline},</if>
+ <if test="imageResourceSecurity != null">#{imageResourceSecurity},</if>
</trim>
</insert>
@@ -142,14 +125,8 @@
<if test="keyVideoAvailable != null">key_video_available = #{keyVideoAvailable},</if>
<if test="keyAnnotationAccuracy != null">key_annotation_accuracy = #{keyAnnotationAccuracy},</if>
<if test="keyTimingAccuracy != null">key_timing_accuracy = #{keyTimingAccuracy},</if>
- <if test="keyCommandImageInspection != null">key_command_image_inspection = #{keyCommandImageInspection},</if>
- <if test="keyCommandImageDirectoryTree != null">key_command_image_directory_tree = #{keyCommandImageDirectoryTree},</if>
- <if test="onlineInspectionPlatform != null">online_inspection_platform = #{onlineInspectionPlatform},</if>
- <if test="videoTransmissionAssetsAccuracy != null">video_transmission_assets_accuracy = #{videoTransmissionAssetsAccuracy},</if>
- <if test="videoTransmissionAssetsWeakPasswordScore != null">video_transmission_assets_weak_password_score = #{videoTransmissionAssetsWeakPasswordScore},</if>
- <if test="videoTransmissionDangerousAssetsScore != null">video_transmission_dangerous_assets_score = #{videoTransmissionDangerousAssetsScore},</if>
- <if test="videoTransmissionBoundaryIntegrityDetection != null">video_transmission_boundary_integrity_detection = #{videoTransmissionBoundaryIntegrityDetection},</if>
- <if test="operatingRate != null">operating_rate = #{operatingRate},</if>
+ <if test="keyCommandImageOnline != null">key_command_image_online = #{keyCommandImageOnline},</if>
+ <if test="imageResourceSecurity != null">image_resource_security = #{imageResourceSecurity},</if>
</trim>
where id = #{id}
</update>
@@ -159,9 +136,73 @@
</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>
\ No newline at end of file
+
+ <select id="selectToday" resultType="com.ycl.platform.domain.entity.CheckIndexVideo">
+ 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), 0), 0) AS platform_online,
+ IFNULL(ROUND(AVG(monitor_qualification * 100), 0), 0) AS monitor_qualification,
+ IFNULL(ROUND(AVG(monitor_registration * 100), 0), 0) AS monitor_registration,
+ IFNULL(ROUND(AVG(archives_rate * 100), 0), 0) AS archives_rate,
+ IFNULL(ROUND(AVG(site_online * 100), 0), 0) AS site_online,
+ IFNULL(ROUND(AVG(video_available * 100), 0), 0) AS video_available,
+ IFNULL(ROUND(AVG(annotation_accuracy * 100), 0), 0) AS annotation_accuracy,
+ IFNULL(ROUND(AVG(timing_accuracy * 100), 0), 0) AS timing_accuracy,
+ IFNULL(ROUND(AVG(key_site_online * 100), 0), 0) AS key_site_online,
+ IFNULL(ROUND(AVG(key_video_available * 100), 0), 0) AS key_video_available,
+ IFNULL(ROUND(AVG(key_annotation_accuracy * 100), 0), 0) AS key_annotation_accuracy,
+ IFNULL(ROUND(AVG(key_timing_accuracy * 100), 0), 0) AS key_timing_accuracy,
+ IFNULL(ROUND(AVG(key_command_image_online * 100), 0), 0) AS key_command_image_online,
+ IFNULL(ROUND(AVG(image_resource_security * 100), 0), 0) AS image_resource_security
+ 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>
+
+ <select id="selectAndDeptName" resultType="com.ycl.platform.domain.entity.CheckIndexVideo">
+ WITH temp AS (
+ SELECT
+ r.dept_id,
+ r.platform_online,
+ r.monitor_qualification,
+ d.area,
+ ROW_NUMBER() OVER(PARTITION BY r.dept_id ORDER BY r.create_time DESC) AS rn
+ FROM
+ t_check_index_video r
+ JOIN
+ sys_dept d ON r.dept_id = d.dept_id
+ )
+ SELECT
+ dept_id,
+ area as deptName,
+ platform_online,
+ monitor_qualification
+ FROM
+ temp
+ WHERE
+ rn = 1;
+ </select>
+</mapper>
--
Gitblit v1.8.0