Преглед изворни кода

功能优化:下载已确认事件发生前后视频

lyq пре 10 месеци
родитељ
комит
bad59aec72
15 измењених фајлова са 92 додато и 312 уклоњено
  1. 1 1
      event-ui/src/api/event/eventcatalogue/eventcatalogue.js
  2. 27 10
      src/main/java/com/sooka/sponest/event/centereventteventcatalogue/controller/CentereventTDownloadsController.java
  3. 0 28
      src/main/java/com/sooka/sponest/event/centereventteventcatalogue/controller/CentereventTEventcatalogueController.java
  4. 3 3
      src/main/java/com/sooka/sponest/event/centereventteventcatalogue/mapper/CentereventTDownloadsMapper.java
  5. 0 3
      src/main/java/com/sooka/sponest/event/centereventteventcatalogue/mapper/CentereventTEventcatalogueMapper.java
  6. 2 3
      src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/ICentereventTDownloadsService.java
  7. 0 3
      src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/ICentereventTEventcatalogueService.java
  8. 25 10
      src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/impl/CentereventTDownloadsServiceImpl.java
  9. 0 29
      src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/impl/CentereventTEventcatalogueServiceImpl.java
  10. 0 44
      src/main/java/com/sooka/sponest/event/urge/domain/EventDown.java
  11. 0 33
      src/main/java/com/sooka/sponest/event/urge/listener/EventDownListener.java
  12. 0 15
      src/main/java/com/sooka/sponest/event/urge/service/EventDownService.java
  13. 0 64
      src/main/java/com/sooka/sponest/event/urge/service/impl/EventDownServiceImpl.java
  14. 0 36
      src/main/resources/mapper/centereventteventcatalogue/CentereventTEventcatalogueMapper.xml
  15. 34 30
      src/main/resources/mapper/download/CentereventTDownloadsMapper.xml

+ 1 - 1
event-ui/src/api/event/eventcatalogue/eventcatalogue.js

