From eccf7b309c8b074e177a9801b34b5ad5f4c13fff Mon Sep 17 00:00:00 2001 From: tyty Date: Tue, 21 Mar 2023 10:20:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=91=8A=E8=AD=A6=E4=B8=AD?= =?UTF-8?q?=E6=96=AD=E7=BB=9F=E8=AE=A1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alert/mapper/HistoryAbnormalAlarmMapper.java | 2 +- .../alert/mapper/HistoryAbnormalAlarmMapper.xml | 17 ++++++++++------- .../service/impl/HistoryAbnormalAlarmServiceImpl.java | 3 ++- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryAbnormalAlarmMapper.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryAbnormalAlarmMapper.java index d83996f..bfa1514 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryAbnormalAlarmMapper.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryAbnormalAlarmMapper.java @@ -20,7 +20,7 @@ public interface HistoryAbnormalAlarmMapper extends UserDataScopeBaseMapper selectPageList(IPage page, String type, List stations); - List getAlarmEntity(@Param("type") String type,@Param("stationName") String stationName,@Param("startTime") Date startTime,@Param("endTime") Date endTime); + List getAlarmEntity(@Param("type") String type,@Param("stationName") List stationName,@Param("startTime") Date startTime,@Param("endTime") Date endTime); List getStationName(); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryAbnormalAlarmMapper.xml b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryAbnormalAlarmMapper.xml index 8d2cbc8..930c9d6 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryAbnormalAlarmMapper.xml +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryAbnormalAlarmMapper.xml @@ -27,20 +27,23 @@ select distinct STATION_NAME from hzims_history_abnormal_alarm - select * from hzims_history_abnormal_alarm where is_deleted = 0 and type = #{type} - - and station_name = #{stationName} + + and station_name in + + #{item} + - - and start_time = #{startTime} + + and start_time > #{startTime} - - and end_time = #{endTime} + + and end_time <= #{endTime} diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java index 01c9fe7..302a3f3 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java @@ -158,7 +158,8 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl getAlarmEntityQueryWrapper(HistoryAbnormalAlarmEntity entity) { QueryWrapper queryWrapper = new QueryWrapper<>(); if (entity.getStationName() != null) { - queryWrapper.lambda().like(HistoryAbnormalAlarmEntity::getStationName, entity.getStationName()); + String[] list = entity.getStationName().split(","); + queryWrapper.lambda().in(HistoryAbnormalAlarmEntity::getStationName, list); } if (entity.getType() != null) { queryWrapper.lambda().eq(HistoryAbnormalAlarmEntity::getType, entity.getType());