Browse Source

感知事件处理

develop
wangsixiang 10 months ago
parent
commit
860b86b84e
  1. 21
      zc-business/src/main/java/com/zc/business/domain/DcWarning.java
  2. 29
      zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml

21
zc-business/src/main/java/com/zc/business/domain/DcWarning.java

@ -59,7 +59,7 @@ public class DcWarning extends BaseEntity
private Integer warningType;
/** 事件子类:1-1 拥堵1-2 缓行 */
@Excel(name = "事件子类: 1-1 拥堵 1-2 缓行")
@Excel(name = "事件子类: 1-1 拥堵 1-2 缓行 2-1 普通行人")
private String warningSubclass;
/** 事件标题 */
@ -69,17 +69,16 @@ public class DcWarning extends BaseEntity
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
@Excel(name = "其它配置", readConverterExp = "$column.readConverterExp()")
private String otherConfig;
/** 车道0-应急 1-行1 2-行2 3-行3 4-行4 */
@Excel(name = "车道0-应急 1-行1 2-行2 3-行3 4-行4")
private String lane;
/** 所属辖区路段名称 */
@Excel(name = "所属辖区路段名称")
private String sectionName;
/** 数量 */
@Excel(name = "数量")
private int number;
private String type;
@ -89,8 +88,19 @@ public class DcWarning extends BaseEntity
private String latitude;
/** 车辆类型 */
@Excel(name = "车辆类型")
//@Excel(name = "车辆类型")
private String vehicleType;
/** 持续时长 */
@Excel(name = "持续时长(秒)")
private int duration;
public int getDuration() {
return duration;
}
public void setDuration(int duration) {
this.duration = duration;
}
public String getVehicleType() {
return vehicleType;
@ -295,6 +305,7 @@ public class DcWarning extends BaseEntity
.append("warningSubclass", getWarningSubclass())
.append("warningTitle", getWarningTitle())
.append("otherConfig", getOtherConfig())
.append("duration", getDuration())
.toString();
}
}

29
zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml

@ -15,6 +15,7 @@
</select>
<select id="selectWarningById" resultType="com.zc.business.domain.DcWarning">
SELECT DISTINCT warning.`id`,warning.`stake_mark`, warning.`direction`,
warning.duration,
mark.longitude,mark.latitude,warning.lane,warning.vehicle_type vehicleType,
warning.`dept_id`,warning.`warning_state`,warning.`warning_time`,
warning.`user_id`, warning.`warning_source`,warning.`warning_level`,
@ -26,7 +27,7 @@
</select>
<select id="selectPerceivedEventsList" resultType="com.zc.business.domain.DcWarning">
SELECT warning.`id`,warning.`stake_mark`, warning.`direction`,
mark.longitude,mark.latitude,warning.lane,
mark.longitude,mark.latitude,warning.lane,duration,
warning.`dept_id`,warning.`warning_state`,warning.`warning_time`,
warning.`user_id`, warning.`warning_source`,warning.`warning_level`,
warning.`remark`, warning.`create_time`,warning.`update_time`,
@ -47,6 +48,7 @@
LEFT JOIN dc_road_section as s ON mark.section_id=s.id
where mark.stake_mark is not null
group by w.stake_mark
HAVING number !=0
order by number desc
</select>
<select id="selectSectionPerceivedNumber" resultType="java.util.HashMap">
@ -58,6 +60,7 @@
LEFT JOIN dc_road_section as s ON mark.section_id=s.id
where mark.stake_mark is not null
group by w.stake_mark
HAVING number !=0
</select>
<select id="selectDailyCumulative" resultType="java.util.HashMap">
SELECT DATE_FORMAT(create_time, '%Y-%m-%d %H') AS time, COUNT(*) AS number
@ -98,7 +101,7 @@
FROM dc_warning AS warning
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark
WHERE DATE_FORMAT(warning.create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d')
AND warning.direction=#{direction}
AND warning.direction=#{direction} and mark.direction=#{direction}
AND mark.`section_id`=#{sectionId}
GROUP BY time
</select>
@ -107,7 +110,7 @@
FROM dc_warning as warning
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark
WHERE DATE_FORMAT(warning.create_time,'%Y-%m') =DATE_FORMAT(#{createTime},'%Y-%m')
AND warning.direction=#{direction}
AND warning.direction=#{direction} and mark.direction=#{direction}
and mark.`section_id`=#{sectionId}
GROUP BY day
ORDER BY day
@ -125,7 +128,7 @@
FROM dc_warning as warning
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark
WHERE YEAR(warning.create_time) =DATE_FORMAT(#{createTime},'%Y')
AND warning.direction=#{direction}
AND warning.direction=#{direction} and mark.direction=#{direction}
and mark.`section_id`=#{sectionId}
GROUP BY QUARTER, MONTH
ORDER BY QUARTER, MONTH;
@ -135,7 +138,7 @@
SELECT month(warning.create_time) AS month, COUNT(*) AS number
FROM dc_warning as warning
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark
where mark.`section_id`=#{sectionId} AND warning.direction=#{direction}
where mark.`section_id`=#{sectionId} AND warning.direction=#{direction} and mark.direction=#{direction}
and DATE_FORMAT(warning.create_time,'%Y')=DATE_FORMAT(#{createTime},'%Y')
GROUP BY month
</select>
@ -143,7 +146,7 @@
SELECT COUNT(*) AS number FROM dc_warning as warning
LEFT JOIN dc_stake_mark as mark on warning.stake_mark=mark.stake_mark
where DATE_FORMAT(warning.create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d')
AND warning.direction=#{direction}
AND warning.direction=#{direction} and mark.direction=#{direction}
and mark.`section_id`=#{sectionId}
</select>
<select id="selectWarningSectionTypeDay" resultType="java.util.HashMap">
@ -152,7 +155,7 @@
FROM dc_warning as warning
LEFT JOIN dc_stake_mark as mark on warning.stake_mark=mark.stake_mark
where DATE_FORMAT(warning.create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d')
AND warning.direction=#{direction}
AND warning.direction=#{direction} and mark.direction=#{direction}
and mark.`section_id`=#{sectionId}
GROUP BY warning_type
ORDER BY number DESC
@ -161,7 +164,7 @@
SELECT COUNT(*) AS number FROM dc_warning as warning
LEFT JOIN dc_stake_mark as mark on warning.stake_mark=mark.stake_mark
where DATE_FORMAT(warning.create_time,'%Y-%m') =DATE_FORMAT(#{createTime},'%Y-%m')
AND warning.direction=#{direction}
AND warning.direction=#{direction} and mark.direction=#{direction}
and mark.`section_id`=#{sectionId}
</select>
<select id="selectWarningSectionTypeMonth" resultType="java.util.HashMap">
@ -169,7 +172,7 @@
FROM dc_warning as warning
LEFT JOIN dc_stake_mark as mark on warning.stake_mark=mark.stake_mark
where DATE_FORMAT(warning.create_time,'%Y-%m') =DATE_FORMAT(#{createTime},'%Y-%m')
AND warning.direction=#{direction}
AND warning.direction=#{direction} and mark.direction=#{direction}
and mark.`section_id`=#{sectionId}
GROUP BY warning_type
ORDER BY number DESC
@ -180,7 +183,7 @@
FROM dc_warning as warning
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark
WHERE YEAR(warning.create_time) =DATE_FORMAT(#{createTime},'%Y')
AND warning.direction=#{direction}
AND warning.direction=#{direction} and mark.direction=#{direction}
and mark.`section_id`=#{sectionId}
</select>
<select id="selectWarningSectionTypeQuarter" resultType="java.util.HashMap">
@ -196,7 +199,7 @@
FROM dc_warning as warning
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark
WHERE YEAR(warning.create_time) =DATE_FORMAT(#{createTime},'%Y')
AND warning.direction=#{direction}
AND warning.direction=#{direction} and mark.direction=#{direction}
and mark.`section_id`=#{sectionId}
GROUP BY QUARTER, warningType
ORDER BY QUARTER;
@ -204,7 +207,7 @@
<select id="selectWarningSectionTypeYearCount" resultType="java.lang.String">
SELECT COUNT(*) AS number FROM dc_warning as warning
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark
where mark.`section_id`=#{sectionId} AND warning.direction=#{direction}
where mark.`section_id`=#{sectionId} AND warning.direction=#{direction} and mark.direction=#{direction}
and DATE_FORMAT(warning.create_time,'%Y')=DATE_FORMAT(#{createTime},'%Y')
</select>
@ -212,7 +215,7 @@
SELECT warning.warning_type warningType, COUNT(*) AS number
FROM dc_warning as warning
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark
where mark.`section_id`=#{sectionId} AND warning.direction=#{direction}
where mark.`section_id`=#{sectionId} AND warning.direction=#{direction} and mark.direction=#{direction}
and DATE_FORMAT(warning.create_time,'%Y')=DATE_FORMAT(#{createTime},'%Y')
GROUP BY warningType
</select>

Loading…
Cancel
Save