@@ -40,7 +40,7 @@ export function addEventcatalogue(data) {
 //下载事件的视频
 export function eventhandleDownload(id) {
   return request({
-    url: base + '/eventcatalogue/eventhandleDownload/' + id,
+    url: base + '/downloads/eventhandleDownload/' + id,
     method: 'get'
   })
 }

+ 27 - 10
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/controller/CentereventTDownloadsController.java

@@ -13,13 +13,13 @@ import com.ruoyi.common.security.annotation.RequiresPermissions;
 import com.ruoyi.system.api.RemoteConfigService;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTDownloads;
 import com.sooka.sponest.event.centereventteventcatalogue.service.ICentereventTDownloadsService;
-import com.sooka.sponest.event.centereventteventcatalogue.service.ICentereventTEventcatalogueService;
 import com.sooka.sponest.event.utils.EventConstants;
 import com.sooka.sponest.monitor.api.RemoteMonitorService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -37,9 +37,6 @@ public class CentereventTDownloadsController extends BaseController {
     private ICentereventTDownloadsService centereventTDownloadsService;
 
     @Autowired
-    private ICentereventTEventcatalogueService centereventTEventcatalogueService;
-
-    @Autowired
     private RemoteMonitorService remoteMonitorService;
 
 //    @Autowired
@@ -85,12 +82,6 @@ public class CentereventTDownloadsController extends BaseController {
         return getDataTable(list);
     }
 
-    @PostMapping("/downloadsMonth")
-    public R downloadsMonth(@RequestBody Map<String, Object> params) {
-        List<Map<String, Object>> list = centereventTEventcatalogueService.downloadsCommon(params);
-        return remoteMonitorService.getPlaybackByTime(list);
-    }
-
     /**
      * 导出【请填写功能名称】列表
      */
@@ -141,4 +132,30 @@ public class CentereventTDownloadsController extends BaseController {
     public AjaxResult remove(@PathVariable String[] ids) {
         return toAjax(centereventTDownloadsService.deleteCentereventTDownloadsByIds(ids));
     }
+
+    /**
+     * 事件视频下载
+     *
+     * @param id
+     * @return
+     */
+    @Log(title = "事件视频下载", businessType = BusinessType.OTHER)
+    @GetMapping("/eventhandleDownload/{id}")
+    public R eventhandleDownload(@PathVariable("id") String id) {
+        Map<String, Object> params = new HashMap<>();
+        params.put("id", id);
+        List<Map<String, Object>> list = centereventTDownloadsService.downloadsCommon(params);
+        // 校验 已下载不让重复下载
+        if (StringUtils.isEmpty(list)) {
+            return R.fail("已下载的视频,不能重复下载!");
+        } else {
+            return remoteMonitorService.getPlaybackByTime(list);
+        }
+    }
+
+    @PostMapping("/downloadsMonth")
+    public R downloadsMonth(@RequestBody Map<String, Object> params) {
+        List<Map<String, Object>> list = centereventTDownloadsService.downloadsCommon(params);
+        return remoteMonitorService.getPlaybackByTime(list);
+    }
 }

+ 0 - 28
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/controller/CentereventTEventcatalogueController.java

@@ -17,7 +17,6 @@ import com.ruoyi.system.api.RemoteConfigService;
 import com.ruoyi.system.api.RemoteDeptService;
 import com.ruoyi.system.api.RemoteUserService;
 import com.ruoyi.system.api.domain.SysUser;
-import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTDownloads;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTEventcatalogue;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.bo.CentereventtDeptEventBO;
 import com.sooka.sponest.event.centereventteventcatalogue.service.ICentereventTDownloadsService;
@@ -360,31 +359,4 @@ public class CentereventTEventcatalogueController extends BaseController {
         centereventTEventcatalogueService.reportFirePreventionOffice(centereventtDeptEventBO);
         return AjaxResult.success();
     }
-
-    @Autowired
-    private RemoteMonitorService remoteMonitorService;
-
-    /**
-     * 事件视频下载
-     *
-     * @param id
-     * @return
-     */
-    @Log(title = "事件视频下载", businessType = BusinessType.OTHER)
-    @GetMapping("/eventhandleDownload/{id}")
-    public R eventhandleDownload(@PathVariable("id") String id) {
-        // 校验 已下载不让重复下载
-        CentereventTDownloads centereventTDownloads = new CentereventTDownloads();
-        centereventTDownloads.setEventCode(id);
-        centereventTDownloads.setFlag("1");
-        List<CentereventTDownloads> downloadsList = centereventTDownloadsService.selectCentereventTDownloadsList(centereventTDownloads);
-        if (StringUtils.isNotEmpty(downloadsList)) {
-            return R.fail("已下载的视频,不能重复下载!");
-        } else {
-            Map<String, Object> params = new HashMap<>();
-            params.put("id", id);
-            List<Map<String, Object>> list = centereventTEventcatalogueService.downloadsCommon(params);
-            return remoteMonitorService.getPlaybackByTime(list);
-        }
-    }
 }

+ 3 - 3
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/mapper/CentereventTDownloadsMapper.java

@@ -1,8 +1,10 @@
 package com.sooka.sponest.event.centereventteventcatalogue.mapper;
 
 import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTDownloads;
+import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTEventcatalogue;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 【请填写功能名称】Mapper接口
@@ -52,7 +54,5 @@ public interface CentereventTDownloadsMapper {
      */
     int deleteCentereventTDownloadsByIds(String[] ids);
 
-    List<CentereventTDownloads> validDownloadIs();
-
-    CentereventTDownloads validDownloadIsOne(String logId);
+    List<CentereventTEventcatalogue> getbeforedateDownload(Map<String, Object> params);
 }

+ 0 - 3
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/mapper/CentereventTEventcatalogueMapper.java

@@ -5,7 +5,6 @@ import com.sooka.sponest.event.urge.domain.EventReminder;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * 事件目录Mapper接口
@@ -63,6 +62,4 @@ public interface CentereventTEventcatalogueMapper {
     List<EventReminder> getReminderTime(@Param("isUrged") String isUrged, @Param("eventStatusValue") String eventStatusValue);
 
     CentereventTEventcatalogue mqtest(@Param("start") String start, @Param("end") String end, @Param("limit") int limit);
-
-    List<CentereventTEventcatalogue> getbeforedateDownload(Map<String, Object> params);
 }

+ 2 - 3
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/ICentereventTDownloadsService.java

@@ -3,6 +3,7 @@ package com.sooka.sponest.event.centereventteventcatalogue.service;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTDownloads;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 【请填写功能名称】Service接口
@@ -52,7 +53,5 @@ public interface ICentereventTDownloadsService {
      */
     int deleteCentereventTDownloadsByIds(String[] ids);
 
-    List<CentereventTDownloads> validDownloadIs();
-
-    CentereventTDownloads validDownloadIsOne(String logId);
+    List<Map<String, Object>> downloadsCommon(Map<String, Object> params);
 }

+ 0 - 3
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/ICentereventTEventcatalogueService.java

@@ -6,7 +6,6 @@ import com.sooka.sponest.event.urge.domain.EventReminder;
 import com.sooka.sponest.monitor.api.domain.CenterdataTAidevicedept;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * 事件目录Service接口
@@ -82,6 +81,4 @@ public interface ICentereventTEventcatalogueService {
     void reportFirePreventionOffice(CentereventtDeptEventBO centereventtDeptEventBO);
 
     CentereventTEventcatalogue mqtest(String start, String end, int limit);
-
-    List<Map<String, Object>> downloadsCommon(Map<String, Object> params);
 }

+ 25 - 10
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/impl/CentereventTDownloadsServiceImpl.java

@@ -1,16 +1,19 @@
 package com.sooka.sponest.event.centereventteventcatalogue.service.impl;
 
 import com.ruoyi.common.core.utils.DateUtils;
+import com.ruoyi.common.core.utils.uuid.IdUtils;
 import com.ruoyi.common.datascope.base.service.BaseService;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTDownloads;
+import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTEventcatalogue;
 import com.sooka.sponest.event.centereventteventcatalogue.mapper.CentereventTDownloadsMapper;
 import com.sooka.sponest.event.centereventteventcatalogue.service.ICentereventTDownloadsService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 【请填写功能名称】Service业务层处理
@@ -21,8 +24,6 @@ import java.util.List;
 @Service
 public class CentereventTDownloadsServiceImpl extends BaseService implements ICentereventTDownloadsService {
 
-    final Logger logger = LoggerFactory.getLogger(this.getClass());
-
     @Autowired
     private CentereventTDownloadsMapper centereventTDownloadsMapper;
 
@@ -84,12 +85,26 @@ public class CentereventTDownloadsServiceImpl extends BaseService implements ICe
     }
 
     @Override
-    public List<CentereventTDownloads> validDownloadIs() {
-        return centereventTDownloadsMapper.validDownloadIs();
-    }
+    public List<Map<String, Object>> downloadsCommon(Map<String, Object> params) {
+        List<CentereventTEventcatalogue> eventcatalogues = centereventTDownloadsMapper.getbeforedateDownload(params);
+        List<Map<String, Object>> resultList = new ArrayList<>();
+        for (CentereventTEventcatalogue eventcatalogue : eventcatalogues) {
+            String uuid = IdUtils.simpleUUID();
+            CentereventTDownloads centereventTDownloads = new CentereventTDownloads();
+            centereventTDownloads.setId(uuid);
+            centereventTDownloads.setEventCode(eventcatalogue.getEventCode());
+            centereventTDownloads.setEventName(eventcatalogue.getEventName());
+            centereventTDownloads.setLogId(eventcatalogue.getId());
+            this.insertCentereventTDownloads(centereventTDownloads);
 
-    @Override
-    public CentereventTDownloads validDownloadIsOne(String logId) {
-        return centereventTDownloadsMapper.validDownloadIsOne(logId);
+            Map<String, Object> map = new HashMap<>();
+            map.put("id", uuid);
+            map.put("logId", eventcatalogue.getId());
+            map.put("cameraId", eventcatalogue.getCreateBy());
+            map.put("startTime", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.subtractTime(eventcatalogue.getReportTime(), -2)));
+            map.put("endTime", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.subtractTime(eventcatalogue.getReportTime(), 1)));
+            resultList.add(map);
+        }
+        return resultList;
     }
 }

