Browse Source

事件录入信息接口

develop
王兴琳 1 year ago
parent
commit
ed98907a66
  1. 129
      zc-business/src/main/java/com/zc/business/controller/DcDispatchController.java
  2. 35
      zc-business/src/main/java/com/zc/business/controller/DcEventController.java
  3. 9
      zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java
  4. 141
      zc-business/src/main/java/com/zc/business/domain/DcDispatch.java
  5. 216
      zc-business/src/main/java/com/zc/business/domain/DcEvent.java
  6. 2
      zc-business/src/main/java/com/zc/business/domain/DcEventAbnormalWeather.java
  7. 2
      zc-business/src/main/java/com/zc/business/domain/DcEventAccident.java
  8. 7
      zc-business/src/main/java/com/zc/business/domain/DcEventConstruction.java
  9. 7
      zc-business/src/main/java/com/zc/business/domain/DcEventServiceArea.java
  10. 7
      zc-business/src/main/java/com/zc/business/domain/DcEventTrafficCongestion.java
  11. 11
      zc-business/src/main/java/com/zc/business/domain/DcEventTrafficControl.java
  12. 2
      zc-business/src/main/java/com/zc/business/domain/DcEventVehicleAccident.java
  13. 69
      zc-business/src/main/java/com/zc/business/mapper/DcDispatchMapper.java
  14. 5
      zc-business/src/main/java/com/zc/business/mapper/DcEventMapper.java
  15. 7
      zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java
  16. 69
      zc-business/src/main/java/com/zc/business/service/IDcDispatchService.java
  17. 2
      zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java
  18. 14
      zc-business/src/main/java/com/zc/business/service/IDcEventService.java
  19. 111
      zc-business/src/main/java/com/zc/business/service/impl/DcDispatchServiceImpl.java
  20. 5
      zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java
  21. 277
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  22. 94
      zc-business/src/main/resources/mapper/business/DcDispatchMapper.xml
  23. 35
      zc-business/src/main/resources/mapper/business/DcEventConstructionMapper.xml
  24. 196
      zc-business/src/main/resources/mapper/business/DcEventMapper.xml
  25. 7
      zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml
  26. 28
      zc-business/src/main/resources/mapper/business/DcEventServiceAreaMapper.xml
  27. 33
      zc-business/src/main/resources/mapper/business/DcEventTrafficCongestionMapper.xml
  28. 34
      zc-business/src/main/resources/mapper/business/DcEventTrafficControlMapper.xml

129
zc-business/src/main/java/com/zc/business/controller/DcDispatchController.java

