Browse Source

修改告警中断统计接口

zhongwei
tyty 2 years ago
parent
commit
eccf7b309c
  1. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryAbnormalAlarmMapper.java
  2. 17
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryAbnormalAlarmMapper.xml
  3. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/mapper/HistoryAbnormalAlarmMapper.java

@ -20,7 +20,7 @@ public interface HistoryAbnormalAlarmMapper extends UserDataScopeBaseMapper<Hist
List<HistoryAbnormalAlarmVo> selectPageList(IPage<HistoryAbnormalAlarmVo> page, String type, List<String> stations);
List<HistoryAbnormalAlarmVo> getAlarmEntity(@Param("type") String type,@Param("stationName") String stationName,@Param("startTime") Date startTime,@Param("endTime") Date endTime);
List<HistoryAbnormalAlarmEntity> getAlarmEntity(@Param("type") String type,@Param("stationName") List<String> stationName,@Param("startTime") Date startTime,@Param("endTime") Date endTime);
List<String> getStationName();
}

17
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>
<select id="getAlarmEntity" resultType="com.hnac.hzims.operational.station.vo.HistoryAbnormalAlarmVo">
<select id="getAlarmEntity" resultType="com.hnac.hzims.operational.alert.entity.HistoryAbnormalAlarmEntity">
select * from hzims_history_abnormal_alarm
where is_deleted = 0
<if test="type != null and type != ''">
and type = #{type}
</if>
<if test="stationName != null and stationName != ''">
and station_name = #{stationName}
<if test="stationName != null">
and station_name in
<foreach collection="stationName" item="item" open="(" close=")" separator="," >
#{item}
</foreach>
</if>
<if test="startTime != null and startTime != ''">
and start_time = #{startTime}
<if test="startTime != null">
and start_time &gt; #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and end_time = #{endTime}
<if test="endTime != null">
and end_time &lt;= #{endTime}
</if>
</select>
</mapper>

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/alert/service/impl/HistoryAbnormalAlarmServiceImpl.java

@ -158,7 +158,8 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
private QueryWrapper<HistoryAbnormalAlarmEntity> getAlarmEntityQueryWrapper(HistoryAbnormalAlarmEntity entity) {
QueryWrapper<HistoryAbnormalAlarmEntity> 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());

Loading…
Cancel
Save