+ 0 - 29
src/main/java/com/sooka/sponest/event/centereventteventcatalogue/service/impl/CentereventTEventcatalogueServiceImpl.java

@@ -15,7 +15,6 @@ import com.ruoyi.system.api.domain.SysDept;
 import com.ruoyi.system.api.domain.SysUser;
 import com.sooka.sponest.event.centereventtdeptevent.domain.CentereventDeptEvent;
 import com.sooka.sponest.event.centereventtdeptevent.service.ICentereventDeptEventService;
-import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTDownloads;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTEventcatalogue;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.bo.CentereventtDeptEventBO;
 import com.sooka.sponest.event.centereventteventcatalogue.domain.bo.LatLng;
@@ -38,7 +37,6 @@ import com.sooka.sponest.event.remoteapi.RemoteDataService;
 import com.sooka.sponest.event.remoteapi.domain.CenterdataTAttach;
 import com.sooka.sponest.event.urge.domain.EventReminder;
 import com.sooka.sponest.event.urge.domain.EventUrge;
-import com.sooka.sponest.event.urge.service.EventDownService;
 import com.sooka.sponest.event.urge.service.EventUrgeService;
 import com.sooka.sponest.event.utils.EventProducerUtil;
 import com.sooka.sponest.event.utils.RemoteApiUtil;