@ -0,0 +1,129 @@
package com.zc.business.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.zc.business.domain.DcDispatch;
import com.zc.business.service.IDcDispatchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 调度信息记录Controller
*
* @author ruoyi
* @date 2024-01-15
*/
@RestController
@RequestMapping("/dc/system/dispatch")
@Api(tags = "调度信息记录")
public class DcDispatchController extends BaseController
{
@Autowired
private IDcDispatchService dcDispatchService;
/**
* 查询调度信息记录列表
*/
@ApiOperation("查询调度信息记录列表")
//@PreAuthorize("@ss.hasPermi('system:dispatch:list')")
@GetMapping("/list")
public TableDataInfo list(DcDispatch dcDispatch)
{
startPage();
List<DcDispatch> list = dcDispatchService.selectDcDispatchList(dcDispatch);
return getDataTable(list);
}
/**
* 导出调度信息记录列表
*/
// @ApiOperation("查询调度信息记录列表")
// @PreAuthorize("@ss.hasPermi('system:dispatch:export')")
@Log(title = "调度信息记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DcDispatch dcDispatch)
{
List<DcDispatch> list = dcDispatchService.selectDcDispatchList(dcDispatch);
ExcelUtil<DcDispatch> util = new ExcelUtil<>(DcDispatch.class);
util.exportExcel(response, list, "调度信息记录数据");
}
/**
* 获取调度信息记录详细信息
*/
@ApiOperation("获取调度信息记录详细信息")
// @PreAuthorize("@ss.hasPermi('system:dispatch:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(dcDispatchService.selectDcDispatchById(id));
}
/**
* 根据事件id获取调度信息记录详细信息
*/
@ApiOperation("根据事件id获取调度信息记录详细信息")
// @PreAuthorize("@ss.hasPermi('system:dispatch:query')")
@GetMapping(value = "/EventId/{id}")
public TableDataInfo getEventId(@PathVariable("id") String id)
{
return getDataTable(dcDispatchService.selectDcDispatchByEventId(id));
}
/**
* 新增调度信息记录
*/
@ApiOperation("新增调度信息记录")
//@PreAuthorize("@ss.hasPermi('system:dispatch:add')")
@Log(title = "调度信息记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcDispatch dcDispatch)
{
return toAjax(dcDispatchService.insertDcDispatch(dcDispatch));
}
/**
* 修改调度信息记录
*/
@ApiOperation("修改调度信息记录")
// @PreAuthorize("@ss.hasPermi('system:dispatch:edit')")
@Log(title = "调度信息记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcDispatch dcDispatch)
{
return toAjax(dcDispatchService.updateDcDispatch(dcDispatch));
}
/**
* 删除调度信息记录
*/
@ApiOperation("删除调度信息记录")
//@PreAuthorize("@ss.hasPermi('system:dispatch:remove')")
@Log(title = "调度信息记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dcDispatchService.deleteDcDispatchByIds(ids));
}
}

35
zc-business/src/main/java/com/zc/business/controller/DcEventController.java

@ -37,7 +37,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
*/
@Api(tags = "事件信息")
@RestController
@RequestMapping("/system/event")
@RequestMapping("/dc/system/event")
public class DcEventController extends BaseController
{
@Autowired
@ -57,7 +57,15 @@ public class DcEventController extends BaseController
return getDataTable(list);
}
/**调度记录-事件列表 按时间展示交通事件默认当天时间 可查询条件 交通事件状态 时间范围
*
*/
@ApiOperation("调度记录-事件列表 按时间展示交通事件,默认当天时间 。可查询条件 交通事件状态 ,时间范围")
@GetMapping("/dispatchEventList")
public TableDataInfo dispatchEventList(DcEvent dcEvent){
List<DcEvent> list = dcEventService.selectDispatchEventList(dcEvent);
return getDataTable(list);
}
/**
* 导出事件信息列表
@ -84,6 +92,22 @@ public class DcEventController extends BaseController
DcEvent dcEvent = dcEventService.selectDcEventById(id);
return AjaxResult.success(dcEvent);
}
/**
* 获取事件以及子类详细信息
*/
@ApiOperation("获取事件以及子类详细信息")
//@PreAuthorize("@ss.hasPermi('system:event:query')")
@GetMapping( "/eventSubclass/{eventType}/{id}")
@ApiImplicitParams({
@ApiImplicitParam(name = "eventType", value = "事件类型", dataType = "int"),
@ApiImplicitParam(name = "id", value = "事件id", dataType = "String"),
})
public AjaxResult getEventById(@PathVariable int eventType,@PathVariable("id") String id)
{
DcEvent dcEvent = dcEventService.selectEventSubclassById(eventType,id);
return AjaxResult.success(dcEvent);
}
/**
* 新增事件信息
@ -92,6 +116,7 @@ public class DcEventController extends BaseController
//@PreAuthorize("@ss.hasPermi('system:event:add')")
@Log(title = "事件信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcEvent dcEvent)
{
@ -116,10 +141,10 @@ public class DcEventController extends BaseController
@ApiOperation("删除事件信息")
// @PreAuthorize("@ss.hasPermi('system:event:remove')")
@Log(title = "事件信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
@DeleteMapping("/{eventType}/{ids}")
public AjaxResult remove(@PathVariable int eventType,@PathVariable String[] ids )
{
return toAjax(dcEventService.deleteDcEventByIds(ids));
return toAjax(dcEventService.deleteDcEventByIds(eventType,ids));
}

9
zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java

@ -122,4 +122,13 @@ public class DcEventProcessController extends BaseController
{
return toAjax(dcEventProcessService.deleteDcEventProcessByIds(ids));
}
/**
* 根据事件id查询处理流程
*/
@GetMapping("/eventProcessById")
@ApiOperation("根据事件id查询处理流程")
public TableDataInfo eventProcessById(@PathVariable String id){
return getDataTable(dcEventProcessService.selectDcEventProcessListById(id));
}
}

141
zc-business/src/main/java/com/zc/business/domain/DcDispatch.java

@ -0,0 +1,141 @@
package com.zc.business.domain;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 调度信息记录对象 dc_dispatch
*
* @author ruoyi
* @date 2024-01-15
*/
@ApiModel(value = "DcDispatch",description = "调度信息记录")
public class DcDispatch extends BaseEntity
{
private static final long serialVersionUID = 1L;
@ApiModelProperty("id")
/** $主键id */
private Long id;
@ApiModelProperty("所属机构名称")
@TableField(exist = false)
private String organizationName;
/** 所属机构 */
@ApiModelProperty("所属机构ID")
private Long organizationId;
@ApiModelProperty("调度事件")
/** 调度事件 */
private String eventId;
@ApiModelProperty("调度任务名称")
/** 调度任务名称*/
private String dispatchName;
/** 调度状态 1-计划中2-进行中3-已完成 */
@ApiModelProperty("调度状态")
private Long dispatchStatus;
/** 调度开始时间*/
@ApiModelProperty("调度开始时间")
private Date startTime;
/** 调度结束时间 */
@ApiModelProperty("调度结束时间")
private Date endTime;
public String getOrganizationName() {
return organizationName;
}
public void setOrganizationName(String organizationName) {
this.organizationName = organizationName;
}
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setOrganizationId(Long organizationId)
{
this.organizationId = organizationId;
}
public Long getOrganizationId()
{
return organizationId;
}
public void setEventId(String eventId)
{
this.eventId = eventId;
}
public String getEventId()
{
return eventId;
}
public void setDispatchName(String dispatchName)
{
this.dispatchName = dispatchName;
}
public String getDispatchName()
{
return dispatchName;
}
public void setDispatchStatus(Long dispatchStatus)
{
this.dispatchStatus = dispatchStatus;
}
public Long getDispatchStatus()
{
return dispatchStatus;
}
public void setStartTime(Date startTime)
{
this.startTime = startTime;
}
public Date getStartTime()
{
return startTime;
}
public void setEndTime(Date endTime)
{
this.endTime = endTime;
}
public Date getEndTime()
{
return endTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("organizationId", getOrganizationId())
.append("eventId", getEventId())
.append("dispatchName", getDispatchName())
.append("dispatchStatus", getDispatchStatus())
.append("startTime", getStartTime())
.append("endTime", getEndTime())
.append("remark", getRemark())
.append("organizationName", getOrganizationName())
.toString();
}
}

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

@ -2,9 +2,13 @@ package com.zc.business.domain;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
@ -16,8 +20,11 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author ruoyi
* @date 2024-01-12
*/
@ApiModel(value = "DcEvent", description = "事件信息实体")
@ApiModel("事件信息实体")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DcEvent extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
@ -162,181 +169,44 @@ public class DcEvent extends BaseEntity {
*/
@ApiModelProperty("事件来源补充说明")
private String eventSourceTips;
/**
* 是否处在隧道
*/
@ApiModelProperty("是否处在隧道 0 表示 false,1 表示 true")
private Integer inTunnel;
public void setId(String id) {
this.id = id;
}
public String getId() {
return id;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public Long getDeptId() {
return deptId;
}
public void setStakeMark(String stakeMark) {
this.stakeMark = stakeMark;
}
public String getStakeMark() {
return stakeMark;
}
public void setDirection(String direction) {
this.direction = direction;
}
public String getDirection() {
return direction;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getUserId() {
return userId;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getStartTime() {
return startTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public Date getEndTime() {
return endTime;
}
public void setEstimatedEndTime(Date estimatedEndTime) {
this.estimatedEndTime = estimatedEndTime;
}
public Date getEstimatedEndTime() {
return estimatedEndTime;
}
public void setEventLevel(Long eventLevel) {
this.eventLevel = eventLevel;
}
public Long getEventLevel() {
return eventLevel;
}
public void setEventType(Long eventType) {
this.eventType = eventType;
}
public Long getEventType() {
return eventType;
}
public void setEventSubclass(String eventSubclass) {
this.eventSubclass = eventSubclass;
}
public String getEventSubclass() {
return eventSubclass;
}
public void setEventCause(String eventCause) {
this.eventCause = eventCause;
}
public String getEventCause() {
return eventCause;
}
public void setDescription(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
public void setEventState(Long eventState) {
this.eventState = eventState;
}
public Long getEventState() {
return eventState;
}
public void setEventSource(Long eventSource) {
this.eventSource = eventSource;
}
public Long getEventSource() {
return eventSource;
}
public void setEventNature(Long eventNature) {
this.eventNature = eventNature;
}
public Long getEventNature() {
return eventNature;
}
public void setEventSourceTips(String eventSourceTips) {
this.eventSourceTips = eventSourceTips;
}
public String getEventSourceTips() {
return eventSourceTips;
}
public void setInTunnel(Integer inTunnel) {
this.inTunnel = inTunnel;
}
public Integer getInTunnel() {
return inTunnel;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("deptId", getDeptId())
.append("stakeMark", getStakeMark())
.append("direction", getDirection())
.append("userId", getUserId())
.append("startTime", getStartTime())
.append("endTime", getEndTime())
.append("estimatedEndTime", getEstimatedEndTime())
.append("eventLevel", getEventLevel())
.append("eventType", getEventType())
.append("eventSubclass", getEventSubclass())
.append("eventCause", getEventCause())
.append("description", getDescription())
.append("eventState", getEventState())
.append("eventSource", getEventSource())
.append("eventNature", getEventNature())
.append("remark", getRemark())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("eventSourceTips", getEventSourceTips())
.append("inTunnel", getInTunnel())
.toString();
}
@ApiModelProperty("事件详情参数")
@TableField(exist = false)
private DcEventMap dcEventMap;
@ApiModelProperty("异常天气事件实体")
@TableField(exist = false)
private DcEventAbnormalWeather dcEventAbnormalWeather;
@ApiModelProperty("交通事故事件实体")
@TableField(exist = false)
private DcEventAccident dcEventAccident;
@ApiModelProperty("施工建设事件实体")
@TableField(exist = false)
private DcEventConstruction dcEventConstruction;
@ApiModelProperty("服务区异常事件实体")
@TableField(exist = false)
private DcEventServiceArea dcEventServiceArea;
@ApiModelProperty("交通拥堵事件")
@TableField(exist = false)
private DcEventTrafficCongestion dcEventTrafficCongestion;
@ApiModelProperty("车辆事故事件")
@TableField(exist = false)
private DcEventVehicleAccident dcEventVehicleAccident;
@ApiModelProperty("交通管制事件实体")
@TableField(exist = false)
private DcEventTrafficControl dcEventTrafficControl;
@ApiModelProperty("常用语")
@TableField(exist = false)
private String commonPhrases;
@ApiModelProperty("节点名称")
@TableField(exist = false)
private String nodeNode;
@ApiModelProperty("事件类型名称")
@TableField(exist = false)
private String eventName;
}

2
zc-business/src/main/java/com/zc/business/domain/DcEventAbnormalWeather.java

@ -20,7 +20,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @date 2024-01-12
*/
@ApiModel(value = "DcEventAbnormalWeather" ,description = "异常天气事件实体")
@ApiModel("异常天气事件实体")
@Data
@AllArgsConstructor
@NoArgsConstructor

2
zc-business/src/main/java/com/zc/business/domain/DcEventAccident.java

@ -20,7 +20,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "DcEventAccident", description = "交通事故事件实体")
@ApiModel("交通事故事件实体")
public class DcEventAccident extends BaseEntity {
private static final long serialVersionUID = 1L;

7
zc-business/src/main/java/com/zc/business/domain/DcEventConstruction.java

@ -19,7 +19,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author ruoyi
* @date 2024-01-12
*/
@ApiModel(value = "DcEventConstruction",description = "施工建设事件实体")
@ApiModel("施工建设事件实体")
@Data
@AllArgsConstructor
@NoArgsConstructor
@ -99,4 +99,9 @@ public class DcEventConstruction extends BaseEntity
//事件信息表
@TableField(exist = false)
private DcEvent dcEvent;
@ApiModelProperty("路网设施实体")
//事件信息表
@TableField(exist = false)
private DcFacility dcFacility;
}

7
zc-business/src/main/java/com/zc/business/domain/DcEventServiceArea.java

@ -19,7 +19,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author ruoyi
* @date 2024-01-12
*/
@ApiModel(value = "DcEventServiceArea", description = "服务区异常事件实体")
@ApiModel( "服务区异常事件实体")
@Data
@AllArgsConstructor
@NoArgsConstructor
@ -52,4 +52,9 @@ public class DcEventServiceArea extends BaseEntity
//事件信息表
@TableField(exist = false)
private DcEvent dcEvent;
@ApiModelProperty("路网设施实体")
//事件信息表
@TableField(exist = false)
private DcFacility dcFacility;
}

7
zc-business/src/main/java/com/zc/business/domain/DcEventTrafficCongestion.java

@ -22,7 +22,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "DcEventTrafficCongestion",description = "交通拥堵事件")
@ApiModel("交通拥堵事件")
public class DcEventTrafficCongestion extends BaseEntity
{
private static final long serialVersionUID = 1L;
@ -74,4 +74,9 @@ public class DcEventTrafficCongestion extends BaseEntity
//事件信息表
@TableField(exist = false)
private DcEvent dcEvent;
@ApiModelProperty("路网设施实体")
//事件信息表
@TableField(exist = false)
private DcFacility dcFacility;
}

11
zc-business/src/main/java/com/zc/business/domain/DcEventTrafficControl.java

@ -19,7 +19,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author ruoyi
* @date 2024-01-12
*/
@ApiModel(value = "DcEventTrafficControl", description = "交通管制事件实体")
@ApiModel("交通管制事件实体")
@Data
@AllArgsConstructor
@NoArgsConstructor
@ -69,8 +69,17 @@ public class DcEventTrafficControl extends BaseEntity
private Long rampId;
@ApiModelProperty("高速公路 id")
private Long roadId;
@ApiModelProperty("原因类型")
private String causeType;
@ApiModelProperty("事件信息实体")
//事件信息表
@TableField(exist = false)
private DcEvent dcEvent;
@ApiModelProperty("路网设施实体")
//事件信息表
@TableField(exist = false)
private DcFacility dcFacility;
}

2
zc-business/src/main/java/com/zc/business/domain/DcEventVehicleAccident.java

@ -21,7 +21,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "DcEventVehicleAccident",description = "车辆事故事件")
@ApiModel("车辆事故事件")
public class DcEventVehicleAccident extends BaseEntity
{
private static final long serialVersionUID = 1L;

69
zc-business/src/main/java/com/zc/business/mapper/DcDispatchMapper.java

@ -0,0 +1,69 @@
package com.zc.business.mapper;
import com.zc.business.domain.DcDispatch;
import java.util.List;
/**
* 调度信息记录Mapper接口
*
* @author ruoyi
* @date 2024-01-15
*/
public interface DcDispatchMapper
{
/**
* 查询调度信息记录
*
* @param id 调度信息记录主键
* @return 调度信息记录
*/
public DcDispatch selectDcDispatchById(Long id);
/**
* 查询调度信息记录列表
*
* @param dcDispatch 调度信息记录
* @return 调度信息记录集合
*/
List<DcDispatch> selectDcDispatchList(DcDispatch dcDispatch);
/**
* 新增调度信息记录
*
* @param dcDispatch 调度信息记录
* @return 结果
*/
int insertDcDispatch(DcDispatch dcDispatch);
/**
* 修改调度信息记录
*
* @param dcDispatch 调度信息记录
* @return 结果
*/
int updateDcDispatch(DcDispatch dcDispatch);
/**
* 删除调度信息记录
*
* @param id 调度信息记录主键
* @return 结果
*/
int deleteDcDispatchById(Long id);
/**
* 批量删除调度信息记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteDcDispatchByIds(Long[] ids);
/**
* 根据事件id获取调度信息记录详细信息
* @param id
* @return
*/
String selectDcDispatchByEventId(String id);
}

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

@ -61,6 +61,11 @@ public interface DcEventMapper
* @return 结果
*/
int deleteDcEventByIds(String[] ids);
/**调度记录-事件列表 按时间展示交通事件默认当天时间 可查询条件 交通事件状态 时间范围
*
*/
List<DcEvent> selectDispatchEventList(DcEvent dcEvent);
}

7
zc-business/src/main/java/com/zc/business/mapper/DcEventProcessMapper.java

@ -58,4 +58,11 @@ public interface DcEventProcessMapper
* @return 结果
*/
int deleteDcEventProcessByIds(Long[] ids);
/**
* 根据事件id获取事件处理信息记录详细信息
* @param id
* @return
*/
List<DcEventProcess> selectDcDispatchByEventId(String id);
}

