|
|
@@ -1,29 +1,38 @@
|
|
|
<?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.xunmei.iot.mapper.IotDvrChannelMapper">
|
|
|
- <resultMap id="alarmHostStatusMap" type="com.xunmei.iot.vo.dvrDisk.DvrDiskPageVo">
|
|
|
- <result column="id" property="id"/>
|
|
|
- <result column="equipmentCode" property="equipmentCode"/>
|
|
|
- <result column="equipmentName" property="equipmentName"/>
|
|
|
- <result column="ip" property="ip"/>
|
|
|
- <result column="orgId" property="orgId"/>
|
|
|
- <result column="orgName" property="orgName"/>
|
|
|
- <result column="status" property="status"/>
|
|
|
- <result column="alarmTime" property="alarmTime"/>
|
|
|
- <result column="detailInfo" property="detailInfo"
|
|
|
- typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
|
|
|
- <collection property="diskInfos" column="equipmentCode=equipmentCode"
|
|
|
- select="selectDiskInfo">
|
|
|
- <result column="id" property="id"/>
|
|
|
- <result column="available" property="available"/>
|
|
|
- <result column="diskSerialNum" property="diskSerialNum"/>
|
|
|
- <result column="total" property="total"/>
|
|
|
- <result column="hostCode" property="hostCode"/>
|
|
|
- <result column="orgId" property="orgId"/>
|
|
|
- </collection>
|
|
|
+ <resultMap id="diagnosisDetailMap" type="com.xunmei.iot.vo.videoDiagnosis.VideoDiagnosisWebVo">
|
|
|
+ <result column="hostName" property="hostName"></result>
|
|
|
+ <result column="channelName" property="channelName"></result>
|
|
|
+ <result column="channelIp" property="channelIp"></result>
|
|
|
+ <association property="quality" javaType="com.xunmei.iot.vo.videoDiagnosis.VideoDiagnosisQualityVo">
|
|
|
+ <result column="quality_update_time" property="updateTime"></result>
|
|
|
+ <result column="quality_signal_lost" property="signalLost"></result>
|
|
|
+ <result column="quality_occlude" property="occlude"></result>
|
|
|
+ <result column="quality_brightness" property="brightness"></result>
|
|
|
+ <result column="quality_colorCast" property="colorCast"></result>
|
|
|
+ <result column="quality_snowflake" property="snowflake"></result>
|
|
|
+ <result column="quality_stripe" property="stripe"></result>
|
|
|
+ <result column="quality_contrast" property="contrast"></result>
|
|
|
+ <result column="quality_blurry" property="blurry"></result>
|
|
|
+ <result column="quality_image" property="image"></result>
|
|
|
+ </association>
|
|
|
+ <association property="integrity" javaType="com.xunmei.iot.vo.videoDiagnosis.VideoDiagnosisIntegrityVo">
|
|
|
+ <result column="integrity_record_date" property="recordDate"></result>
|
|
|
+ <result column="integrity_lost_duration" property="lostDuration"></result>
|
|
|
+ <result column="integrity_lost_span" property="lostSpan"></result>
|
|
|
+ <result column="integrity_update_time" property="updateTime"></result>
|
|
|
+ </association>
|
|
|
+ <association property="storage" javaType="com.xunmei.iot.vo.videoDiagnosis.VideoDiagnosisStorageVo">
|
|
|
+ <result column="storage_plan_days" property="planDays"></result>
|
|
|
+ <result column="storage_real_days" property="realDays"></result>
|
|
|
+ <result column="storage_earliest_video_time" property="earliestTime"></result>
|
|
|
+ <result column="storage_lose_date_str" property="lostDateStr"></result>
|
|
|
+ </association>
|
|
|
</resultMap>
|
|
|
- <select id="selectPage" resultType="alarmHostStatusMap">
|
|
|
+ <select id="selectPage" resultType="com.xunmei.iot.vo.videoDiagnosis.VideoDiagnosisWebPageVo">
|
|
|
SELECT
|
|
|
+ c.id,
|
|
|
c.host_code,
|
|
|
c.channel_code,
|
|
|
c.org_name,
|
|
|
@@ -35,11 +44,14 @@
|
|
|
vdr.signal_lost,
|
|
|
vdr.occlude,
|
|
|
if(vdr.brightness+vdr.color_cast+vdr.snowflake+vdr.stripe+vdr.contrast+vdr.blurry>1,1,0) as quality
|
|
|
- from iot_dvr_channel c
|
|
|
+ from iot_dvr_channel c
|
|
|
INNER JOIN iot_device d on c.host_code=d.equipment_code
|
|
|
left JOIN mediator_video_days_check vdc on c.host_code=vdc.equipment_code and c.channel_code=vdc.channel_code
|
|
|
- left JOIN mediator_video_integrity_check vic on c.host_code=vic.equipment_code and c.channel_code=vic.channel_code
|
|
|
- left JOIN mediator_video_diagnosis_record vdr on c.host_code=vdr.equipment_code and c.channel_code=vdr.channel_code
|
|
|
+ left JOIN mediator_video_integrity_check_newest vic on c.host_code=vic.equipment_code and
|
|
|
+ c.channel_code=vic.channel_code
|
|
|
+ left JOIN mediator_video_diagnosis_record vdr on c.host_code=vdr.equipment_code and
|
|
|
+ c.channel_code=vdr.channel_code
|
|
|
+ where c.deleted=0 and d.deleted=0
|
|
|
<if test="pageDto.checkSub==true">
|
|
|
and c.org_path like concat(#{orgPath},"%")
|
|
|
</if>
|
|
|
@@ -52,81 +64,48 @@
|
|
|
<if test="pageDto.channelName!=null and pageDto.channelName!=''">
|
|
|
and d.channel_name like concat('%', #{pageDto.channelName},'%')
|
|
|
</if>
|
|
|
- <if test="pageDto.status !=null">
|
|
|
- and dhd.`status` = #{pageDto.status}
|
|
|
+ <if test="pageDto.integrityState!=null">
|
|
|
+ and vic.status=#{pageDto.integrityState}
|
|
|
</if>
|
|
|
- <if test="pageDto.alarmStartTime !=null">
|
|
|
- and dhd.alarm_time >= #{pageDto.alarmStartTime}
|
|
|
+ <if test="pageDto.daysState!=null">
|
|
|
+ and vdc.status=#{pageDto.daysState}
|
|
|
</if>
|
|
|
- <if test="pageDto.alarmEndTime !=null">
|
|
|
- and #{pageDto.alarmEndTime}>= dhd.`alarm_time`
|
|
|
+ <if test="pageDto.diagnosisState!=null">
|
|
|
+ and vdr.is_alarm=#{pageDto.diagnosisState}
|
|
|
</if>
|
|
|
- and d.deleted=0
|
|
|
+<!-- <if test="pageDto.status !=null">-->
|
|
|
+<!-- and dhd.`status` = #{pageDto.status}-->
|
|
|
+<!-- </if>-->
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectDiskInfo" resultType="com.xunmei.common.core.domain.iot.domain.IotDvrDisk">
|
|
|
- select id,
|
|
|
- available,
|
|
|
- `disk_serial_num` as diskSerialNum,
|
|
|
- `str_name` as `strName`,
|
|
|
- `total`,
|
|
|
- `host_code` as `hostCode`,
|
|
|
- `org_id` as `orgId`
|
|
|
- from iot_dvr_disk
|
|
|
- where host_code = #{equipmentCode}
|
|
|
- </select>
|
|
|
- <select id="getRecordAlarmHistoryList"
|
|
|
- resultType="com.xunmei.iot.vo.dvrDisk.DvrDiskAlarmHistoryPageVo">
|
|
|
+ <select id="diagnosisDetail" resultMap="diagnosisDetailMap">
|
|
|
SELECT
|
|
|
- r.id,
|
|
|
- r.org_id AS orgId,
|
|
|
- r.org_name AS orgName,
|
|
|
- r.device_name AS deviceName,
|
|
|
- r.alarm_status as status,
|
|
|
- r.alarm_type AS alarmType,
|
|
|
- r.alarm_start_time AS alarmStartTime,
|
|
|
- r.alarm_end_time AS alarmEndTime,
|
|
|
- r.alarm_detail as alarmDetail
|
|
|
- FROM
|
|
|
- t_host_alarm_record r
|
|
|
- where r.device_type=3713671510851584 AND r.assets_type=3713670431768576
|
|
|
-
|
|
|
- <if test="pageDto.deviceId != null">
|
|
|
- and r.device_id = #{pageDto.deviceId}
|
|
|
- </if>
|
|
|
- <if test="pageDto.status != null">
|
|
|
- and r.alarm_status = #{pageDto.status}
|
|
|
- </if>
|
|
|
- <if test="pageDto.diskName != null">
|
|
|
- and r.alarm_detail like concat('%"',#{pageDto.diskName},'"%')
|
|
|
- </if>
|
|
|
- <if test="pageDto.alarmCode != null">
|
|
|
- and r.alarm_code= #{pageDto.alarmCode}
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="pageDto.alarmStartTime != null and pageDto.alarmEndTime != null">
|
|
|
- and ((r.alarm_start_time is not null and r.alarm_end_time is not null and
|
|
|
- r.alarm_end_time>=#{pageDto.alarmStartTime} and #{pageDto.alarmEndTime}>=r.alarm_start_time)
|
|
|
- or (r.alarm_end_time is null and r.alarm_start_time>= #{pageDto.alarmStartTime} and #{pageDto.alarmEndTime}>=r.alarm_start_time )
|
|
|
- or (r.alarm_start_time is null and r.alarm_end_time>= #{pageDto.alarmStartTime} and #{pageDto.alarmEndTime}>=r.alarm_end_time)
|
|
|
- )
|
|
|
- </if>
|
|
|
- order by r.alarm_start_time desc
|
|
|
+ d.equipment_name as hostName,
|
|
|
+ c.channel_name as channelName,
|
|
|
+ c.channel_addr as channelIp,
|
|
|
+ vdr.update_time as quality_update_time,
|
|
|
+ vdr.signal_lost as quality_signal_lost,
|
|
|
+ vdr.occlude as quality_occlude,
|
|
|
+ vdr.brightness as quality_brightness,
|
|
|
+ vdr.color_cast as quality_colorCast,
|
|
|
+ vdr.snowflake as quality_snowflake,
|
|
|
+ vdr.stripe as quality_stripe,
|
|
|
+ vdr.contrast as quality_contrast,
|
|
|
+ vdr.blurry as quality_blurry,
|
|
|
+ vdr.img_url as quality_image,
|
|
|
+ vic.record_date as integrity_record_date,
|
|
|
+ vic.lose_duration as integrity_lost_duration,
|
|
|
+ vic.lose_span as integrity_lost_span,
|
|
|
+ vic.update_time as integrity_update_time,
|
|
|
+ vdc.plan_days as storage_plan_days,
|
|
|
+ vdc.real_days as storage_real_days,
|
|
|
+ vdc.earliest_video_time as storage_earliest_video_time,
|
|
|
+ vdc.lose_date as storage_lose_date_str
|
|
|
+ FROM iot_dvr_channel c
|
|
|
+ INNER JOIN iot_device d ON c.host_code = d.equipment_code
|
|
|
+ LEFT JOIN mediator_video_days_check vdc ON c.host_code = vdc.equipment_code AND c.channel_code = vdc.channel_code
|
|
|
+ LEFT JOIN mediator_video_integrity_check_newest vic ON c.host_code = vic.equipment_code AND c.channel_code = vic.channel_code
|
|
|
+ LEFT JOIN mediator_video_diagnosis_record vdr ON c.host_code = vdr.equipment_code AND c.channel_code = vdr.channel_code
|
|
|
+ WHERE c.host_code=#{hostCode} and c.channel_code=#{channelCode}
|
|
|
</select>
|
|
|
-
|
|
|
- <select id="diskStatistic" resultType="com.xunmei.iot.vo.dvrDisk.DvrDiskStatisticVo">
|
|
|
- SELECT count(0) AS dvrTotal,
|
|
|
- SUM(DD.count) AS diskTotal,
|
|
|
- SUM(dd.exceptionCount) as diskExceptionCount
|
|
|
- FROM iot_device d
|
|
|
- LEFT JOIN (SELECT equipment_code,count(0) as count,SUM(if(state=1,1,0)) as exceptionCount from iot_dvr_disk WHERE deleted=0 ) dd on d.equipment_code =dd.equipment_code
|
|
|
- where d.deleted=0 and d.category_id=#{pageDto.categoryId}
|
|
|
- <if test="pageDto.checkSub==true">
|
|
|
- and d.org_path like concat(#{orgPath},"%")
|
|
|
- </if>
|
|
|
- <if test="pageDto.checkSub==false">
|
|
|
- and d.org_id = #{request.orgId}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
-
|
|
|
</mapper>
|