@@ -89,8 +87,6 @@ public class CentereventTEventcatalogueServiceImpl extends BaseService implement
     @Autowired
     private EventUrgeService eventUrgeService;
     @Autowired
-    private EventDownService eventDownService;
-    @Autowired
     private ICentereventTDownloadsService centereventTDownloadsService;
 
     @DataScopeMutiDept(deptAlias = "c")
@@ -637,29 +633,4 @@ public class CentereventTEventcatalogueServiceImpl extends BaseService implement
     public CentereventTEventcatalogue mqtest(String start, String end, int limit) {
         return centereventTEventcatalogueMapper.mqtest(start, end, limit);
     }
-
-    @Override
-    public List<Map<String, Object>> downloadsCommon(Map<String, Object> params) {
-        List<CentereventTEventcatalogue> eventcatalogues = centereventTEventcatalogueMapper.getbeforedateDownload(params);
-        List<Map<String, Object>> param = new ArrayList<>();
-        int i = 0;
-        for (CentereventTEventcatalogue eventcatalogue : eventcatalogues) {
-            String uuid = IdUtils.simpleUUID();
-            CentereventTDownloads centereventTDownloads = new CentereventTDownloads();
-            centereventTDownloads.setId(uuid);
-            centereventTDownloads.setEventCode(eventcatalogue.getEventCode());
-            centereventTDownloads.setEventName(eventcatalogue.getEventName());
-            centereventTDownloads.setLogId(eventcatalogue.getId());
-            centereventTDownloadsService.insertCentereventTDownloads(centereventTDownloads);
-
-            Map<String, Object> map = new HashMap<>();
-            map.put("id", uuid);
-            map.put("logId", eventcatalogue.getId());
-            map.put("cameraId", eventcatalogue.getCreateBy());
-            map.put("startTime", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.subtractTime(eventcatalogue.getReportTime(), -2)));
-            map.put("endTime", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.subtractTime(eventcatalogue.getReportTime(), 1)));
-            param.add(map);
-        }
-        return param;
-    }
 }

+ 0 - 44
src/main/java/com/sooka/sponest/event/urge/domain/EventDown.java

@@ -1,44 +0,0 @@
-package com.sooka.sponest.event.urge.domain;
-
-import com.sooka.sponest.event.urge.service.EventDownService;
-import lombok.Data;
-import org.springframework.context.ApplicationEvent;
-import org.springframework.stereotype.Component;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Observable;
-
-/**
- * @Auther: mjq
- * @Date: 2023/9/13 - 09 - 13 - 14:11
- * @Description: com.sooka.sponest.event.urge.domain
- * @version: 1.0
- */
-@Data
-@Component
-public class EventDown extends ApplicationEvent {
-
-    public EventDown() {
-        super(new EventDownService() {
-            @Override
-            public void update(Observable o, Object arg) {
-                throw new UnsupportedOperationException();
-            }
-
-            @Override
-            public void toVoidDownLoad(Map<String, Object> map) {
-                throw new UnsupportedOperationException();
-            }
-        });
-    }
-
-    private EventDownService eventDownService;
-    private Map<String, Object> map = new HashMap();
-
-    public EventDown(EventDownService source, Map<String, Object> maps) {
-        super(source);
-        this.eventDownService = source;
-        this.map = maps;
-    }
-}

+ 0 - 33
src/main/java/com/sooka/sponest/event/urge/listener/EventDownListener.java

