wl
2022-12-08 dce06d7c00a9d617baa609b3f744f88a9789e754
fix: 事件Api
2个文件已修改
61 ■■■■■ 已修改文件
ycl-platform/src/main/java/com/ycl/vo/cockpit/enforcementEvents/EventVO.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/caseHandler/BaseCaseMapper.xml 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/vo/cockpit/enforcementEvents/EventVO.java
@@ -1,10 +1,21 @@
package com.ycl.vo.cockpit.enforcementEvents;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "事件")
public class EventVO {
    @ApiModelProperty(value = "事件经度")
    private String longitude;
    @ApiModelProperty(value = "事件纬度")
    private String latitude;
    @ApiModelProperty(value = "事件类型")
    private String type;
    @ApiModelProperty(value = "告警设备")
    private String alarmAdvice;
    @ApiModelProperty(value = "事件描述")
    private String description;
    @ApiModelProperty(value = "事发地点")
ycl-platform/src/main/resources/mapper/caseHandler/BaseCaseMapper.xml
@@ -229,17 +229,17 @@
    </select>
    <select id="selectVideoInspection" resultType="com.ycl.vo.casePool.BaseCaseVO">
        SELECT t1.id         as baseId,
        SELECT t1.id            as baseId,
               t1.`code`,
               t3.`name`,
               t3.url_address,
               t3.longitude,
               t3.latitude,
               t4.pic_data,
               t5.`name`     as grade,
               t6.`region_name`     as street,
               t7.`region_name`     as community,
               t1.alarm_time as alarmTime
               t5.`name`        as grade,
               t6.`region_name` as street,
               t7.`region_name` as community,
               t1.alarm_time    as alarmTime
        FROM ums_base_case t1
                 LEFT JOIN ums_violations t2 ON t1.id = t2.id
                 LEFT JOIN ums_video_point t3 on t2.video_point_id = t3.id
@@ -263,35 +263,39 @@
    </select>
    <select id="dispatchCount" resultType="java.lang.Integer">
        select count(1)
        FROM
            ums_base_case t1
                LEFT JOIN ums_dispose_record t2 ON t1.id = t2.base_case_id
        WHERE
            t2.workflow_config_step_id =1
        FROM ums_base_case t1
                 LEFT JOIN ums_dispose_record t2 ON t1.id = t2.base_case_id
        WHERE t2.workflow_config_step_id = 1
    </select>
    <select id="alCount" resultType="java.lang.Integer">
        select count(1)
        FROM
            ums_base_case WHERE event_source=1;
        FROM ums_base_case
        WHERE event_source = 1;
    </select>
    <select id="selectEventList" resultType="com.ycl.vo.cockpit.enforcementEvents.EventVO">
        SELECT
            t1.alarm_time,
            ( CASE WHEN t1.event_source = 1 THEN "视频巡查" WHEN t1.event_source = 2 THEN "人工上报" ELSE "其他" END ) AS source,
            t1.site AS address,
            t2.description,
            t3.`name` AS point,
            t4.pic_data AS picture
        t1.alarm_time,
        t1.longitude,
        t1.latitude,
        ( CASE WHEN t1.category = 1 THEN "违规" WHEN t1.category = 2 THEN "违建" ELSE "其他" END ) AS type,
        ( CASE WHEN t1.event_source = 1 THEN "视频巡查" WHEN t1.event_source = 2 THEN "人工上报" ELSE "其他" END ) AS alarmAdvice,
        ( CASE WHEN t1.event_source = 1 THEN "视频巡查" WHEN t1.event_source = 2 THEN "人工上报" ELSE "其他" END ) AS source,
        t1.site AS address,
        t2.description,
        t3.`name` AS point,
        t4.pic_data AS picture
        FROM
            ums_base_case t1
                LEFT JOIN ums_violations t2 ON t1.id = t2.id
                LEFT JOIN ums_video_point t3 ON t3.id = t2.video_point_id
                LEFT JOIN ums_video_alarm_report t4 ON t4.id = t2.video_alarm_report_id
        ums_base_case t1
        LEFT JOIN ums_violations t2 ON t1.id = t2.id
        LEFT JOIN ums_video_point t3 ON t3.id = t2.video_point_id
        LEFT JOIN ums_video_alarm_report t4 ON t4.id = t2.video_alarm_report_id
        <where>
            t1.category=1
            <if test="beginTime !=''and beginTime!=null and endTime!=''and endTime!=null">
                t1.create_time BETWEEN #{beginTime}
              and  t1.create_time BETWEEN #{beginTime}
                AND #{endTime}
            </if>
        </where>
    </select>