69
zc-business/src/main/java/com/zc/business/service/IDcDispatchService.java

@ -0,0 +1,69 @@
package com.zc.business.service;
import java.util.List;
import com.zc.business.domain.DcDispatch;
import com.zc.business.domain.DcEventProcess;
/**
* 调度信息记录Service接口
*
* @author ruoyi
* @date 2024-01-15
*/
public interface IDcDispatchService
{
/**
* 查询调度信息记录
*
* @param id 调度信息记录主键
* @return 调度信息记录
*/
public DcDispatch selectDcDispatchById(Long id);
/**
* 查询调度信息记录列表
*
* @param dcDispatch 调度信息记录
* @return 调度信息记录集合
*/
List<DcDispatch> selectDcDispatchList(DcDispatch dcDispatch);
/**
* 新增调度信息记录
*
* @param dcDispatch 调度信息记录
* @return 结果
*/
int insertDcDispatch(DcDispatch dcDispatch);
/**
* 修改调度信息记录
*
* @param dcDispatch 调度信息记录
* @return 结果
*/
int updateDcDispatch(DcDispatch dcDispatch);
/**
* 批量删除调度信息记录
*
* @param ids 需要删除的调度信息记录主键集合
* @return 结果
*/
int deleteDcDispatchByIds(Long[] ids);
/**
* 删除调度信息记录信息
*
* @param id 调度信息记录主键
* @return 结果
*/
int deleteDcDispatchById(Long id);
/**
* 根据事件id获取调度信息记录详细信息
* @param id
* @return
*/
List<DcEventProcess> selectDcDispatchByEventId(String id);
}