@@ -1,33 +0,0 @@
-package com.sooka.sponest.event.urge.listener;
-
-import com.sooka.sponest.event.urge.domain.EventDown;
-import com.sooka.sponest.event.urge.service.EventDownService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationEvent;
-import org.springframework.context.ApplicationListener;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Component;
-
-/**
- * @Auther: mjq
- * @Date: 2023/9/13 - 09 - 13 - 14:16
- * @Description: com.sooka.sponest.event.urge.listener
- * @version: 1.0
- */
-@Component
-public class EventDownListener implements ApplicationListener {
-    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
-
-    @Autowired
-    private EventDownService eventDownService;
-    @Async
-    @Override
-    public void onApplicationEvent(ApplicationEvent event) {
-        if (event.getSource() instanceof EventDownService) {
-            EventDown u = (EventDown) event;
-            eventDownService.toVoidDownLoad(u.getMap());
-        }
-    }
-}

+ 0 - 15
src/main/java/com/sooka/sponest/event/urge/service/EventDownService.java

@@ -1,15 +0,0 @@
-package com.sooka.sponest.event.urge.service;
-
-import java.util.Map;
-import java.util.Observer;
-
-/**
- * @Auther: mjq
- * @Date: 2023/9/13 - 09 - 13 - 14:05
- * @Description: com.sooka.sponest.event.urge.service
- * @version: 1.0
- */
-public interface EventDownService extends Observer {
-
-    void toVoidDownLoad(Map<String, Object> maps);
-}

+ 0 - 64
src/main/java/com/sooka/sponest/event/urge/service/impl/EventDownServiceImpl.java

@@ -1,64 +0,0 @@
-package com.sooka.sponest.event.urge.service.impl;
-
-
-import com.ruoyi.common.core.utils.StringUtils;
-import com.sooka.sponest.event.centereventteventcatalogue.domain.CentereventTDownloads;
-import com.sooka.sponest.event.centereventteventcatalogue.service.ICentereventTDownloadsService;
-import com.sooka.sponest.event.urge.service.EventDownService;
-import org.apache.commons.collections4.MapUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.ApplicationArguments;
-import org.springframework.boot.ApplicationRunner;
-import org.springframework.scheduling.annotation.EnableAsync;
-import org.springframework.stereotype.Service;
-
-import java.util.Map;
-import java.util.Observable;
-
-/**
- * @Auther: mjq
- * @Date: 2023/9/13 - 09 - 13 - 14:06
- * @Description: com.sooka.sponest.event.urge.service.impl
- * @version: 1.0
- */
-@Service
-@EnableAsync
-public class EventDownServiceImpl implements EventDownService, ApplicationRunner {
-
-    private final Logger logger = LoggerFactory.getLogger(EventDownServiceImpl.class);
-
-    @Autowired
-    private ICentereventTDownloadsService centereventTDownloadsService;
-
-    @Override
-    public void run(ApplicationArguments args) throws Exception {
-
-    }
-
-    @Override
-    public void toVoidDownLoad(Map<String, Object> maps) {
-        logger.info("===========================>");
-        try {
-            Thread.sleep(300000);
-        } catch (Exception e) {
-            logger.info("Exception!", e);
-        }
-        //视频下载日志表 视频下载成功  定时任务结束回调,检验是否真的成功
-        CentereventTDownloads down = centereventTDownloadsService.validDownloadIsOne(MapUtils.getString(maps, "LogId"));
-        if (StringUtils.isNotEmpty(down.getAttachPath())) {
-            down.setFlag("1");
-            down.setPath(down.getAttachPath());
-        } else {
-            down.setFlag("0");
-            down.setReason("视频在下载过程中失败!");
-        }
-        centereventTDownloadsService.updateCentereventTDownloads(down);
-    }
-
-    @Override
-    public void update(Observable o, Object arg) {
-
-    }
-}

+ 0 - 36
src/main/resources/mapper/centereventteventcatalogue/CentereventTEventcatalogueMapper.xml

@@ -303,40 +303,4 @@
         where a.create_time between #{start} and #{end}
         limit #{limit}, 1
     </select>
