From 7454654bb147694847202c0730122ace4111b555 Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Fri, 28 Jun 2024 11:41:42 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=9E=E6=9C=BA=E9=A2=84=E8=AD=A6=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E7=B1=BB=E5=9E=8B=E5=8A=A0=E6=94=B6=E8=B4=B9=E7=AB=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/domain/DcWarning.java | 10 ++++++++++ .../DcPerceivedEventsWarningMapper.xml | 20 +++++++++++-------- 2 files changed, 22 insertions(+), 8 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 10627b66..9118285b 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 @@ -127,6 +127,16 @@ public class DcWarning extends BaseEntity @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8") private Date currently; + private Long facilityId; + + public Long getFacilityId() { + return facilityId; + } + + public void setFacilityId(Long facilityId) { + this.facilityId = facilityId; + } + public Date getCurrently() { return currently; } diff --git a/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml b/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml index 0738d82f..b76ec34d 100644 --- a/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml @@ -477,19 +477,21 @@ SELECT 20 UNION ALL SELECT 21 UNION ALL SELECT 22 UNION ALL SELECT 23 ) t1 left join - (select HOUR(warning_time) hours,count(*) num from dc_warning - where date_format(warning_time,'%Y-%m-%d') = date_format(#{warningTime},'%Y-%m-%d') - and warning_source=6 + (select HOUR(warning_time) hours,count(*) num,dc_warning.stake_mark,facility_name from dc_warning + left join dc_facility on dc_warning.stake_mark=dc_facility.stake_mark and dc_facility.facility_type=1 + where date_format(warning_time,'%Y-%m-%d') = date_format('2024-06-25','%Y-%m-%d') and warning_source=6 + and dc_facility.id=#{facilityId} GROUP BY hours) t2 on t1.n = t2.hours