Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 2 years ago
parent
commit
866b343729
  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> 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(); 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 distinct STATION_NAME from hzims_history_abnormal_alarm
</select> </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 select * from hzims_history_abnormal_alarm
where is_deleted = 0 where is_deleted = 0
<if test="type != null and type != ''"> <if test="type != null and type != ''">
and type = #{type} and type = #{type}
</if> </if>
<if test="stationName != null and stationName != ''"> <if test="stationName != null">
and station_name = #{stationName} and station_name in
<foreach collection="stationName" item="item" open="(" close=")" separator="," >
#{item}
</foreach>
</if> </if>
<if test="startTime != null and startTime != ''"> <if test="startTime != null">
and start_time = #{startTime} and start_time &gt; #{startTime}
</if> </if>
<if test="endTime != null and endTime != ''"> <if test="endTime != null">
and end_time = #{endTime} and end_time &lt;= #{endTime}
</if> </if>
</select> </select>
</mapper> </mapper>

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

@ -162,7 +162,8 @@ public class HistoryAbnormalAlarmServiceImpl extends BaseServiceImpl<HistoryAbno
private QueryWrapper<HistoryAbnormalAlarmEntity> getAlarmEntityQueryWrapper(HistoryAbnormalAlarmEntity entity) { private QueryWrapper<HistoryAbnormalAlarmEntity> getAlarmEntityQueryWrapper(HistoryAbnormalAlarmEntity entity) {
QueryWrapper<HistoryAbnormalAlarmEntity> queryWrapper = new QueryWrapper<>(); QueryWrapper<HistoryAbnormalAlarmEntity> queryWrapper = new QueryWrapper<>();
if (entity.getStationName() != null) { 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) { if (entity.getType() != null) {
queryWrapper.lambda().eq(HistoryAbnormalAlarmEntity::getType, entity.getType()); queryWrapper.lambda().eq(HistoryAbnormalAlarmEntity::getType, entity.getType());

Loading…
Cancel
Save