-
-    <select id="getbeforedateDownload" parameterType="map" resultMap="CentereventTEventcatalogueResult">
-        SELECT l.id, l.event_code, a.event_name, a.report_time, a.create_by
-        FROM centerevent_t_fire_log l
-        LEFT JOIN centerevent_t_eventcatalogue a ON a.event_code = l.event_code
-        <where>
-            <if test="id != null and id != ''">
-                AND a.id = #{id}
-            </if>
-            <if test="taskValue != null and taskValue != ''">
-                AND DATEDIFF( l.create_time, now( ) ) = -1
-            </if>
-            <if test="monthValueStart != null and monthValueStart != ''">
-                AND DATE_FORMAT(l.create_time,'%Y-%m-%d') &gt;= #{monthValueStart}
-            </if>
-            <if test="monthValueEnd != null and monthValueEnd != ''">
-                AND DATE_FORMAT(l.create_time,'%Y-%m-%d') &lt;= #{monthValueEnd}
-            </if>
-            AND l.log_content LIKE '%确认该事件%' AND l.event_code NOT IN (
-            SELECT event_code FROM centerevent_t_downloads
-            <where>
-                flag IN ( 200, 202 )
-                <if test="taskValue != null and taskValue != ''">
-                    AND DATEDIFF( create_time, now( ) ) = -1
-                </if>
-                <if test="monthValueStart != null and monthValueStart != ''">
-                    AND DATE_FORMAT(create_time,'%Y-%m-%d') &gt;= #{monthValueStart}
-                </if>
-                <if test="monthValueEnd != null and monthValueEnd != ''">
-                    AND DATE_FORMAT(create_time,'%Y-%m-%d') &lt;= #{monthValueEnd}
-                </if>
-            </where>
-            ) AND report_source = 'reporting_source_1'
-            AND a.event_status_value NOT IN ( 'forest_event_status_3', 'forest_event_status_4' )
-        </where>
-    </select>
 </mapper>

+ 34 - 30
src/main/resources/mapper/download/CentereventTDownloadsMapper.xml

@@ -105,35 +105,39 @@
         </foreach>
     </delete>
 
-    <select id="validDownloadIs" resultMap="CentereventTDownloadsResult">
-        SELECT
-            id,
-            event_code,
-            event_name,
-            path,
-            flag,
-            reason,
-            ch.attach_path AS attachPath
-        FROM
-            centerevent_t_downloads a
-            LEFT JOIN onest_data.centerdata_t_attach ch ON log_id = ch.bus_id
-        WHERE
-            flag IS NULL AND DATEDIFF( a.create_time, now( ) ) = 0
-    </select>
-
-    <select id="validDownloadIsOne" parameterType="string" resultMap="CentereventTDownloadsResult">
-        SELECT
-            id,
-            event_code,
-            event_name,
-            path,
-            flag,
-            reason,
-            ch.attach_path AS attachPath
-        FROM
-            centerevent_t_downloads
-            LEFT JOIN onest_data.centerdata_t_attach ch ON log_id = ch.bus_id
-        WHERE
-            log_id = #{logId}
+    <select id="getbeforedateDownload" parameterType="map" resultMap="CentereventTEventcatalogueResult">
+        SELECT l.id, l.event_code, a.event_name, a.report_time, a.create_by
+        FROM centerevent_t_fire_log l
+        LEFT JOIN centerevent_t_eventcatalogue a ON a.event_code = l.event_code
+        <where>
+            <if test="id != null and id != ''">
+                AND a.id = #{id}
+            </if>
+            <if test="taskValue != null and taskValue != ''">
+                AND DATEDIFF( l.create_time, now( ) ) = -1
+            </if>
+            <if test="monthValueStart != null and monthValueStart != ''">
+                AND DATE_FORMAT(l.create_time,'%Y-%m-%d') = #{monthValueStart}
+            </if>
+            AND l.log_content LIKE '%确认该事件%' AND l.event_code NOT IN (
+            SELECT event_code FROM centerevent_t_downloads
+            <where>
+                flag IN ( 200, 202 )
+                <if test="id != null and id != ''">
+                    AND event_code = #{id}
+                </if>
+                <if test="taskValue != null and taskValue != ''">
+                    AND DATEDIFF( create_time, now( ) ) = 0
+                </if>
+                <if test="monthValueStart != null and monthValueStart != ''">
+                    AND DATE_FORMAT(create_time,'%Y-%m-%d') >= #{monthValueStart}
+                </if>
+                <if test="monthValueEnd != null and monthValueEnd != ''">
+                    AND DATE_FORMAT(create_time,'%Y-%m-%d') &lt;= #{monthValueEnd}
+                </if>
+            </where>
+            ) AND report_source = 'reporting_source_1'
+            AND a.event_status_value NOT IN ( 'forest_event_status_3', 'forest_event_status_4' )
+        </where>
     </select>
 </mapper>