2
zc-business/src/main/java/com/zc/business/service/IDcEventProcessService.java

@ -58,4 +58,6 @@ public interface IDcEventProcessService
* @return 结果
*/
int deleteDcEventProcessById(Long id);
List<DcEventProcess> selectDcEventProcessListById(String id);
}

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

@ -51,7 +51,7 @@ public interface IDcEventService
* @param ids 需要删除的事件信息主键集合
* @return 结果
*/
public int deleteDcEventByIds(String[] ids);
public int deleteDcEventByIds(int eventType,String[] ids);
/**
* 删除事件信息信息
@ -61,4 +61,16 @@ public interface IDcEventService
*/
public int deleteDcEventById(String id);
/**调度记录-事件列表 按时间展示交通事件默认当天时间 可查询条件 交通事件状态 时间范围
*
*/
List<DcEvent> selectDispatchEventList(DcEvent dcEvent);
/**
* 获取事件以及子类详细信息
* @param evenyType
* @param id
* @return
*/
DcEvent selectEventSubclassById(int eventType, String id);
}

111
zc-business/src/main/java/com/zc/business/service/impl/DcDispatchServiceImpl.java

@ -0,0 +1,111 @@
package com.zc.business.service.impl;
import java.util.List;
import com.zc.business.domain.DcDispatch;
import com.zc.business.domain.DcEventProcess;
import com.zc.business.mapper.DcDispatchMapper;
import com.zc.business.mapper.DcEventProcessMapper;
import com.zc.business.service.IDcDispatchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 调度信息记录Service业务层处理
*
* @author ruoyi
* @date 2024-01-15
*/
@Service
public class DcDispatchServiceImpl implements IDcDispatchService
{
@Autowired
private DcDispatchMapper dcDispatchMapper;
@Autowired
private DcEventProcessMapper dcEventProcessMapper;
/**
* 查询调度信息记录
*
* @param id 调度信息记录主键
* @return 调度信息记录
*/
@Override
public DcDispatch selectDcDispatchById(Long id)
{
return dcDispatchMapper.selectDcDispatchById(id);
}
/**
* 查询调度信息记录列表
*
* @param dcDispatch 调度信息记录
* @return 调度信息记录
*/
@Override
public List<DcDispatch> selectDcDispatchList(DcDispatch dcDispatch)
{
return dcDispatchMapper.selectDcDispatchList(dcDispatch);
}
/**
* 新增调度信息记录
*
* @param dcDispatch 调度信息记录
* @return 结果
*/
@Override
public int insertDcDispatch(DcDispatch dcDispatch)
{
return dcDispatchMapper.insertDcDispatch(dcDispatch);
}
/**
* 修改调度信息记录
*
* @param dcDispatch 调度信息记录
* @return 结果
*/
@Override
public int updateDcDispatch(DcDispatch dcDispatch)
{
return dcDispatchMapper.updateDcDispatch(dcDispatch);
}
/**
* 批量删除调度信息记录
*
* @param ids 需要删除的调度信息记录主键
* @return 结果
*/
@Override
public int deleteDcDispatchByIds(Long[] ids)
{
return dcDispatchMapper.deleteDcDispatchByIds(ids);
}
/**
* 删除调度信息记录信息
*
* @param id 调度信息记录主键
* @return 结果
*/
@Override
public int deleteDcDispatchById(Long id)
{
return dcDispatchMapper.deleteDcDispatchById(id);
}
/**
* 根据事件id获取调度信息记录详细信息
* @param id
* @return
*/
@Override
public List<DcEventProcess> selectDcDispatchByEventId(String id) {
// return dcDispatchMapper.selectDcDispatchByEventId(id);
return dcEventProcessMapper.selectDcDispatchByEventId(id);
}
}

5
zc-business/src/main/java/com/zc/business/service/impl/DcEventProcessServiceImpl.java

@ -90,4 +90,9 @@ public class DcEventProcessServiceImpl implements IDcEventProcessService
{
return dcEventProcessMapper.deleteDcEventProcessById(id);
}
@Override
public List<DcEventProcess> selectDcEventProcessListById(String id) {
return dcEventProcessMapper.selectDcDispatchByEventId(id);
}
}

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

