若依微服务1.9.9

business
1、每个场景只能配置一个离线报警规则。
2、每个设备也只能配置一个离线报警规则。
dev 1.9.9
xins 1 year ago
parent c14cf38b86
commit cb3ed199ae

@ -176,4 +176,7 @@ public class HwDictConstants {
public static final String ALARM_TYPE_COMMON_FLAG_YES = "1";//报警类型通用标识:是 public static final String ALARM_TYPE_COMMON_FLAG_YES = "1";//报警类型通用标识:是
public static final String ALARM_TYPE_COMMON_FLAG_NO = "0";//报警类型通用标识:否 public static final String ALARM_TYPE_COMMON_FLAG_NO = "0";//报警类型通用标识:否
public static final String OFFLINE_RULE_TYPE_DEVICE = "1";//离线报警规则类型:设备
public static final String OFFLINE_RULE_TYPE_SCENE = "3";//离线报警规则类型:场景
} }

@ -70,5 +70,10 @@ public enum BusinessType
/** /**
* *
*/ */
REBUILD REBUILD,
/**
*
*/
ALLOCATE
} }

@ -38,4 +38,13 @@ public interface HwOfflineTargetMapper {
*/ */
public int deleteOfflineTargets(@Param("offlineRuleId") Long offlineRuleId, public int deleteOfflineTargets(@Param("offlineRuleId") Long offlineRuleId,
@Param("targetType") String targetType, @Param("targetIds") Long[] targetIds); @Param("targetType") String targetType, @Param("targetIds") Long[] targetIds);
/**
* @param: offlineTarget
* @description 线
* @author xins
* @date 2023-11-15 11:24
* @return Integer
*/
public Integer selectOfflineTargetCount(HwOfflineTarget offlineTarget);
} }

@ -346,7 +346,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select distinct hd.device_id,hd.device_code,hd.device_name,hd.device_type,hd.publish_time,hmu.monitor_unit_name select distinct hd.device_id,hd.device_code,hd.device_name,hd.device_type,hd.publish_time,hmu.monitor_unit_name
from hw_device hd left join hw_monitor_unit hmu on hd.monitor_unit_id = hmu.monitor_unit_id from hw_device hd left join hw_monitor_unit hmu on hd.monitor_unit_id = hmu.monitor_unit_id
where hd.device_status != '9' and hd.scene_id=#{sceneId} where hd.device_status != '9' and hd.scene_id=#{sceneId}
and not exists (select 1 from hw_offline_target hot where hot.target_id=hd.device_id and hot.offline_rule_id = #{offlineRuleId}) and not exists (select 1 from hw_offline_target hot where hot.target_id=hd.device_id and hot.target_type = 1)
<if test="deviceCode != null and deviceCode != ''"> <if test="deviceCode != null and deviceCode != ''">
AND hd.device_code like concat('%', #{deviceCode}, '%') AND hd.device_code like concat('%', #{deviceCode}, '%')
</if> </if>

@ -57,7 +57,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectHwOfflineRuleList" parameterType="HwOfflineRule" resultMap="HwOfflineRuleResult"> <select id="selectHwOfflineRuleList" parameterType="HwOfflineRule" resultMap="HwOfflineRuleResult">
<include refid="selectHwOfflineRuleVo"/> <include refid="selectHwOfflineRuleVo"/>
<where> <where>
deleted_flag = '0'
<if test="offlineRuleName != null and offlineRuleName != ''"> and offline_rule_name like concat('%', #{offlineRuleName}, '%')</if> <if test="offlineRuleName != null and offlineRuleName != ''"> and offline_rule_name like concat('%', #{offlineRuleName}, '%')</if>
<if test="tenantId != null "> and tenant_id = #{tenantId}</if> <if test="tenantId != null "> and tenant_id = #{tenantId}</if>
<if test="sceneId != null "> and scene_id = #{sceneId}</if> <if test="sceneId != null "> and scene_id = #{sceneId}</if>

@ -28,5 +28,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{targetId} #{targetId}
</foreach> </foreach>
</delete> </delete>
<select id="selectOfflineTargetCount" parameterType="HwOfflineTarget" resultType="Integer">
select count(1) from hw_offline_target hot
<where>
<if test="targetType != null and targetType != ''"> and target_type = #{targetType}</if>
<if test="targetId != null "> and target_id = #{targetId}</if>
</where>
</select>
</mapper> </mapper>

@ -559,7 +559,7 @@ export default {
tenantId: null, tenantId: null,
sceneId: null, sceneId: null,
alarmLevelId: null, alarmLevelId: null,
ruleType: '3', ruleType: '1',
offlineTime: undefined, offlineTime: undefined,
offlineNumberTime: 1, offlineNumberTime: 1,
offlineNumber: 1, offlineNumber: 1,

Loading…
Cancel
Save