From 860b86b84eb61a624bcc92c00d7b3fa7d8a8beee Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Wed, 7 Feb 2024 11:40:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=84=9F=E7=9F=A5=E4=BA=8B=E4=BB=B6=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/domain/DcWarning.java | 21 ++++++++++---- .../DcPerceivedEventsWarningMapper.xml | 29 ++++++++++--------- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/domain/DcWarning.java b/zc-business/src/main/java/com/zc/business/domain/DcWarning.java index e7afdaeb..ec4f5fd5 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcWarning.java +++ b/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(); } } diff --git a/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml b/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml index 463eae16..3db42af9 100644 --- a/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml @@ -15,6 +15,7 @@ @@ -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 @@ -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 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') @@ -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