@ -2,11 +2,12 @@ package com.zc.business.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.zc.business.domain.DcEvent;
import com.zc.business.mapper.DcEventMapper;
import com.zc.business.domain.*;
import com.zc.business.mapper.*;
import com.zc.business.service.IDcEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
@ -16,10 +17,35 @@ import org.springframework.stereotype.Service;
* @date 2024-01-12
*/
@Service
@Transactional
public class DcEventServiceImpl implements IDcEventService
{
@Autowired
private DcEventMapper dcEventMapper;
//异常天气
@Autowired
private DcEventAbnormalWeatherMapper dcEventAbnormalWeatherMapper;
//交通事故事件
@Autowired
private DcEventAccidentMapper dcEventAccidentMapper;
//施工建设
@Autowired
private DcEventConstructionMapper dcEventConstructionMapper;
//服务区异常
@Autowired
private DcEventServiceAreaMapper dcEventServiceAreaMapper;
//交通拥堵
@Autowired
private DcEventTrafficCongestionMapper dcEventTrafficCongestionMapper;
//车辆事故事件
@Autowired
private DcEventVehicleAccidentMapper dcEventVehicleAccidentMapper;
//交通管制事件
@Autowired
private DcEventTrafficControlMapper dcEventTrafficControlMapper;
/**
* 查询事件信息
@ -28,9 +54,10 @@ public class DcEventServiceImpl implements IDcEventService
* @return 事件信息
*/
@Override
public DcEvent selectDcEventById(String id)
public DcEvent selectDcEventById( String id)
{
return dcEventMapper.selectDcEventById(id);
DcEvent dcEvent = dcEventMapper.selectDcEventById(id);
return dcEvent;
}
/**
@ -42,6 +69,7 @@ public class DcEventServiceImpl implements IDcEventService
@Override
public List<DcEvent> selectDcEventList(DcEvent dcEvent)
{
return dcEventMapper.selectDcEventList(dcEvent);
}
@ -55,7 +83,61 @@ public class DcEventServiceImpl implements IDcEventService
public int insertDcEvent(DcEvent dcEvent)
{
dcEvent.setCreateTime(DateUtils.getNowDate());
return dcEventMapper.insertDcEvent(dcEvent);
int i7 = dcEventMapper.insertDcEvent(dcEvent);
if (i7>0){
//获取事件类型
int eventType = Math.toIntExact(dcEvent.getEventType());
switch (eventType){
//交通事故
case 1:
int i1 = dcEventAccidentMapper.insertDcEventAccident(dcEvent.getDcEventAccident());
break;
//车辆事故
case 2:
int i5 = dcEventVehicleAccidentMapper.insertDcEventVehicleAccident(dcEvent.getDcEventVehicleAccident());
break;
//交通管制
case 3:
int i6 = dcEventTrafficControlMapper.insertDcEventTrafficControl(dcEvent.getDcEventTrafficControl());
break;
//交通拥堵
case 4:
int i4 = dcEventTrafficCongestionMapper.insertDcEventTrafficCongestion(dcEvent.getDcEventTrafficCongestion());
break;
//非法上路
case 5:
break;
//路障清除
case 6:
break;
//施工建设
case 7:
int i2 = dcEventConstructionMapper.insertDcEventConstruction(dcEvent.getDcEventConstruction());
break;
//服务区异常
case 8:
int i3 = dcEventServiceAreaMapper.insertDcEventServiceArea(dcEvent.getDcEventServiceArea());
break;
//设施设备隐患
case 9:
break;
//异常天气
case 10:
int i = dcEventAbnormalWeatherMapper.insertDcEventAbnormalWeather(dcEvent.getDcEventAbnormalWeather());
break;
//其他事件
case 11:
break;
//
default:
break;
}
return i7;
}else {
return -1;
}
}
/**
@ -68,7 +150,61 @@ public class DcEventServiceImpl implements IDcEventService
public int updateDcEvent(DcEvent dcEvent)
{
dcEvent.setUpdateTime(DateUtils.getNowDate());
return dcEventMapper.updateDcEvent(dcEvent);
int i7 = dcEventMapper.updateDcEvent(dcEvent);
if (i7>0) {
int eventType = Math.toIntExact(dcEvent.getEventType());
switch (eventType){
//交通事故
case 1:
int i1 = dcEventAccidentMapper.updateDcEventAccident(dcEvent.getDcEventAccident());
break;
//车辆事故
case 2:
int i5 = dcEventVehicleAccidentMapper.updateDcEventVehicleAccident(dcEvent.getDcEventVehicleAccident());
break;
//交通管制
case 3:
int i6 = dcEventTrafficControlMapper.updateDcEventTrafficControl(dcEvent.getDcEventTrafficControl());
break;
//交通拥堵
case 4:
int i4 = dcEventTrafficCongestionMapper.updateDcEventTrafficCongestion(dcEvent.getDcEventTrafficCongestion());
break;
//非法上路
case 5:
break;
//路障清除
case 6:
break;
//施工建设
case 7:
int i2 = dcEventConstructionMapper.updateDcEventConstruction(dcEvent.getDcEventConstruction());
break;
//服务区异常
case 8:
int i3 = dcEventServiceAreaMapper.updateDcEventServiceArea(dcEvent.getDcEventServiceArea());
break;
//设施设备隐患
case 9:
break;
//异常天气
case 10:
int i = dcEventAbnormalWeatherMapper.updateDcEventAbnormalWeather(dcEvent.getDcEventAbnormalWeather());
break;
//其他事件
case 11:
break;
//
default:
break;
}
return i7;
}else {
return -1;
}
}
/**
@ -78,11 +214,61 @@ public class DcEventServiceImpl implements IDcEventService
* @return 结果
*/
@Override
public int deleteDcEventByIds(String[] ids)
public int deleteDcEventByIds( int eventType,String[] ids)
{
return dcEventMapper.deleteDcEventByIds(ids);
}
int i7 = dcEventMapper.deleteDcEventByIds(ids);
if (i7>0){
switch (eventType) {
//交通事故
case 1:
int i1 = dcEventAccidentMapper.deleteDcEventAccidentByIds(ids);
break;
//车辆事故
case 2:
int i5 = dcEventVehicleAccidentMapper.deleteDcEventVehicleAccidentByIds(ids);
break;
//交通管制
case 3:
int i6 = dcEventTrafficControlMapper.deleteDcEventTrafficControlByIds(ids);
break;
//交通拥堵
case 4:
int i4 = dcEventTrafficCongestionMapper.deleteDcEventTrafficCongestionByIds(ids);
break;
//非法上路
case 5:
break;
//路障清除
case 6:
break;
//施工建设
case 7:
int i2 = dcEventConstructionMapper.deleteDcEventConstructionByIds(ids);
break;
//服务区异常
case 8:
int i3 = dcEventServiceAreaMapper.deleteDcEventServiceAreaByIds(ids);
break;
//设施设备隐患
case 9:
break;
//异常天气
case 10:
int i = dcEventAbnormalWeatherMapper.deleteDcEventAbnormalWeatherByIds(ids);
break;
//其他事件
case 11:
break;
//
default:
break;
}
return i7;
}else {
return -1;
}
}
/**
* 删除事件信息信息
*
@ -94,4 +280,77 @@ public class DcEventServiceImpl implements IDcEventService
{
return dcEventMapper.deleteDcEventById(id);
}
/**调度记录-事件列表 按时间展示交通事件默认当天时间 可查询条件 交通事件状态 时间范围
*
*/
@Override
public List<DcEvent> selectDispatchEventList(DcEvent dcEvent) {
return dcEventMapper.selectDispatchEventList(dcEvent);
}
/**
* 获取事件以及子类详细信息
* @param eventType
* @param id
* @return
*/
@Override
public DcEvent selectEventSubclassById(int eventType, String id) {
//todo
DcEvent dcEvent = dcEventMapper.selectDcEventById(id);
switch (eventType) {
//交通事故
case 1:
DcEventAccident dcEventAccident = dcEventAccidentMapper.selectDcEventAccidentById(id);
dcEvent.setDcEventAccident(dcEventAccident);
break;
//车辆事故
case 2:
DcEventVehicleAccident dcEventVehicleAccident = dcEventVehicleAccidentMapper.selectDcEventVehicleAccidentById(id);
dcEvent.setDcEventVehicleAccident(dcEventVehicleAccident);
break;
//交通管制
case 3:
DcEventTrafficControl dcEventTrafficControl = dcEventTrafficControlMapper.selectDcEventTrafficControlById(id);
dcEvent.setDcEventTrafficControl(dcEventTrafficControl);
break;
//交通拥堵
case 4:
DcEventTrafficCongestion dcEventTrafficCongestion = dcEventTrafficCongestionMapper.selectDcEventTrafficCongestionById(id);
dcEvent.setDcEventTrafficCongestion(dcEventTrafficCongestion);
break;
//非法上路
case 5:
break;
//路障清除
case 6:
break;
//施工建设
case 7:
DcEventConstruction dcEventConstruction = dcEventConstructionMapper.selectDcEventConstructionById(id);
dcEvent.setDcEventConstruction(dcEventConstruction);
break;
//服务区异常
case 8:
DcEventServiceArea dcEventServiceArea = dcEventServiceAreaMapper.selectDcEventServiceAreaById(id);
dcEvent.setDcEventServiceArea(dcEventServiceArea);
break;
//设施设备隐患
case 9:
break;
//异常天气
case 10:
DcEventAbnormalWeather dcEventAbnormalWeather = dcEventAbnormalWeatherMapper.selectDcEventAbnormalWeatherById(id);
dcEvent.setDcEventAbnormalWeather(dcEventAbnormalWeather);
break;
//其他事件
case 11:
break;
//
default:
break;
}
return dcEvent;
}
}

