Browse Source

Merge branch 'develop' of http://39.106.31.193:9211/mengff/jihe-dc into develop

 Conflicts:
	zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
develop
lau572 8 months ago
parent
commit
a09b9be9df
  1. 15
      zc-business/src/main/java/com/zc/business/controller/DcEmergencyPlansController.java
  2. 4
      zc-business/src/main/java/com/zc/business/domain/DcEvent.java
  3. 44
      zc-business/src/main/java/com/zc/business/enums/EventSubclassEnum.java
  4. 9
      zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java
  5. 19
      zc-business/src/main/java/com/zc/business/service/DcEmergencyPlansService.java
  6. 5
      zc-business/src/main/java/com/zc/business/service/IDcEventService.java
  7. 271
      zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java
  8. 122
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  9. 485
      zc-business/src/main/resources/mapper/business/DcEventMapper.xml
  10. 2
      zc-business/src/main/resources/mapper/business/EventPlanAssocMapper.xml

15
zc-business/src/main/java/com/zc/business/controller/DcEmergencyPlansController.java

@ -63,13 +63,14 @@ public class DcEmergencyPlansController extends BaseController {
public AjaxResult listByEventType(@RequestBody DcEvent dcEvent) {
List<DcEmergencyPlans> dcEmergencyPlansList = dcEmergencyPlansService.selectDcEmergencyPlansByEventType(dcEvent);
dcEmergencyPlansService.dispositionDeviceContent(dcEmergencyPlansList,dcEvent);
return AjaxResult.success(dcEmergencyPlansList);
}
/**
* 感知事件-根据事件数据查询事件预案列表
*/
@ApiOperation("感知事件-根据事件数据查询事件预案列表")
// @ApiOperation("感知事件-根据事件数据查询事件预案列表")
@PreAuthorize("@ss.hasPermi('business:plans:list')")
@PostMapping("/list/warning/type")
public AjaxResult listByEventType(@RequestBody DcWarning dcWarning) {
@ -91,7 +92,7 @@ public class DcEmergencyPlansController extends BaseController {
/**
* 感知事件-情报板确认回显原始模板
*/
@ApiOperation("感知事件-情报板确认回显原始模板")
// @ApiOperation("感知事件-情报板确认回显原始模板")
@PreAuthorize("@ss.hasPermi('business:plans:list')")
@PostMapping("/warning/board/confirm")
public AjaxResult warningBoardConfirm(@RequestBody DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans) {
@ -101,7 +102,7 @@ public class DcEmergencyPlansController extends BaseController {
/**
* 感知事件-情报板自动生成文字
*/
@ApiOperation("感知事件-情报板自动生成文字")
// @ApiOperation("感知事件-情报板自动生成文字")
@PostMapping("/warning/automatic")
public AjaxResult warningAutomaticGeneration(@RequestBody DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans) {
return AjaxResult.success(dcEmergencyPlansService.warningAutomaticGeneration(dcEventAnDcEmergencyPlans));
@ -110,7 +111,7 @@ public class DcEmergencyPlansController extends BaseController {
/**
* 交通事件-情报板自动生成文字
*/
@ApiOperation("交通事件-情报板自动生成文字")
// @ApiOperation("交通事件-情报板自动生成文字")
@PostMapping("/event/automatic")
public AjaxResult eventAutomaticGeneration(@RequestBody DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans) {
return AjaxResult.success(dcEmergencyPlansService.eventAutomaticGeneration(dcEventAnDcEmergencyPlans));
@ -138,7 +139,7 @@ public class DcEmergencyPlansController extends BaseController {
/**
* 感知事件确定
*/
@ApiOperation("感知事件确认")
// @ApiOperation("感知事件确认")
@PreAuthorize("@ss.hasPermi('business:plans:edit')")
@PostMapping("/warning/confirm")
public AjaxResult warningConfirm(@RequestBody DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans) {
@ -149,7 +150,7 @@ public class DcEmergencyPlansController extends BaseController {
* 新增事件预案
*/
@ApiOperation("新增预案")
// @PreAuthorize("@ss.hasPermi('business:plans:add')")
@PreAuthorize("@ss.hasPermi('business:plans:add')")
@PostMapping
public AjaxResult add(@RequestBody DcEmergencyPlans dcEmergencyPlans) {
return toAjax(dcEmergencyPlansService.insertDcEmergencyPlans(dcEmergencyPlans));
@ -159,7 +160,7 @@ public class DcEmergencyPlansController extends BaseController {
* 修改事件预案
*/
@ApiOperation("修改预案")
// @PreAuthorize("@ss.hasPermi('business:plans:edit')")
@PreAuthorize("@ss.hasPermi('business:plans:edit')")
@PutMapping
public AjaxResult update(@RequestBody DcEmergencyPlans dcEmergencyPlans) {
return toAjax(dcEmergencyPlansService.updateDcEmergencyPlans(dcEmergencyPlans));

4
zc-business/src/main/java/com/zc/business/domain/DcEvent.java

@ -229,6 +229,10 @@ public class DcEvent {
private List<DcProcessConfig> processConfigList;
@ApiModelProperty("事件标题")
private String eventTitle;
@ApiModelProperty("维度")
private String dimension;
@ApiModelProperty("经度")
private String longitude;
/**
* 2014/2/21新增
*/

44
zc-business/src/main/java/com/zc/business/enums/EventSubclassEnum.java

@ -5,28 +5,28 @@ package com.zc.business.enums;
* @author wangjiabao
*/
public enum EventSubclassEnum {
REAR_END_COLLISION("1-1", "追尾","前方发生追尾 注意避让"),
ROLLOVER("1-2", "侧翻","前方发生侧翻 注意避让"),
COLLISION_WITH_GUARDRAIL("1-3", "撞护栏","前方车撞击护栏注意避让"),
NATURAL("1-4", "自然","前方发生自然现象请注意"),
OTHER_ACCIDENTS("1-5", "其他事故","前方发生事故谨慎驾驶"),
VEHICLE_MALFUNCTION("2-1", "车辆故障","前方发生故障注意避让"),
ROAD_CONGESTION("4-1", "道路拥堵","前方道路拥堵"),
OVERPASS_CONGESTION("4-2", "立交拥堵","前方立交拥堵"),
TOLL_STATION_CONGESTION("4-3", "收费站拥堵","前方收费站拥堵"),
SERVICE_AREA_CONGESTION("4-4", "服务区拥堵","前方服务区拥堵"),
PEDESTRIAN("5-1", "行人","有行人穿行请注意"),
NON_MOTOR_VEHICLES("5-2", "非机动车","有非机动车上路请注意"),
MOTORCYCLE("5-3", "摩托车","有摩托车上路请注意"),
OTHER("5-4", "其他","有非法上路车辆"),
SMOKE("6-1", "烟雾","烟雾道路请注意驾驶"),
FALLEN_TREES("6-2", "倒伏树木","有倒伏树木请注意"),
SCATTERED_MATERIALS("6-3", "洒落物","有洒落物请注意"),
ANIMAL("6-4", "动物","有动物请注意"),
OTHER_OBSTACLES("6-5", "其他障碍","有不明障碍请注意"),
CLOSED_OR_SUSPENDED_OPERATIONS("8-1", "封闭、暂停营业","服务区封闭、暂停营业"),
SHUTDOWN_OF_IMPORTANT_FACILITIES("8-2", "重要设施停用","服务区重要设施停用"),
OTHER_ABNORMALITIES_IN_THE_SERVICE_AREA("8-3", "服务区其他异常","服务区设备停用"),
REAR_END_COLLISION("1-1", "追尾","前方*发生追尾 注意避让"),
ROLLOVER("1-2", "侧翻","前方*发生侧翻 注意避让"),
COLLISION_WITH_GUARDRAIL("1-3", "撞护栏","前方*车撞击护栏注意避让"),
NATURAL("1-4", "自然","前方*发生自然现象请注意"),
OTHER_ACCIDENTS("1-5", "其他事故","前方*发生事故谨慎驾驶"),
VEHICLE_MALFUNCTION("2-1", "车辆故障","前方*发生故障注意避让"),
ROAD_CONGESTION("4-1", "道路拥堵","前方*道路拥堵"),
OVERPASS_CONGESTION("4-2", "立交拥堵","前方*立交拥堵"),
TOLL_STATION_CONGESTION("4-3", "收费站拥堵","前方*收费站拥堵"),
SERVICE_AREA_CONGESTION("4-4", "服务区拥堵","前方*服务区拥堵"),
PEDESTRIAN("5-1", "行人","前方*有行人穿行请注意"),
NON_MOTOR_VEHICLES("5-2", "非机动车","前方*有非机动车上路请注意"),
MOTORCYCLE("5-3", "摩托车","前方*有摩托车上路请注意"),
OTHER("5-4", "其他","前方*有非法上路车辆"),
SMOKE("6-1", "烟雾","前方*烟雾道路请注意驾驶"),
FALLEN_TREES("6-2", "倒伏树木","前方*有倒伏树木请注意"),
SCATTERED_MATERIALS("6-3", "洒落物","前方*有洒落物请注意"),
ANIMAL("6-4", "动物","前方*有动物请注意"),
OTHER_OBSTACLES("6-5", "其他障碍","前方*有不明障碍请注意"),
CLOSED_OR_SUSPENDED_OPERATIONS("8-1", "封闭、暂停营业","前方*服务区封闭、暂停营业"),
SHUTDOWN_OF_IMPORTANT_FACILITIES("8-2", "重要设施停用","前方*服务区重要设施停用"),
OTHER_ABNORMALITIES_IN_THE_SERVICE_AREA("8-3", "服务区其他异常","前方*服务区设备停用"),
RAIN("10-1", "雨","雨天请谨慎驾驶"),
SNOW("10-2", "雪","雪天路滑请谨慎驾驶"),
HEAVY_FOG("10-3", "大雾","大雾天气请谨慎驾驶"),

9
zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java

@ -52,6 +52,15 @@ public interface DcEventMapper extends BaseMapper<DcEvent>
*/
int updateDcEvent(DcEvent dcEvent);
/**
* 修改事件性质 关联管制事件id
*
* @param dcEvent 事件信息
* @return 结果
*/
int updateDcEventLinkId(DcEvent dcEvent);
/**
* 删除事件信息
*

19
zc-business/src/main/java/com/zc/business/service/DcEmergencyPlansService.java

@ -1,6 +1,6 @@
package com.zc.business.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.zc.business.domain.*;
import java.util.List;
@ -39,6 +39,11 @@ public interface DcEmergencyPlansService {
*/
List<DcEmergencyPlans> selectDcEmergencyPlansByEventType(DcEvent event);
/**
* 处置设备智能发布的内容
*/
void dispositionDeviceContent(List<DcEmergencyPlans> list, DcEvent dcEvent);
/**
* 感知事件-根据事件类型查询事件预案
*
@ -63,7 +68,7 @@ public interface DcEmergencyPlansService {
* @param dcEventAnDcEmergencyPlans 事件数据 事件预案数据
* @return 结果
*/
JSONArray executionEventConfirmation(DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans);
JSONObject executionEventConfirmation(DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans);
/**
* 根据事件id-查询预案事件关联表
@ -79,7 +84,7 @@ public interface DcEmergencyPlansService {
* @param dcEventAnDcEmergencyPlans 事件数据 事件预案数据
* @return 结果
*/
JSONArray executionWarningConfirmation(DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans);
JSONObject executionWarningConfirmation(DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans);
/**
* 感知事件-情报板自动生成
@ -111,14 +116,6 @@ public interface DcEmergencyPlansService {
*/
int updateDcEmergencyPlans(DcEmergencyPlans dcEmergencyPlans);
/**
* 批量修改事件预案
*
* @param dcEmergencyPlansList 事件预案
* @return 结果
*/
int updateBatchDcEmergencyPlans(List<DcEmergencyPlans> dcEmergencyPlansList);
/**
* 批量删除事件预案
*

5
zc-business/src/main/java/com/zc/business/service/IDcEventService.java

@ -58,6 +58,11 @@ public interface IDcEventService
*/
public int updateDcEvent(DcEvent dcEvent);
/**
* @param dcEvent
* @return int
*/
/**
* 批量删除事件信息
*

271
zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

@ -20,6 +20,7 @@ import com.zc.business.mapper.EventPlanAssocMapper;
import com.zc.business.service.DcEmergencyPlansService;
import com.zc.business.service.DcExecuteActionService;
import com.zc.business.service.IDcDeviceService;
import com.zc.business.service.IDcFacilityService;
import com.zc.common.core.httpclient.exception.HttpException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@ -50,6 +51,9 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
@Resource
private EventPlanAssocMapper eventPlanAssocMapper;
@Resource
private IDcFacilityService dcFacilityService;
@Resource
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
@ -110,8 +114,6 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
return dcEmergencyPlansList.stream()
.filter(dcEmergencyPlans -> {
String triggerMechanism = dcEmergencyPlans.getTriggerMechanism();
// JSONObject triggerJson = JSONObject.parseObject(triggerMechanism);
// String eventSubclass = triggerJson.get("eventSubclass").toString();
return triggerMechanism.equals(event.getSubclass());
})
.collect(Collectors.toList());
@ -120,8 +122,6 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
return dcEmergencyPlansList.stream()
.filter(dcEmergencyPlans -> {
String triggerMechanism = dcEmergencyPlans.getTriggerMechanism();
// JSONObject triggerJson = JSONObject.parseObject(triggerMechanism);
// String locationType = triggerJson.get("locationType").toString();
DcEventVehicleAccident dcEventVehicleAccident = event.getDcEventVehicleAccident();
String eventLocationType = dcEventVehicleAccident.getLocationType().toString();
return triggerMechanism.equals(eventLocationType);
@ -132,9 +132,6 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
return dcEmergencyPlansList.stream()
.filter(dcEmergencyPlans -> {
String triggerMechanism = dcEmergencyPlans.getTriggerMechanism();
// JSONObject triggerJson = JSONObject.parseObject(triggerMechanism);
// 分类
// Integer classify = Integer.parseInt(triggerJson.get("classify").toString());
// 事件--交通管制数据
DcEventTrafficControl dcEventTrafficControl = event.getDcEventTrafficControl();
Integer eventClassify = Integer.parseInt(dcEventTrafficControl.getClassify().toString());
@ -148,6 +145,110 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
}
/**
* 处置设备智能发布的内容
*/
@Override
public void dispositionDeviceContent(List<DcEmergencyPlans> list, DcEvent dcEvent) {
// 事件桩号
dcEvent.setStakeMark(dcEvent.getStakeMark().replace("K", ""));
String[] markArray = dcEvent.getStakeMark().split("\\+");
if (markArray[1].length() < 3) {
// 不足三位 补零
markArray[1] = String.format("%0" + 3 + "d", markArray[1]);
}
// 情报板 语音广播
list.forEach(dcEmergencyPlans -> {
List<DcExecuteAction> dcExecuteActions = dcEmergencyPlans.getDcExecuteAction();
dcExecuteActions.forEach(dcExecuteAction -> {
JSONObject executeConfig = JSON.parseObject(dcExecuteAction.getExecuteConfig());
if (dcExecuteAction.getDeviceType() == DeviceTypeEnum.ROAD_SECTION_VOICE_BROADCASTING.getCode()
&& executeConfig.get("operationType").equals("2")) {
// 执行操作中智能发布语音广播
String content = intelligentPublishingOfInformation(dcEvent);
updateIntelligentPublishingContent(dcExecuteAction,markArray,dcEvent,content,dcEvent.getDirection());
} else if (dcExecuteAction.getDeviceType() == DeviceTypeEnum.VARIABLE_INFORMATION_FLAG.getCode()
&& executeConfig.get("operationType").equals("2")) {
// 执行操作中智能发布情报板
String content = intelligentPublishingOfInformation(dcEvent);
updateIntelligentPublishingContent(dcExecuteAction,markArray,dcEvent,content,dcEvent.getDirection());
}
});
});
}
/**
* 更改智能发布中的发布内容-计算公里数
*/
public void updateIntelligentPublishingContent(DcExecuteAction dcExecuteAction,
String[] markArray,
DcEvent dcEvent,
String content,
String direction) {
List<DcDevice> deviceList = ruleFiltering(dcExecuteAction, markArray, dcEvent.getDirection());
JSONObject executeConfig = JSON.parseObject(dcExecuteAction.getExecuteConfig());
List<Map<String,Object>> contentList = new ArrayList<>();
deviceList.forEach(dcDevice -> {
Map<String,Object> map = new HashMap<>();
map.put("dcDeviceId",dcDevice.getId());
map.put("deviceName",dcDevice.getDeviceName());
// 公里数
int kilometers = 0;
// 米数
int meters = 0;
dcDevice.setStakeMark(dcDevice.getStakeMark().replace("K", ""));
String[] deviceMarkArray = dcDevice.getStakeMark().split("\\+");
if (deviceMarkArray[1].length() < 3) {
// 不足三位 补零
deviceMarkArray[1] = String.format("%0" + 3 + "d", deviceMarkArray[1]);
}
if (direction.equals("菏泽方向") || direction.equals("1")) {
kilometers = Math.abs(Integer.parseInt(markArray[0]) - Integer.parseInt(deviceMarkArray[0]));
meters = Integer.parseInt(markArray[1]) - Integer.parseInt(deviceMarkArray[1]);
}else {
kilometers = Math.abs(Integer.parseInt(deviceMarkArray[0]) - Integer.parseInt(markArray[0]));
meters = Integer.parseInt(deviceMarkArray[1]) - Integer.parseInt(markArray[1]);
}
double roundedDistance = Math.round((kilometers + meters / 1000.0) * 10.0) / 10.0;
if (roundedDistance < 1) {
map.put("content",content.replace("*",(int) (roundedDistance * 1000)+"米"));
}else {
if (roundedDistance % 1 == 0) {
// 去除掉1.0公里的情况
map.put("content",content.replace("*",(int)roundedDistance+"公里"));
}else {
map.put("content",content.replace("*",roundedDistance+"公里"));
}
}
if (dcExecuteAction.getDeviceType() == DeviceTypeEnum.VARIABLE_INFORMATION_FLAG.getCode()) {
// 情报板
// stopTime
map.put("stopTime", "50");
// inScreenMode
map.put("inScreenMode", "1");
// fontSpacing
map.put("fontSpacing", "0");
// fontColor
map.put("fontColor", "ffff00");
// fontType
map.put("fontType", "1");
// fontSize
map.put("fontSize", "36");
// screenSize 768*64 宽度和高度
map.put("screenSize", "768*64");
// formatStyle
map.put("formatStyle", "2");
}
contentList.add(map);
});
executeConfig.put("contentList",contentList);
dcExecuteAction.setExecuteConfig(executeConfig.toJSONString());
}
/**
* 感知事件 - 根据事件类型查询事件预案
*
@ -196,8 +297,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
markArray[1] = String.format("%0" + 3 + "d", markArray[1]);
}
DcExecuteAction executeAction = dcEventAnDcEmergencyPlans.getDcEmergencyPlans().getExecuteAction();
Integer operationType = dcEventAnDcEmergencyPlans.getOperationType();
List<DcDevice> dcDevices = ruleFiltering(executeAction, markArray, direction, operationType);
List<DcDevice> dcDevices = ruleFiltering(executeAction, markArray, direction);
return getBoardTemplate(dcDevices);
}
@ -218,8 +318,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
markArray[1] = String.format("%0" + 3 + "d", markArray[1]);
}
DcExecuteAction executeAction = dcEventAnDcEmergencyPlans.getDcEmergencyPlans().getExecuteAction();
Integer operationType = dcEventAnDcEmergencyPlans.getOperationType();
List<DcDevice> dcDevices = ruleFiltering(executeAction, markArray, direction, operationType);
List<DcDevice> dcDevices = ruleFiltering(executeAction, markArray, direction);
return getBoardTemplate(dcDevices);
}
@ -289,12 +388,9 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
* @param direction
* @return
*/
public List<DcDevice> ruleFiltering(DcExecuteAction dcExecuteAction, String[] markArray, String direction, Integer operationType) {
public List<DcDevice> ruleFiltering(DcExecuteAction dcExecuteAction, String[] markArray, String direction) {
Integer searchRule = dcExecuteAction.getSearchRule();
// 区分执行操作还是恢复操作
JSONObject otherConfig = operationType.equals(1)?
JSON.parseObject(dcExecuteAction.getExecuteConfig()): JSON.parseObject(dcExecuteAction.getRecoverConfig());
List<String> start = new ArrayList<>();
List<String> end = new ArrayList<>();
// 设备列表
@ -306,13 +402,13 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
// 指定设备资源
// 根据设备id,获取设备集合
LambdaQueryWrapper<DcDevice> queryWrapper = new LambdaQueryWrapper<>();
List<String> deviceList = (List<String>) otherConfig.get("deviceList");
String[] deviceList = dcExecuteAction.getDeviceList().split(",");
queryWrapper.in(DcDevice::getIotDeviceId, deviceList);
dcDevices = dcDeviceService.list(queryWrapper);
} else if (searchRule.equals(2)) {
// 事件上游最近
if (direction.equals("菏泽方向")) {
if (direction.equals("菏泽方向") || direction.equals("1")) {
// 上行 取最大的几个
start.add("55");
start.add("379");
@ -351,8 +447,8 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
}
} else if (searchRule.equals(3)) {
// 事件下游最近
if (direction.equals("菏泽方向")) {
// 事件下游最近 没有这个类型
if (direction.equals("菏泽方向") || direction.equals("1")) {
// 上行 取最大的几个
start.add(markArray[0]);
start.add(markArray[1]);
@ -406,8 +502,29 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
// 根据桩号范围,查询附近设备
dcDevices = dcDeviceService.devicePileNumberQueryDevice(parameter);
}
return dcDevices;
//将0公里和负数的设备去掉
return dcDevices.stream()
.filter(device -> {
device.setStakeMark(device.getStakeMark().replace("K", ""));
String[] deviceMarkArray = device.getStakeMark().split("\\+");
if (deviceMarkArray[1].length() < 3) {
deviceMarkArray[1] = String.format("%0" + 3 + "d", deviceMarkArray[1]);
}
int kilometers = 0;
int meters = 0;
if (direction.equals("菏泽方向") || direction.equals("1")) {
// 菏泽方向 桩号增大 设备桩号要小于事件桩号
kilometers = Integer.parseInt(markArray[0]) - Integer.parseInt(deviceMarkArray[0]);
meters = Integer.parseInt(markArray[1]) - Integer.parseInt(deviceMarkArray[1]);
}else {
// 济南方向 桩号减小 设备桩号要大于事件桩号
kilometers = Integer.parseInt(deviceMarkArray[0]) - Integer.parseInt(markArray[0]);
meters = Integer.parseInt(deviceMarkArray[1]) - Integer.parseInt(markArray[1]);
}
double roundedDistance = Math.round((kilometers + meters / 1000.0) * 10.0) / 10.0;
return kilometers >= 0 && roundedDistance > 0;
})
.collect(Collectors.toList());
}
@ -418,7 +535,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
* @return 结果
*/
@Override
public JSONArray executionEventConfirmation(DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans) {
public JSONObject executionEventConfirmation(DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans) {
// 获取事件数据
DcEvent dcEvent = dcEventAnDcEmergencyPlans.getDcEvent();
// 方向
@ -478,8 +595,17 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
@Override
public DcInfoBoardTemplate eventAutomaticGeneration(DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans) {
// 根据交通事件的事件类型,生成相应的情报板内容
DcEvent dcEvent = dcEventAnDcEmergencyPlans.getDcEvent();
DcInfoBoardTemplate dcInfoBoardTemplate = dcEventAnDcEmergencyPlans.getDcInfoBoardTemplate();
DcEvent dcEvent = dcEventAnDcEmergencyPlans.getDcEvent();
dcInfoBoardTemplate.setContent(intelligentPublishingOfInformation(dcEvent));
return dcInfoBoardTemplate;
}
/**
* 智能发布信息匹配
*/
public String intelligentPublishingOfInformation(DcEvent dcEvent) {
String content = "请注意前方危险";
int eventType = Integer.parseInt(dcEvent.getEventType().toString());
if (eventType == EventTypeEnum.ABNORMAL_WEATHER.getCode() ||
eventType == EventTypeEnum.TRAFFIC_ACCIDENT.getCode() ||
@ -488,42 +614,41 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
eventType == EventTypeEnum.SERVICE_AREA_ABNORMALITY.getCode() ||
eventType == EventTypeEnum.ROADBLOCK_CLEARANCE.getCode()) {
String content = Arrays.stream(EventSubclassEnum.values())
content = Arrays.stream(EventSubclassEnum.values())
.filter(eventSubclassEnum -> eventSubclassEnum.getCode().equals(dcEvent.getSubclass()))
.findFirst()
.map(EventSubclassEnum::getText)
.orElse("请注意前方危险");
dcInfoBoardTemplate.setContent(content);
} else if (eventType == EventTypeEnum.VEHICLE_MALFUNCTION.getCode()) {
// 车辆故障
DcEventVehicleAccident dcEventVehicleAccident = dcEvent.getDcEventVehicleAccident();
int locationType = Integer.parseInt(dcEventVehicleAccident.getLocationType().toString());
// 路广设施id
Integer facilityId = dcEventVehicleAccident.getFacilityId();
DcFacility facility = dcFacilityService.getFacility(facilityId.toString());
String facilityName = facility.getFacilityName();
if (locationType == 1) {
dcInfoBoardTemplate.setContent("高速主线发生车辆故障");
} else if (locationType == 2) {
dcInfoBoardTemplate.setContent("服务区发生车辆故障");
} else if (locationType == 3) {
dcInfoBoardTemplate.setContent("立交桥发生车辆故障");
} else if (locationType == 4) {
dcInfoBoardTemplate.setContent("收费站发生车辆故障");
content = "前方*高速主线发生车辆故障";
} else if (locationType == 2 || locationType == 3 || locationType == 4) {
// 服务区、立交、收费站
content = "前方*"+facilityName+"发生车辆故障";
}
} else if (eventType == EventTypeEnum.TRAFFIC_CONTROL.getCode()) {
// 交通管制
DcEventTrafficControl dcEventTrafficControl = dcEvent.getDcEventTrafficControl();
int classify = Integer.parseInt(dcEventTrafficControl.getClassify().toString());
String content = Arrays.stream(ClassifyEnum.values())
content = Arrays.stream(ClassifyEnum.values())
.filter(eventSubclassEnum -> eventSubclassEnum.getCode() == classify)
.findFirst()
.map(ClassifyEnum::getText)
.orElse("前方存在限行或关闭");
dcInfoBoardTemplate.setContent(content);
.orElse("前方*存在限行或关闭");
} else {
// 施工建设
dcInfoBoardTemplate.setContent("前方施工请注意驾驶");
content = "前方*施工请注意驾驶";
}
return dcInfoBoardTemplate;
return content;
}
/**
@ -533,7 +658,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
* @return
*/
@Override
public JSONArray executionWarningConfirmation(DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans) {
public JSONObject executionWarningConfirmation(DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans) {
// 获取事件数据
DcWarning dcWarning = dcEventAnDcEmergencyPlans.getDcWarning();
@ -550,7 +675,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
* @param dcEventAnDcEmergencyPlans 事件数据 事件预案数据
* @return
*/
public JSONArray executionConfirmation(DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans,
public JSONObject executionConfirmation(DcEventAnDcEmergencyPlans dcEventAnDcEmergencyPlans,
String stakeMark,
String direction,
String id) {
@ -574,7 +699,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
//获取事件预案中的操作配置
dcEmergencyPlans.getDcExecuteAction()
.forEach(dcExecuteAction -> {
List<DcDevice> dcDevices = ruleFiltering(dcExecuteAction, markArray, direction, operationType);
List<DcDevice> dcDevices = ruleFiltering(dcExecuteAction, markArray, direction);
JSONObject otherConfig = operationType.equals(1)?
JSON.parseObject(dcExecuteAction.getExecuteConfig()): JSON.parseObject(dcExecuteAction.getRecoverConfig());
try {
@ -600,23 +725,26 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
});
// 创建一个 预案事件关联对象
EventPlanAssoc eventPlanAssoc = new EventPlanAssoc();
JSONObject resultObject = new JSONObject();
// 事件编号
eventPlanAssoc.setEventId(id);
EventPlanAssoc selectEventPlanAssoc = eventPlanAssocMapper.selectByEventId(eventPlanAssoc);
// 区分是执行操作 还是 恢复操作
if (dcEventAnDcEmergencyPlans.getOperationType().equals(1) && StringUtils.isEmpty(selectEventPlanAssoc.getId())) {
if (dcEventAnDcEmergencyPlans.getOperationType().equals(1) && selectEventPlanAssoc == null) {
// 首次执行操作
eventPlanAssoc.setEmergencyPlansId(dcEmergencyPlans.getId());
eventPlanAssoc.setExecutingControlDevice(deviceIds.toString().replaceFirst(";", ""));
eventPlanAssoc.setExecutingControlResult(resultArray.toJSONString());
eventPlanAssoc.setCreateTime(DateUtils.getNowDate());
eventPlanAssocMapper.insertEventPlanAssoc(eventPlanAssoc);
int eventPlanAssocId = eventPlanAssocMapper.insertEventPlanAssoc(eventPlanAssoc);
resultObject.put("eventPlanAssocId",eventPlanAssocId);
}
else if (StringUtils.isNotEmpty(selectEventPlanAssoc.getId()) && dcEventAnDcEmergencyPlans.getOperationType().equals(1)) {
// 多次执行操作
selectEventPlanAssoc.setExecutingControlResult(resultArray.toJSONString());
selectEventPlanAssoc.setUpdateTime(DateUtils.getNowDate());
eventPlanAssocMapper.updateEventPlanAssoc(selectEventPlanAssoc);
resultObject.put("eventPlanAssocId",selectEventPlanAssoc.getId());
}
else {
// 恢复操作 未执行的事件不能进行恢复操作
@ -624,8 +752,10 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
selectEventPlanAssoc.setRecoveredControlDevice(deviceIds.toString().replaceFirst(";", ""));
selectEventPlanAssoc.setRecoveredControlResult(resultArray.toJSONString());
eventPlanAssocMapper.updateEventPlanAssoc(selectEventPlanAssoc);
resultObject.put("eventPlanAssocId",selectEventPlanAssoc.getId());
}
return resultArray;
resultObject.put("deviceOperationResult",resultArray);
return resultObject;
}
/**
@ -635,7 +765,7 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
List<DcDevice> dcDevices,
JSONObject otherConfig,
JSONArray resultArray) {
CountDownLatch latch = new CountDownLatch(dcDevices.size());
for (DcDevice device : dcDevices) {
@ -673,7 +803,28 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
else if (device.getDeviceType().equals(DeviceTypeConstants.VARIABLE_INFORMATION_FLAG.toString())) {
if (operationType == 1) {
// 情报板发布全流程
if (otherConfig.get("operationType").equals("2")) {
JSONArray contentList = JSON.parseArray(otherConfig.get("contentList").toString());
JSONObject foundContent = contentList.stream()
.map(content -> JSON.parseObject(content.toString()))
.filter(jsonObject ->
Integer.parseInt(jsonObject.get("dcDeviceId").toString()) == device.getId())
.findFirst()
.orElse(null);
if (foundContent == null) {
// 说明没有匹配到设备
JSONObject errorResult = new JSONObject();
errorResult.put("device",device.getId());
errorResult.put("errorMessage","未匹配到对应的模板内容");
resultArray.add(errorResult);
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("dcInfoBoardTemplate",foundContent);
boardReleaseProcess(props, iotDeviceId, jsonObject, device, resultArray);
}else {
boardReleaseProcess(props, iotDeviceId, otherConfig, device, resultArray);
}
} else {
// 恢复操作
if (otherConfig.get("operationType").equals("2")) {
@ -702,7 +853,26 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
params.put("name", "task-event");
params.put("outVVol", "8");
params.put("priority", "1");
if (otherConfig.get("operationType").equals("2")) {
// 智能发布
JSONArray contentList = JSON.parseArray(otherConfig.get("contentList").toString());
JSONObject foundContent = contentList.stream()
.map(content -> JSON.parseObject(content.toString()))
.filter(jsonObject ->
Integer.parseInt(jsonObject.get("dcDeviceId").toString()) == device.getId())
.findFirst()
.orElse(null);
if (foundContent == null) {
// 说明没有匹配到设备
JSONObject errorResult = new JSONObject();
errorResult.put("device",device.getId());
errorResult.put("errorMessage","未匹配到对应的广播内容");
resultArray.add(errorResult);
}
params.put("text", foundContent.get("content"));
}else {
params.put("text", otherConfig.get("content"));
}
params.put("repeatTimes", "3");
params.put("functionType", "startPaTts");
JSONArray termList = new JSONArray();
@ -743,10 +913,18 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
} catch (HttpException | IOException e) {
log.error(e.toString());
throw new RuntimeException(e);
} finally {
latch.countDown(); // 确保在异常情况下也能减少CountDownLatch计数
}
});
}
try {
latch.await(); // 等待所有线程执行完毕
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
/**
@ -889,11 +1067,6 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
return dcExecuteActionService.updateDcExecuteActionBatch(dcExecuteActionList);
}
@Override
public int updateBatchDcEmergencyPlans(List<DcEmergencyPlans> dcEmergencyPlansList) {
return 0;
}
/**
* 批量删除事件预案
*

122
zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java

@ -20,6 +20,7 @@ import com.zc.business.service.IMiddleDatabaseService;
import com.zc.business.utils.diff.Diff;
import com.zc.business.utils.diff.model.Result;
import org.junit.Test;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -136,6 +137,7 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
String dcEventId =dcEvent.getId();
//获取事件类型
int eventType = Math.toIntExact(dcEvent.getEventType());
@ -187,9 +189,11 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
if (i7 > 0) {
if (dcEvent.getDcEventTrafficControl().getFacilityIds().length<1 &&dcEventId == null){//非 事件处置 和收费站等多条数据添加
//中间库
MdEvent mdEvent = new MdEvent(dcEvent);
middleDatabaseService.insertMiddleDatabaseEvent(mdEvent);
}
switch (eventType) {
//交通事故
case 1:
@ -213,53 +217,143 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
if (dcEvent.getDcEventTrafficControl() != null) {
//TODO 插入多个收费站
if (dcEvent.getDcEventTrafficControl().getFacilityIds().length==1){//facilityIds==1 说明只选择了一个收费站
if (dcEventId !=null){//不等于空 事件处置页面 修改
dcEventMapper.deleteDcEventById(uuid);//删除添加的事件主类
DcEvent dcEvent1 = new DcEvent();
dcEvent1.setId(dcEventId);//事件id
dcEvent1.setEventNature(1l);//首发事件
dcEvent1.setLinkId(uuid);//关联管制事件id
dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质
dcEvent.getDcEventTrafficControl().setId(uuid);
dcEvent.getDcEventTrafficControl().setFacilityId(dcEvent.getDcEventTrafficControl().getFacilityIds()[0]);//取出数组字段赋值 设施id
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl());
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl());//
}else {
//中间库
MdEvent mdEvent = new MdEvent(dcEvent);
middleDatabaseService.insertMiddleDatabaseEvent(mdEvent);
dcEvent.getDcEventTrafficControl().setId(uuid);
dcEvent.getDcEventTrafficControl().setFacilityId(dcEvent.getDcEventTrafficControl().getFacilityIds()[0]);//取出数组字段赋值 设施id
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl());
}
}else if (dcEvent.getDcEventTrafficControl().getFacilityIds().length>1){//facilityIds1=1 说明只选择了多个收费站
if (dcEventId !=null){//不等于空 事件处置页面 修改
dcEventMapper.deleteDcEventById(uuid);//删除添加的事件主类
DcEvent dcEvent1 = new DcEvent();
dcEvent1.setId(dcEventId);//事件id
dcEvent1.setEventNature(1l);//首发事件
Map<String,String> map = new HashMap<>();
for (int i = 0; i < dcEvent.getDcEventTrafficControl().getFacilityIds().length; i++) { //设置事件Id UUID无下划线格式32
String facilityUUID = IdUtils.fastSimpleUUID();
map.put("facilityId"+i,facilityUUID);//每循环一次生成一个uuid
Long facilityId = dcEvent.getDcEventTrafficControl().getFacilityIds()[i];
map.put(facilityUUID, String.valueOf(facilityId));//将uuid作为主键 设施id作为 值 存放map
}
StringBuilder sb2 = new StringBuilder();
// 遍历map,
int a = 0;
for (Map.Entry<String, String> entry : map.entrySet()) {
sb2.append(entry.getValue());
if (dcEvent.getDcEventTrafficControl().getFacilityIds().length-a !=1){
sb2.append(",");
}
a++;
}
String linkId2 = sb2.toString();
dcEvent1.setLinkId(linkId2);//关联管制事件id
dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质
for (int i = 0; i < dcEvent.getDcEventTrafficControl().getFacilityIds().length; i++) {
dcEvent.getDcEventTrafficControl().setId(map.get("facilityId"+i));//交通管制事件id
dcEvent.getDcEventTrafficControl().setFacilityId(dcEvent.getDcEventTrafficControl().getFacilityIds()[i]);//取出数组字段赋值 设施id
// 使用StringBuilder来构建逗号分隔的字符串
//新增第一条数据
dcEvent.setId(map.get("facilityId"+i));
dcEvent.setId(map.get("facilityId" + i));
dcEvent.setEventState(0L);
dcEvent.setDeptId(SecurityUtils.getDeptId());
dcEvent.setUserId(SecurityUtils.getUserId());
dcEvent.setCreateTime(DateUtils.getNowDate());
dcEvent.setEventNature(2L);//关联管制
// 使用StringBuilder来构建逗号分隔的字符串
StringBuilder sb = new StringBuilder();
boolean isFirst = true;
// 迭代Map并过滤出不为1的键对应的值
// 遍历map,排除与当前索引i对应的键
for (Map.Entry<String, String> entry : map.entrySet()) {
if (entry.getKey() !="facilityId"+i) {
if (!isFirst) {
if (!entry.getKey().equals("facilityId" + i)) {
if (sb.length() > 0) {
sb.append(",");
}
sb.append(entry.getValue());
isFirst = false;
}
}
String linkId= sb.toString();
String linkId = sb.toString();
dcEvent.setLinkId(linkId);
//交通管制
if (eventType ==3 && dcEvent.getDcEventTrafficControl().getFacilityIds()[i] != null) {
if (eventType == 3 && dcEvent.getDcEventTrafficControl().getFacilityIds()[i] != null) {
String facilityId = String.valueOf(dcEvent.getDcEventTrafficControl().getFacilityIds()[i]);
dcEvent.setStakeMark( extracted(facilityId));
dcEvent.setStakeMark(extracted(facilityId));
}
dcEventMapper.insertDcEvent(dcEvent);
//中间库
MdEvent mdEvent = new MdEvent(dcEvent);
middleDatabaseService.insertMiddleDatabaseEvent(mdEvent);
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl());
}
}else {
dcEventMapper.deleteDcEventById(uuid);//删除添加的事件主类
Map<String,String> map = new HashMap<>();
for (int i = 0; i < dcEvent.getDcEventTrafficControl().getFacilityIds().length; i++) { //设置事件Id UUID无下划线格式32
String facilityUUID = IdUtils.fastSimpleUUID();
map.put("facilityId"+i,facilityUUID);//每循环一次生成一个uuid
}
for (int i = 0; i < dcEvent.getDcEventTrafficControl().getFacilityIds().length; i++) {
dcEvent.getDcEventTrafficControl().setId(map.get("facilityId" + i));//交通管制事件id
dcEvent.getDcEventTrafficControl().setFacilityId(dcEvent.getDcEventTrafficControl().getFacilityIds()[i]);//取出数组字段赋值 设施id
//新增第一条数据
dcEvent.setId(map.get("facilityId" + i));
dcEvent.setEventState(0L);
dcEvent.setDeptId(SecurityUtils.getDeptId());
dcEvent.setUserId(SecurityUtils.getUserId());
dcEvent.setCreateTime(DateUtils.getNowDate());
dcEvent.setEventNature(2L);//关联管制
// 使用StringBuilder来构建逗号分隔的字符串
StringBuilder sb = new StringBuilder();
// 遍历map,排除与当前索引i对应的键
for (Map.Entry<String, String> entry : map.entrySet()) {
if (!entry.getKey().equals("facilityId" + i)) {
if (sb.length() > 0) {
sb.append(",");
}
sb.append(entry.getValue());
}
}
String linkId = sb.toString();
dcEvent.setLinkId(linkId);
System.out.println(linkId);
//交通管制
if (eventType == 3 && dcEvent.getDcEventTrafficControl().getFacilityIds()[i] != null) {
String facilityId = String.valueOf(dcEvent.getDcEventTrafficControl().getFacilityIds()[i]);
dcEvent.setStakeMark(extracted(facilityId));
}
//中间库
MdEvent mdEvent = new MdEvent(dcEvent);
middleDatabaseService.insertMiddleDatabaseEvent(mdEvent);
dcEventMapper.insertDcEvent(dcEvent);
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl());
}
}
}
}
@ -631,6 +725,8 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
}
/**
* 批量删除事件信息
*

485
zc-business/src/main/resources/mapper/business/DcEventMapper.xml

@ -4,84 +4,90 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zc.business.mapper.DcEventMapper">
<resultMap type="com.zc.business.domain.DcEvent" id="DcEventResult">
<result property="id" column="id" />
<result property="deptId" column="dept_id" />
<result property="stakeMark" column="stake_mark" />
<result property="direction" column="direction" />
<result property="userId" column="user_id" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="estimatedEndTime" column="estimated_end_time" />
<result property="eventLevel" column="event_level" />
<result property="eventType" column="event_type" />
<result property="eventSubclass" column="event_subclass" />
<result property="eventCause" column="event_cause" />
<result property="description" column="description" />
<result property="eventState" column="event_state" />
<result property="eventSource" column="event_source" />
<result property="eventNature" column="event_nature" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="eventSourceTips" column="event_source_tips" />
<result property="stringEventType" column="stringEventType" />
<result property="stringEventSource" column="stringEventSource" />
<result property="stringEventState" column="stringEventState" />
<result property="nickName" column="nickName" />
<result property="roadId" column="road_id" />
<result property="lang" column="lang" />
<result property="eventTitle" column="event_title" />
<result property="occurrenceTime" column="occurrence_time" />
<result property="isPerceived" column="is_perceived" />
<result property="id" column="id"/>
<result property="deptId" column="dept_id"/>
<result property="stakeMark" column="stake_mark"/>
<result property="direction" column="direction"/>
<result property="userId" column="user_id"/>
<result property="startTime" column="start_time"/>
<result property="endTime" column="end_time"/>
<result property="estimatedEndTime" column="estimated_end_time"/>
<result property="eventLevel" column="event_level"/>
<result property="eventType" column="event_type"/>
<result property="eventSubclass" column="event_subclass"/>
<result property="eventCause" column="event_cause"/>
<result property="description" column="description"/>
<result property="eventState" column="event_state"/>
<result property="eventSource" column="event_source"/>
<result property="eventNature" column="event_nature"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="eventSourceTips" column="event_source_tips"/>
<result property="stringEventType" column="stringEventType"/>
<result property="stringEventSource" column="stringEventSource"/>
<result property="stringEventState" column="stringEventState"/>
<result property="nickName" column="nickName"/>
<result property="roadId" column="road_id"/>
<result property="lang" column="lang"/>
<result property="eventTitle" column="event_title"/>
<result property="occurrenceTime" column="occurrence_time"/>
<result property="isPerceived" column="is_perceived"/>
<result property="dimension" column="dimension"/>
<result property="longitude" column="longitude"/>
<result property="linkId" column="link_id"/>
</resultMap>
<resultMap type="map" id="countMap">
<result property="status" column="status" />
<result property="count" column="count" />
<result property="status" column="status"/>
<result property="count" column="count"/>
</resultMap>
<resultMap type="com.zc.business.domain.DcEvent" id="DcEventResultById">
<result property="id" column="id" />
<result property="deptId" column="dept_id" />
<result property="stakeMark" column="stake_mark" />
<result property="direction" column="direction" />
<result property="userId" column="user_id" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="estimatedEndTime" column="estimated_end_time" />
<result property="eventLevel" column="event_level" />
<result property="eventType" column="event_type" />
<result property="eventSubclass" column="event_subclass" />
<result property="eventCause" column="event_cause" />
<result property="description" column="description" />
<result property="eventState" column="event_state" />
<result property="eventSource" column="event_source" />
<result property="eventNature" column="event_nature" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="eventSourceTips" column="event_source_tips" />
<result property="inTunnel" column="in_tunnel" />
<result property="eventName" column="event_name" />
<result property="nodeNode" column="node_node" />
<result property="roadId" column="road_id" />
<result property="occurrenceTime" column="occurrence_time" />
<result property="eventTitle" column="event_title" />
<result property="commonPhrases" column="common_phrases" />
<result property="stringEventType" column="stringEventType" />
<result property="stringEventSource" column="stringEventSource" />
<result property="stringEventState" column="stringEventState" />
<result property="nickName" column="nickName" />
<result property="lang" column="lang" />
<result property="roadName" column="road_name" />
<result property="organizationName" column="organization_name" />
<result property="isPerceived" column="is_perceived" />
<result property="subclass" column="subclass" />
<result property="id" column="id"/>
<result property="deptId" column="dept_id"/>
<result property="stakeMark" column="stake_mark"/>
<result property="direction" column="direction"/>
<result property="userId" column="user_id"/>
<result property="startTime" column="start_time"/>
<result property="endTime" column="end_time"/>
<result property="estimatedEndTime" column="estimated_end_time"/>
<result property="eventLevel" column="event_level"/>
<result property="eventType" column="event_type"/>
<result property="eventSubclass" column="event_subclass"/>
<result property="eventCause" column="event_cause"/>
<result property="description" column="description"/>
<result property="eventState" column="event_state"/>
<result property="eventSource" column="event_source"/>
<result property="eventNature" column="event_nature"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="eventSourceTips" column="event_source_tips"/>
<result property="inTunnel" column="in_tunnel"/>
<result property="eventName" column="event_name"/>
<result property="nodeNode" column="node_node"/>
<result property="roadId" column="road_id"/>
<result property="occurrenceTime" column="occurrence_time"/>
<result property="eventTitle" column="event_title"/>
<result property="commonPhrases" column="common_phrases"/>
<result property="stringEventType" column="stringEventType"/>
<result property="stringEventSource" column="stringEventSource"/>
<result property="stringEventState" column="stringEventState"/>
<result property="nickName" column="nickName"/>
<result property="lang" column="lang"/>
<result property="roadName" column="road_name"/>
<result property="organizationName" column="organization_name"/>
<result property="isPerceived" column="is_perceived"/>
<result property="subclass" column="subclass"/>
<result property="dimension" column="dimension"/>
<result property="longitude" column="longitude"/>
<result property="linkId" column="link_id"/>
</resultMap>
<!--
<!--
<resultMap type="com.zc.business.domain.DcEvent" id="DcEventResultListAll">
<result property="id" column="id" />
<result property="deptId" column="dept_id" />
@ -136,14 +142,13 @@
<result property="dcEventMap.contactNumber" column="contact_number"/>
</resultMap>
-->
-->
<!-- <sql id="selectDcEventVo">
<!-- <sql id="selectDcEventVo">
select id, dept_id, stake_mark, direction, user_id, start_time, end_time, estimated_end_time, event_level, event_type, event_subclass, event_cause, description, event_state, event_source, event_nature, remark, create_time, update_time, event_source_tips, in_tunnel from dc_event
</sql> -->
<sql id="selectDcEventVo">
SELECT
id,
SELECT id,
dc_event.dept_id as dept_id,
sys_dept.dept_name,
stake_mark,
@ -158,7 +163,10 @@
estimated_end_time,
event_level,
event_type,
longitude,
dimension,
event_title,
link_id,
is_perceived,
CASE event_type
WHEN '1' THEN '交通事故'
@ -175,58 +183,58 @@
ELSE '其他'
END AS stringEventType,
CASE event_subclass
WHEN '1-1'THEN '追尾'
WHEN '1-2'THEN '侧翻'
WHEN '1-3'THEN '撞护栏'
WHEN '1-4'THEN '自然'
WHEN '1-5'THEN '其他事故'
WHEN '2-1'THEN '车辆故障'
WHEN '3-1'THEN '主线封闭和限行'
WHEN '3-2'THEN '收费站封闭和限行'
WHEN '3-3'THEN '立交封闭和限行'
WHEN '3-4'THEN '服务区封闭和限行'
WHEN '4-1'THEN '道路拥堵'
WHEN '4-2'THEN '立交拥堵'
WHEN '4-3'THEN '收费站拥堵'
WHEN '4-4'THEN '服务区拥堵'
WHEN '5-1'THEN '行人'
WHEN '5-2'THEN '非机动车'
WHEN '5-3'THEN '摩托车'
WHEN '5-4'THEN '其他'
WHEN '6-1'THEN '烟雾'
WHEN '6-2'THEN '倒伏树木'
WHEN '6-3'THEN '撒落物'
WHEN '6-4'THEN '动物'
WHEN '6-5'THEN '其他'
WHEN '7-1'THEN '道路养护施工'
WHEN '7-2'THEN '收费站养护施工'
WHEN '7-3'THEN '服务区养护施工'
WHEN '7-4'THEN '枢纽立交匝道养护施工'
WHEN '7-5'THEN '地方道路养护施工'
WHEN '7-6'THEN '道路工程建设施工'
WHEN '7-7'THEN '收费站工程建设施工'
WHEN '7-8'THEN '服务区工程建设施工'
WHEN '1-1' THEN '追尾'
WHEN '1-2' THEN '侧翻'
WHEN '1-3' THEN '撞护栏'
WHEN '1-4' THEN '自然'
WHEN '1-5' THEN '其他事故'
WHEN '2-1' THEN '车辆故障'
WHEN '3-1' THEN '主线封闭和限行'
WHEN '3-2' THEN '收费站封闭和限行'
WHEN '3-3' THEN '立交封闭和限行'
WHEN '3-4' THEN '服务区封闭和限行'
WHEN '4-1' THEN '道路拥堵'
WHEN '4-2' THEN '立交拥堵'
WHEN '4-3' THEN '收费站拥堵'
WHEN '4-4' THEN '服务区拥堵'
WHEN '5-1' THEN '行人'
WHEN '5-2' THEN '非机动车'
WHEN '5-3' THEN '摩托车'
WHEN '5-4' THEN '其他'
WHEN '6-1' THEN '烟雾'
WHEN '6-2' THEN '倒伏树木'
WHEN '6-3' THEN '撒落物'
WHEN '6-4' THEN '动物'
WHEN '6-5' THEN '其他'
WHEN '7-1' THEN '道路养护施工'
WHEN '7-2' THEN '收费站养护施工'
WHEN '7-3' THEN '服务区养护施工'
WHEN '7-4' THEN '枢纽立交匝道养护施工'
WHEN '7-5' THEN '地方道路养护施工'
WHEN '7-6' THEN '道路工程建设施工'
WHEN '7-7' THEN '收费站工程建设施工'
WHEN '7-8' THEN '服务区工程建设施工'
WHEN '7-9' THEN '枢纽立交匝道工程建设施工'
WHEN '7-10' THEN'地方道路工程建设施工'
WHEN '8-1'THEN'封闭、暂停营业'
WHEN '8-2'THEN'重要设施停用'
WHEN '8-3'THEN'服务区其他异常'
WHEN '9-1'THEN'摄像机'
WHEN '9-2'THEN'护栏'
WHEN '9-3'THEN'隔离栅'
WHEN '9-4'THEN'情报板'
WHEN '9-5'THEN'防炫板'
WHEN '9-6'THEN'其他'
WHEN '10-1' THEN'雨'
WHEN '10-2' THEN'雪'
WHEN '10-3' THEN'雾'
WHEN '10-4' THEN'大风'
WHEN '10-5' THEN'低温寒潮'
WHEN '10-6' THEN'路面积雪'
WHEN '10-7' THEN'路面结冰'
WHEN '10-8' THEN'路面积水'
WHEN '10-9' THEN'其他'
WHEN '11-1' THEN'其他事件'
WHEN '7-10' THEN '地方道路工程建设施工'
WHEN '8-1' THEN '封闭、暂停营业'
WHEN '8-2' THEN '重要设施停用'
WHEN '8-3' THEN '服务区其他异常'
WHEN '9-1' THEN '摄像机'
WHEN '9-2' THEN '护栏'
WHEN '9-3' THEN '隔离栅'
WHEN '9-4' THEN '情报板'
WHEN '9-5' THEN '防炫板'
WHEN '9-6' THEN '其他'
WHEN '10-1' THEN '雨'
WHEN '10-2' THEN '雪'
WHEN '10-3' THEN '雾'
WHEN '10-4' THEN '大风'
WHEN '10-5' THEN '低温寒潮'
WHEN '10-6' THEN '路面积雪'
WHEN '10-7' THEN '路面结冰'
WHEN '10-8' THEN '路面积水'
WHEN '10-9' THEN '其他'
WHEN '11-1' THEN '其他事件'
END AS event_subclass,
event_cause,
description,
@ -256,14 +264,16 @@
in_tunnel,
road_id,
lang
FROM
dc_event
FROM dc_event
LEFT JOIN sys_user on dc_event.user_id = sys_user.user_id
LEFT JOIN sys_dept on dc_event.dept_id = sys_dept.dept_id
</sql>
<sql id="selectDcEventVoListAll"> select dc_event.id AS id,
dc_event.stake_mark,
dc_event.link_id,
dc_event.dimension,
dc_event.longitude,
dc_event.direction,
dc_event.is_perceived,
dc_event.user_id,
@ -314,34 +324,37 @@
dc_vehicles.remark AS dc_vehicles_remark,
dc_employees.post_id,
dc_employees.NAME,
dc_employees.contact_number FROM dc_event </sql>
dc_employees.contact_number
FROM dc_event </sql>
<select id="selectDcEventList" parameterType="DcEvent" resultMap="DcEventResult">
<include refid="selectDcEventVo"/>
<where>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="stakeMark != null and stakeMark != ''"> and stake_mark BETWEEN #{stakeMark} and #{endStakeMark}</if>
<if test="direction != null and direction != ''"> and direction = #{direction}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="startTime != null "> and start_time BETWEEN #{startTime} and #{endTime}</if>
<if test="estimatedEndTime != null "> and estimated_end_time = #{estimatedEndTime}</if>
<if test="eventLevel != null "> and event_level = #{eventLevel}</if>
<if test="eventType != null "> and event_type = #{eventType}</if>
<if test="eventSubclass != null and eventSubclass != ''"> and event_subclass = #{eventSubclass}</if>
<if test="eventCause != null and eventCause != ''"> and event_cause = #{eventCause}</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="eventState != null "> and event_state = #{eventState}</if>
<if test="eventSource != null "> and event_source = #{eventSource}</if>
<if test="eventNature != null "> and event_nature = #{eventNature}</if>
<if test="eventSourceTips != null and eventSourceTips != ''"> and event_source_tips = #{eventSourceTips}</if>
<if test="inTunnel != null "> and in_tunnel = #{inTunnel}</if>
<if test="isPerceived != null "> and is_perceived = #{isPerceived}</if>
<if test="deptId != null ">and dept_id = #{deptId}</if>
<if test="stakeMark != null and stakeMark != ''">and stake_mark BETWEEN #{stakeMark} and #{endStakeMark}
</if>
<if test="direction != null and direction != ''">and direction = #{direction}</if>
<if test="userId != null ">and user_id = #{userId}</if>
<if test="startTime != null ">and start_time BETWEEN #{startTime} and #{endTime}</if>
<if test="estimatedEndTime != null ">and estimated_end_time = #{estimatedEndTime}</if>
<if test="eventLevel != null ">and event_level = #{eventLevel}</if>
<if test="eventType != null ">and event_type = #{eventType}</if>
<if test="eventSubclass != null and eventSubclass != ''">and event_subclass = #{eventSubclass}</if>
<if test="eventCause != null and eventCause != ''">and event_cause = #{eventCause}</if>
<if test="description != null and description != ''">and description = #{description}</if>
<if test="eventState != null ">and event_state = #{eventState}</if>
<if test="eventSource != null ">and event_source = #{eventSource}</if>
<if test="eventNature != null ">and event_nature = #{eventNature}</if>
<if test="eventSourceTips != null and eventSourceTips != ''">and event_source_tips = #{eventSourceTips}
</if>
<if test="inTunnel != null ">and in_tunnel = #{inTunnel}</if>
<if test="isPerceived != null ">and is_perceived = #{isPerceived}</if>
</where>
ORDER BY create_time desc
</select>
<!-- 关联调度信息记录表 查询详情 -->
<!--
<!-- 关联调度信息记录表 查询详情 -->
<!--
<select id="selectDcEventById" parameterType="String" resultMap="DcEventResultListAll">
<include refid="selectDcEventVoListAll"/>
LEFT JOIN dc_event_type ON dc_event.event_type = dc_event_type.event_type LEFT JOIN dc_process_config ON dc_event_type.event_type = dc_process_config.event_type
@ -357,18 +370,21 @@
LEFT JOIN dc_employees ON dc_dispatch_resource.resource_id = dc_employees.id
where dc_event.id = #{id}
</select>
-->
-->
<!-- 事件详情 包含事件类型 节点-->
<!-- 事件详情 包含事件类型 节点-->
<select id="selectDcEventById" parameterType="String" resultMap="DcEventResultById">
/*详情可以调用事件处理流程*/
SELECT dc_event.id AS id,
dc_event.stake_mark,
dc_event.link_id,
CASE dc_event.direction
WHEN '1' THEN '菏泽方向'
WHEN '3' THEN '济南方向'
END AS direction,
dc_event.user_id,
dc_event.dimension,
dc_event.longitude,
dc_event.is_perceived,
dc_event.user_id as user_id,
sys_user.nick_name as nickName,
@ -394,58 +410,58 @@
ELSE '其他'
END AS stringEventType,
CASE dc_event.event_subclass
WHEN '1-1'THEN '追尾'
WHEN '1-2'THEN '侧翻'
WHEN '1-3'THEN '撞护栏'
WHEN '1-4'THEN '自然'
WHEN '1-5'THEN '其他事故'
WHEN '2-1'THEN '车辆故障'
WHEN '3-1'THEN '主线封闭和限行'
WHEN '3-2'THEN '收费站封闭和限行'
WHEN '3-3'THEN '立交封闭和限行'
WHEN '3-4'THEN '服务区封闭和限行'
WHEN '4-1'THEN '道路拥堵'
WHEN '4-2'THEN '立交拥堵'
WHEN '4-3'THEN '收费站拥堵'
WHEN '4-4'THEN '服务区拥堵'
WHEN '5-1'THEN '行人'
WHEN '5-2'THEN '非机动车'
WHEN '5-3'THEN '摩托车'
WHEN '5-4'THEN '其他'
WHEN '6-1'THEN '烟雾'
WHEN '6-2'THEN '倒伏树木'
WHEN '6-3'THEN '撒落物'
WHEN '6-4'THEN '动物'
WHEN '6-5'THEN '其他'
WHEN '7-1'THEN '道路养护施工'
WHEN '7-2'THEN '收费站养护施工'
WHEN '7-3'THEN '服务区养护施工'
WHEN '7-4'THEN '枢纽立交匝道养护施工'
WHEN '7-5'THEN '地方道路养护施工'
WHEN '7-6'THEN '道路工程建设施工'
WHEN '7-7'THEN '收费站工程建设施工'
WHEN '7-8'THEN '服务区工程建设施工'
WHEN '1-1' THEN '追尾'
WHEN '1-2' THEN '侧翻'
WHEN '1-3' THEN '撞护栏'
WHEN '1-4' THEN '自然'
WHEN '1-5' THEN '其他事故'
WHEN '2-1' THEN '车辆故障'
WHEN '3-1' THEN '主线封闭和限行'
WHEN '3-2' THEN '收费站封闭和限行'
WHEN '3-3' THEN '立交封闭和限行'
WHEN '3-4' THEN '服务区封闭和限行'
WHEN '4-1' THEN '道路拥堵'
WHEN '4-2' THEN '立交拥堵'
WHEN '4-3' THEN '收费站拥堵'
WHEN '4-4' THEN '服务区拥堵'
WHEN '5-1' THEN '行人'
WHEN '5-2' THEN '非机动车'
WHEN '5-3' THEN '摩托车'
WHEN '5-4' THEN '其他'
WHEN '6-1' THEN '烟雾'
WHEN '6-2' THEN '倒伏树木'
WHEN '6-3' THEN '撒落物'
WHEN '6-4' THEN '动物'
WHEN '6-5' THEN '其他'
WHEN '7-1' THEN '道路养护施工'
WHEN '7-2' THEN '收费站养护施工'
WHEN '7-3' THEN '服务区养护施工'
WHEN '7-4' THEN '枢纽立交匝道养护施工'
WHEN '7-5' THEN '地方道路养护施工'
WHEN '7-6' THEN '道路工程建设施工'
WHEN '7-7' THEN '收费站工程建设施工'
WHEN '7-8' THEN '服务区工程建设施工'
WHEN '7-9' THEN '枢纽立交匝道工程建设施工'
WHEN '7-10' THEN'地方道路工程建设施工'
WHEN '8-1'THEN'封闭、暂停营业'
WHEN '8-2'THEN'重要设施停用'
WHEN '8-3'THEN'服务区其他异常'
WHEN '9-1'THEN'摄像机'
WHEN '9-2'THEN'护栏'
WHEN '9-3'THEN'隔离栅'
WHEN '9-4'THEN'情报板'
WHEN '9-5'THEN'防炫板'
WHEN '9-6'THEN'其他'
WHEN '10-1' THEN'雨'
WHEN '10-2' THEN'雪'
WHEN '10-3' THEN'雾'
WHEN '10-4' THEN'大风'
WHEN '10-5' THEN'低温寒潮'
WHEN '10-6' THEN'路面积雪'
WHEN '10-7' THEN'路面结冰'
WHEN '10-8' THEN'路面积水'
WHEN '10-9' THEN'其他'
WHEN '11-1' THEN'其他事件'
WHEN '7-10' THEN '地方道路工程建设施工'
WHEN '8-1' THEN '封闭、暂停营业'
WHEN '8-2' THEN '重要设施停用'
WHEN '8-3' THEN '服务区其他异常'
WHEN '9-1' THEN '摄像机'
WHEN '9-2' THEN '护栏'
WHEN '9-3' THEN '隔离栅'
WHEN '9-4' THEN '情报板'
WHEN '9-5' THEN '防炫板'
WHEN '9-6' THEN '其他'
WHEN '10-1' THEN '雨'
WHEN '10-2' THEN '雪'
WHEN '10-3' THEN '雾'
WHEN '10-4' THEN '大风'
WHEN '10-5' THEN '低温寒潮'
WHEN '10-6' THEN '路面积雪'
WHEN '10-7' THEN '路面结冰'
WHEN '10-8' THEN '路面积水'
WHEN '10-9' THEN '其他'
WHEN '11-1' THEN '其他事件'
END AS event_subclass,
dc_event.event_subclass AS subclass,
dc_event.event_cause,
@ -515,6 +531,9 @@
<if test="eventTitle != null">event_title,</if>
<if test="occurrenceTime != null">occurrence_time,</if>
<if test="isPerceived != null">is_perceived,</if>
<if test="dimension != null">dimension,</if>
<if test="longitude != null">longitude,</if>
<if test="linkId != null">link_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@ -543,10 +562,13 @@
<if test="eventTitle != null">#{eventTitle},</if>
<if test="occurrenceTime != null">#{occurrenceTime},</if>
<if test="isPerceived != null">#{isPerceived},</if>
<if test="dimension != null">#{dimension},</if>
<if test="longitude != null">#{longitude},</if>
<if test="linkId != null">#{linkId},</if>
</trim>
</insert>
<insert id="batchInsertDcEvent" useGeneratedKeys="true" keyProperty="id">
<foreach collection ="list" item="dcEvent" index= "index" separator =";">
<foreach collection="list" item="dcEvent" index="index" separator=";">
insert into dc_event
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dcEvent.id != null">id,</if>
@ -575,6 +597,8 @@
<if test="dcEvent.eventTitle != null">event_title,</if>
<if test="dcEvent.occurrenceTime != null">occurrence_time,</if>
<if test="dcEvent.isPerceived != null">is_perceived,</if>
<if test="dcEvent.dimension != null">dimension,</if>
<if test="dcEvent.longitude != null">longitude,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="dcEvent.id != null">#{dcEvent.id},</if>
@ -603,6 +627,8 @@
<if test="dcEvent.eventTitle != null">#{dcEvent.eventTitle},</if>
<if test="dcEvent.occurrenceTime != null">#{dcEvent.occurrenceTime},</if>
<if test="dcEvent.isPerceived != null">#{dcEvent.isPerceived},</if>
<if test="dcEvent.dimension != null">#{dcEvent.dimension},</if>
<if test="dcEvent.longitude != null">#{dcEvent.longitude},</if>
</trim>
</foreach>
</insert>
@ -635,13 +661,52 @@
<if test="eventTitle != null">event_title = #{eventTitle},</if>
<if test="occurrenceTime != null">occurrence_time = #{occurrenceTime},</if>
<if test="isPerceived != null">is_perceived = #{isPerceived},</if>
<if test="dimension != null">dimension = #{dimension},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="linkId != null">link_id = #{linkId},</if>
</trim>
where id = #{id}
</update>
<update id="updateDcEventLinkId" parameterType="DcEvent">
update dc_event
<trim prefix="SET" suffixOverrides=",">
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="stakeMark != null and stakeMark != ''">stake_mark = #{stakeMark},</if>
<if test="direction != null and direction != ''">direction = #{direction},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="estimatedEndTime != null">estimated_end_time = #{estimatedEndTime},</if>
<if test="eventLevel != null">event_level = #{eventLevel},</if>
<if test="eventType != null">event_type = #{eventType},</if>
<if test="eventSubclass != null">event_subclass = #{eventSubclass},</if>
<if test="eventCause != null">event_cause = #{eventCause},</if>
<if test="description != null">description = #{description},</if>
<if test="eventState != null">event_state = #{eventState},</if>
<if test="eventSource != null">event_source = #{eventSource},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="eventSourceTips != null">event_source_tips = #{eventSourceTips},</if>
<if test="inTunnel != null">in_tunnel = #{inTunnel},</if>
<if test="roadId != null">road_id = #{roadId},</if>
<if test="lang != null">road_id = #{lang},</if>
<if test="eventTitle != null">event_title = #{eventTitle},</if>
<if test="occurrenceTime != null">occurrence_time = #{occurrenceTime},</if>
<if test="isPerceived != null">is_perceived = #{isPerceived},</if>
<if test="dimension != null">dimension = #{dimension},</if>
<if test="eventNature != null">event_nature = #{eventNature},</if>
<if test="linkId != null">link_id = #{linkId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDcEventById" parameterType="String">
delete from dc_event where id = #{id}
delete
from dc_event
where id = #{id}
</delete>
<delete id="deleteDcEventByIds" parameterType="String">
@ -651,22 +716,21 @@
</foreach>
</delete>
<!--
<!--
调度记录-事件列表 按时间展示交通事件。默认当天时间 。可查询条件 交通事件状态 ,时间范围
-->
-->
<select id="selectDispatchEventList" resultMap="DcEventResult" parameterType="DcEvent">
<select id="selectDispatchEventList" resultMap="DcEventResult" parameterType="DcEvent">
<include refid="selectDcEventVo"/>
<where>
<if test="startTime == null and eventState == null">DATE(dc_event.start_time) = CURDATE()</if>
<if test="eventState != null "> and event_state = #{eventState}</if>
<if test="startTime != null "> and start_time BETWEEN #{startTime} and #{endTime} </if>
<if test="eventState != null ">and event_state = #{eventState}</if>
<if test="startTime != null ">and start_time BETWEEN #{startTime} and #{endTime}</if>
</where>
</select>
</select>
<select id="selectCount" resultMap="countMap" resultType="map">
SELECT
s.status,
SELECT s.status,
COALESCE(t.count, 0) AS count
FROM (
SELECT 0 AS event_state, 'state0Count' AS status UNION ALL
@ -675,10 +739,11 @@
SELECT 3 AS event_state, 'state3Count' AS status
) s
LEFT JOIN (
SELECT event_state, COUNT(*) AS count
SELECT event_state, COUNT (*) AS count
FROM dc_event
GROUP BY event_state
) t ON s.event_state = t.event_state;
) t
ON s.event_state = t.event_state;
</select>
<select id="getProcessNode" resultType="java.util.Map">

2
zc-business/src/main/resources/mapper/business/EventPlanAssocMapper.xml

@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zc.business.mapper.EventPlanAssocMapper">
<insert id="insertEventPlanAssoc" parameterType="EventPlanAssoc">
<insert id="insertEventPlanAssoc" parameterType="EventPlanAssoc" useGeneratedKeys="true" keyProperty="id">
insert into event_plan_assoc
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="eventId != null and eventId != ''">event_id,</if>

Loading…
Cancel
Save