94
zc-business/src/main/resources/mapper/business/DcDispatchMapper.xml

@ -0,0 +1,94 @@
<?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.zc.business.mapper.DcDispatchMapper">
<resultMap type="com.zc.business.domain.DcDispatch" id="DcDispatchResult">
<result property="id" column="id" />
<result property="organizationId" column="organization_id" />
<result property="eventId" column="event_id" />
<result property="dispatchName" column="dispatch_name" />
<result property="dispatchStatus" column="dispatch_status" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="remark" column="remark" />
<result property="organizationName" column="organization_name" />
</resultMap>
<sql id="selectDcDispatchVo">
select dc_dispatch.id, organization_id, event_id, dispatch_name, dispatch_status, start_time, end_time, remark,dc_organization.organization_name AS organization_name from dc_dispatch
</sql>
<select id="selectDcDispatchList" parameterType="com.zc.business.domain.DcDispatch" resultMap="DcDispatchResult">
<include refid="selectDcDispatchVo"/>
<where>
<if test="organizationId != null "> and organization_id = #{organizationId}</if>
<if test="eventId != null and eventId != ''"> and event_id = #{eventId}</if>
<if test="dispatchName != null and dispatchName != ''"> and dispatch_name like concat('%', #{dispatchName}, '%')</if>
<if test="dispatchStatus != null "> and dispatch_status = #{dispatchStatus}</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="endTime != null and startTime != null"> and start_time BETWEEN #{startTime} and #{endTime} </if>
</where>
</select>
<select id="selectDcDispatchById" parameterType="Long" resultMap="DcDispatchResult">
<include refid="selectDcDispatchVo"/>
where id = #{id}
</select>
<!--根据事件id获取调度信息记录详细信息-->
<select id="selectDcDispatchByEventId" parameterType="string" resultMap="DcDispatchResult">
<include refid="selectDcDispatchVo"/>
where event_id = #{id}
</select>
<insert id="insertDcDispatch" parameterType="com.zc.business.domain.DcDispatch">
insert into dc_dispatch
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="organizationId != null">organization_id,</if>
<if test="eventId != null and eventId != ''">event_id,</if>
<if test="dispatchName != null">dispatch_name,</if>
<if test="dispatchStatus != null">dispatch_status,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="organizationId != null">#{organizationId},</if>
<if test="eventId != null and eventId != ''">#{eventId},</if>
<if test="dispatchName != null">#{dispatchName},</if>
<if test="dispatchStatus != null">#{dispatchStatus},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateDcDispatch" parameterType="com.zc.business.domain.DcDispatch">
update dc_dispatch
<trim prefix="SET" suffixOverrides=",">
<if test="organizationId != null">organization_id = #{organizationId},</if>
<if test="eventId != null and eventId != ''">event_id = #{eventId},</if>
<if test="dispatchName != null">dispatch_name = #{dispatchName},</if>
<if test="dispatchStatus != null">dispatch_status = #{dispatchStatus},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDcDispatchById" parameterType="Long">
delete from dc_dispatch where id = #{id}
</delete>
<delete id="deleteDcDispatchByIds" parameterType="String">
delete from dc_dispatch where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

35
zc-business/src/main/resources/mapper/business/DcEventConstructionMapper.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.DcEventConstructionMapper">
<resultMap type="DcEventConstruction" id="DcEventConstructionResult">
<resultMap type="com.zc.business.domain.DcEventConstruction" id="DcEventConstructionResult">
<result property="id" column="id" />
<result property="controlMode" column="control_mode" />
<result property="locationType" column="location_type" />
@ -16,11 +16,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="exitsInlets" column="exits_inlets" />
<result property="laneOccupancy" column="lane_occupancy" />
<result property="trafficCondition" column="traffic_condition" />
<result property="dcFacility.facilityName" column="facility_name" />
<result property="dcFacility.facilityType" column="facility_type" />
<result property="dcFacility.direction" column="direction" />
<result property="dcFacility.stakeMarkId" column="stake_mark" />
<result property="dcFacility.remark" column="remark" />
<result property="dcFacility.otherConfig" column="other_config" />
</resultMap>
<sql id="selectDcEventConstructionVo">
select id, control_mode, location_type, special_place_description, special_construction, other_construction_name, construction_measurement, facility_id, exits_inlets, lane_occupancy, traffic_condition from dc_event_construction
</sql>
<sql id="selectDcEventConstructionVoById">
SELECT
dc_event_construction.id as id,
dc_event_construction.control_mode as control_mode,
dc_event_construction.location_type as location_type,
dc_event_construction.special_place_description as special_place_description,
dc_event_construction.special_construction as special_construction,
dc_event_construction.other_construction_name as other_construction_name,
dc_event_construction.construction_measurement as construction_measurement,
dc_event_construction.facility_id as facility_id,
dc_event_construction.exits_inlets as exits_inlets,
dc_event_construction.lane_occupancy as lane_occupancy,
dc_event_construction.traffic_condition as traffic_condition,
dc_facility.other_config as other_config,
dc_facility.remark as remark,
dc_facility.stake_mark as stake_mark,
dc_facility.facility_type as facility_type,
dc_facility.facility_name as facility_name,
dc_facility.direction as direction
FROM dc_event_construction </sql>
<select id="selectDcEventConstructionList" parameterType="DcEventConstruction" resultMap="DcEventConstructionResult">
<include refid="selectDcEventConstructionVo"/>
@ -39,8 +67,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectDcEventConstructionById" parameterType="String" resultMap="DcEventConstructionResult">
<include refid="selectDcEventConstructionVo"/>
where id = #{id}
<include refid="selectDcEventConstructionVoById"/>
LEFT JOIN dc_facility ON dc_event_construction.facility_id = dc_facility.id
where dc_event_construction.id = #{id}
</select>
<insert id="insertDcEventConstruction" parameterType="DcEventConstruction">

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

@ -26,10 +26,137 @@
<result property="eventSourceTips" column="event_source_tips" />
<result property="inTunnel" column="in_tunnel" />
</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="commonPhrases" column="common_phrases" />
</resultMap>
<resultMap type="com.zc.business.domain.DcEvent" id="DcEventResultListAll">
<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="dcProcessConfig.processNode" column="process_node" />
<result property="dcProcessConfig.commonPhrases" column="common_phrases" />
<result property="dcProcessConfig.nodeNode" column="node_node" /> -->
<result property="dcEventMap.processNode" column="process_node"/>
<result property="dcEventMap.commonPhrases" column="common_phrases"/>
<result property="dcEventMap.nodeNode" column="node_node"/>
<result property="dcEventMap.dcDispatchId" column="dc_dispatch_id"/>
<result property="dcEventMap.organizationId" column="organization_id"/>
<result property="dcEventMap.dispatchName" column="dispatch_name"/>
<result property="dcEventMap.dispatchStatus" column="dispatch_status"/>
<result property="dcEventMap.dcDispatchRemark" column="dc_dispatch_remark"/>
<result property="dcEventMap.dcDispatchEndTime" column="dc_dispatch_end_time"/>
<result property="dcEventMap.dcDispatchStartTime" column="dc_dispatch_start_time"/>
<result property="dcEventMap.eventId" column="event_id"/>
<result property="dcEventMap.dcOrganizationId" column="dc_organization_id"/>
<result property="dcEventMap.parentId" column="parent_id"/>
<result property="dcEventMap.organizationType" column="organization_type"/>
<result property="dcEventMap.organizationName" column="organization_name"/>
<result property="dcEventMap.organizationAddress" column="organization_address"/>
<result property="dcEventMap.dcOrganizationStakeMarkId" column="dc_organization_stake_mark_id"/>
<result property="dcEventMap.dcOrganizationDescription" column="dc_organization_description"/>
<result property="dcEventMap.vehiclePlate" column="vehicle_plate"/>
<result property="dcEventMap.vehicleType" column="vehicle_type"/>
<result property="dcEventMap.vehicleStatus" column="vehicle_status"/>
<result property="dcEventMap.dcVehiclesRemark" column="dc_vehicles_remark"/>
<result property="dcEventMap.postId" column="post_id"/>
<result property="dcEventMap.name" column="name"/>
<result property="dcEventMap.contactNumber" column="contact_number"/>
</resultMap>
<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="selectDcEventVoListAll"> select dc_event.id AS id,
dc_event.stake_mark,
dc_event.direction,
dc_event.user_id,
dc_event.start_time,
dc_event.end_time,
dc_event.estimated_end_time,
dc_event.event_level,
dc_event.event_type AS event_type,
dc_event.event_subclass,
dc_event.event_cause,
dc_event.description,
dc_event.event_state,
dc_event.event_source,
dc_event.event_nature,
dc_event.remark,
dc_event.create_time,
dc_event.update_time,
dc_event.event_source_tips,
dc_event.in_tunnel,
dc_event_type.event_name AS event_name,
dc_process_config.node_node AS node_node,
dc_process_config.process_node AS process_node,
dc_process_config.common_phrases AS common_phrases,
dc_dispatch.id AS dc_dispatch_id,
dc_dispatch.organization_id,
dc_dispatch.dispatch_name,
dc_dispatch.dispatch_status,
dc_dispatch.remark AS dc_dispatch_remark,
dc_dispatch.end_time AS dc_dispatch_end_time,
dc_dispatch.start_time AS dc_dispatch_start_time,
dc_dispatch.event_id,
dc_organization.id AS dc_organization_id,
dc_organization.parent_id,
dc_organization.organization_type,
dc_organization.organization_name,
dc_organization.organization_address,
dc_organization.stake_mark_id AS dc_organization_stake_mark_id,
dc_organization.rescue_unit,
dc_organization.description AS dc_organization_description,
dc_vehicles.vehicle_plate,
dc_vehicles.vehicle_type,
dc_vehicles.vehicle_status,
dc_vehicles.remark AS dc_vehicles_remark,
dc_employees.post_id,
dc_employees.NAME,
dc_employees.contact_number FROM dc_event </sql>
<select id="selectDcEventList" parameterType="DcEvent" resultMap="DcEventResult">
<include refid="selectDcEventVo"/>
@ -54,10 +181,58 @@
</where>
</select>
<select id="selectDcEventById" parameterType="String" resultMap="DcEventResult">
<include refid="selectDcEventVo"/>
where id = #{id}
</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
&#45;&#45; 关联调度信息记录表
LEFT JOIN dc_dispatch ON dc_event.id = dc_dispatch.event_id
&#45;&#45; 关联资源调度调度记录id关联 调度信息记录表的主键
LEFT JOIN dc_dispatch_resource ON dc_dispatch.id = dc_dispatch_resource.dispatch_id
&#45;&#45; 关联车辆
LEFT JOIN dc_vehicles ON dc_dispatch_resource.resource_id = dc_vehicles.id
&#45;&#45; 关联机构表
LEFT JOIN dc_organization ON dc_dispatch.organization_id = dc_organization.id
&#45;&#45; 关联人员信息表
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.direction,
dc_event.user_id,
dc_event.start_time,
dc_event.end_time,
dc_event.estimated_end_time,
dc_event.event_level,
dc_event.event_type AS event_type,
dc_event.event_subclass,
dc_event.event_cause,
dc_event.description,
dc_event.event_state,
dc_event.event_source,
dc_event.event_nature,
dc_event.remark,
dc_event.create_time,
dc_event.update_time,
dc_event.event_source_tips,
dc_event.in_tunnel,
dc_event_type.event_name AS event_name,
dc_process_config.node_node AS node_node,
dc_process_config.common_phrases as common_phrases
FROM dc_event
LEFT JOIN dc_process_config on dc_process_config.event_type = dc_event.event_type
LEFT JOIN dc_event_type ON dc_event_type.event_type = dc_process_config.event_type
where dc_event.id = #{id}
</select>
<insert id="insertDcEvent" parameterType="DcEvent">
insert into dc_event
@ -147,4 +322,17 @@
</foreach>
</delete>
<!--
调度记录-事件列表 按时间展示交通事件。默认当天时间 。可查询条件 交通事件状态 ,时间范围
-->
<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>
</where>
</select>
</mapper>

7
zc-business/src/main/resources/mapper/business/DcEventProcessMapper.xml

@ -90,4 +90,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="selectDcDispatchByEventId" parameterType="string" resultMap="DcEventProcessResult">
<include refid="selectDcEventProcessVo"/>
where event_id = #{id}
ORDER BY operation_time ASC;
</select>
</mapper>

28
zc-business/src/main/resources/mapper/business/DcEventServiceAreaMapper.xml

@ -4,16 +4,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zc.business.mapper.DcEventServiceAreaMapper">
<resultMap type="DcEventServiceArea" id="DcEventServiceAreaResult">
<resultMap type="com.zc.business.domain.DcEventServiceArea" id="DcEventServiceAreaResult">
<result property="id" column="id" />
<result property="exitsInlets" column="exits_inlets" />
<result property="facilityId" column="facility_id" />
<result property="disableFacility" column="disable_facility" />
<result property="dcFacility.facilityName" column="facility_name" />
<result property="dcFacility.facilityType" column="facility_type" />
<result property="dcFacility.direction" column="direction" />
<result property="dcFacility.stakeMarkId" column="stake_mark" />
<result property="dcFacility.remark" column="remark" />
<result property="dcFacility.otherConfig" column="other_config" />
</resultMap>
<sql id="selectDcEventServiceAreaVo">
select id, exits_inlets, facility_id, disable_facility from dc_event_service_area
</sql>
<sql id="selectDcEventServiceAreaVoById">
SELECT
dc_event_service_area.disable_facility AS disable_facility,
dc_event_service_area.exits_inlets as exits_inlets,
dc_event_service_area.facility_id as facility_id,
dc_event_service_area.id as id,
dc_facility.other_config as other_config,
dc_facility.remark as remark,
dc_facility.stake_mark as stake_mark,
dc_facility.facility_type as facility_type,
dc_facility.facility_name as facility_name,
dc_facility.direction as direction
FROM dc_event_service_area </sql>
<select id="selectDcEventServiceAreaList" parameterType="DcEventServiceArea" resultMap="DcEventServiceAreaResult">
<include refid="selectDcEventServiceAreaVo"/>
@ -25,8 +46,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectDcEventServiceAreaById" parameterType="String" resultMap="DcEventServiceAreaResult">
<include refid="selectDcEventServiceAreaVo"/>
where id = #{id}
<include refid="selectDcEventServiceAreaVoById"/>
LEFT JOIN dc_facility ON dc_event_service_area.facility_id = dc_facility.id
where dc_event_service_area.id = #{id}
</select>
<insert id="insertDcEventServiceArea" parameterType="DcEventServiceArea">

33
zc-business/src/main/resources/mapper/business/DcEventTrafficCongestionMapper.xml

@ -4,18 +4,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zc.business.mapper.DcEventTrafficCongestionMapper">
<resultMap type="DcEventTrafficCongestion" id="DcEventTrafficCongestionResult">
<resultMap type="com.zc.business.domain.DcEventTrafficCongestion" id="DcEventTrafficCongestionResult">
<result property="id" column="id" />
<result property="congestionMileage" column="congestion_mileage" />
<result property="congestionCause" column="congestion_cause" />
<result property="facilityId" column="facility_id" />
<result property="rampId" column="ramp_id" />
<result property="location" column="location" />
<result property="dcFacility.facilityName" column="facility_name" />
<result property="dcFacility.facilityType" column="facility_type" />
<result property="dcFacility.direction" column="direction" />
<result property="dcFacility.stakeMarkId" column="stake_mark" />
<result property="dcFacility.remark" column="remark" />
<result property="dcFacility.otherConfig" column="other_config" />
</resultMap>
<sql id="selectDcEventTrafficCongestionVo">
select id, congestion_mileage, congestion_cause, facility_id, ramp_id, location from dc_event_traffic_congestion
</sql>
<!-- -->
<sql id="selectDcEventTrafficCongestionVoById">
SELECT
dc_event_traffic_congestion.congestion_cause as congestion_cause,
dc_event_traffic_congestion.congestion_mileage as congestion_mileage,
dc_event_traffic_congestion.facility_id as facility_id,
dc_event_traffic_congestion.id as id,
dc_event_traffic_congestion.location as location,
dc_event_traffic_congestion.ramp_id as ramp_id,
dc_facility.other_config as other_config,
dc_facility.remark as remark,
dc_facility.stake_mark as stake_mark,
dc_facility.facility_type as facility_type,
dc_facility.facility_name as facility_name,
dc_facility.direction as direction
FROM dc_event_traffic_congestion </sql>
<select id="selectDcEventTrafficCongestionList" parameterType="DcEventTrafficCongestion" resultMap="DcEventTrafficCongestionResult">
<include refid="selectDcEventTrafficCongestionVo"/>
@ -29,8 +55,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectDcEventTrafficCongestionById" parameterType="String" resultMap="DcEventTrafficCongestionResult">
<include refid="selectDcEventTrafficCongestionVo"/>
where id = #{id}
<include refid="selectDcEventTrafficCongestionVoById"/>
LEFT JOIN dc_facility ON dc_event_traffic_congestion.facility_id = dc_facility.id
where dc_event_traffic_congestion.id = #{id}
</select>
<insert id="insertDcEventTrafficCongestion" parameterType="DcEventTrafficCongestion">

34
zc-business/src/main/resources/mapper/business/DcEventTrafficControlMapper.xml

@ -12,11 +12,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="facilityId" column="facility_id" />
<result property="rampId" column="ramp_id" />
<result property="rampId" column="road_id" />
<result property="causeType" column="cause_type" />
<result property="dcFacility.facilityName" column="facility_name" />
<result property="dcFacility.facilityType" column="facility_type" />
<result property="dcFacility.direction" column="direction" />
<result property="dcFacility.stakeMarkId" column="stake_mark" />
<result property="dcFacility.remark" column="remark" />
<result property="dcFacility.otherConfig" column="other_config" />
</resultMap>
<sql id="selectDcEventTrafficControlVo">
select id, control_type, control_cause, exits_inlets, facility_id, ramp_id,road_id from dc_event_traffic_control
select id, control_type, control_cause, exits_inlets, facility_id, ramp_id,road_id,cause_type from dc_event_traffic_control
</sql>
<!--关联路网设施查询-->
<sql id="selectDcEventTrafficControlVoById">
SELECT dc_event_traffic_control.control_cause AS control_cause,
dc_event_traffic_control.control_type as control_type,
dc_event_traffic_control.exits_inlets as exits_inlets,
dc_event_traffic_control.facility_id as facility_id,
dc_event_traffic_control.id as id,
dc_event_traffic_control.ramp_id as ramp_id,
dc_facility.other_config as other_config,
dc_facility.remark as remark,
dc_facility.stake_mark as stake_mark,
dc_facility.facility_type as facility_type,
dc_facility.facility_name as facility_name,
dc_facility.direction as direction
FROM dc_event_traffic_control </sql>
<select id="selectDcEventTrafficControlList" parameterType="DcEventTrafficControl" resultMap="DcEventTrafficControlResult">
<include refid="selectDcEventTrafficControlVo"/>
@ -26,12 +49,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="exitsInlets != null "> and exits_inlets = #{exitsInlets}</if>
<if test="facilityId != null "> and facility_id = #{facilityId}</if>
<if test="rampId != null "> and ramp_id = #{rampId}</if>
<if test="causeType != null "> and cause_type = #{causeType}</if>
</where>
</select>
<select id="selectDcEventTrafficControlById" parameterType="String" resultMap="DcEventTrafficControlResult">
<include refid="selectDcEventTrafficControlVo"/>
where id = #{id}
<include refid="selectDcEventTrafficControlVoById"/>
LEFT JOIN dc_facility ON dc_event_traffic_control.facility_id = dc_facility.id
where dc_event_traffic_control.id = #{id}
</select>
<insert id="insertDcEventTrafficControl" parameterType="DcEventTrafficControl">
@ -44,6 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="facilityId != null">facility_id,</if>
<if test="rampId != null">ramp_id,</if>
<if test="roadId != null">road_id,</if>
<if test="causeType != null">cause_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
@ -53,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="facilityId != null">#{facilityId},</if>
<if test="rampId != null">#{rampId},</if>
<if test="roadId != null">#{roadId},</if>
<if test="causeType != null">#{causeType},</if>
</trim>
</insert>
@ -65,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="facilityId != null">facility_id = #{facilityId},</if>
<if test="rampId != null">ramp_id = #{rampId},</if>
<if test="roadId != null">road_id = #{roadId},</if>
<if test="causeType != null">cause_type = #{causeType},</if>
</trim>
where id = #{id}
</update>

Loading…
Cancel
Save