若依微服务1.9
business: 1、电子围栏编辑时: 1)、如果有关联报警信息,则不能修改和删除区域信息 2)、在保存区域信息fencearea时,需要将之前的fenceareaid返回保存,以免修改了fenceareaId 3)、删除时为逻辑删除 2、设备报警规则 1)、编辑时判断是否有报警信息关联,如果有关联则不能修改设备、设备属性、条件、A值和B值。 2)、编辑时不能修改场景 3)、删除时为逻辑删除 dataprocess: 处理设备报警规则dev 1.9
parent
15a5c13d70
commit
08032a81eb
@ -0,0 +1,23 @@
|
||||
package com.ruoyi.dataprocess.mapper;
|
||||
|
||||
|
||||
import com.ruoyi.dataprocess.domain.HwAlarmRule;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报警规则Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-11-03
|
||||
*/
|
||||
public interface HwAlarmRuleMapper {
|
||||
/**
|
||||
* 查询报警规则列表with联动列表
|
||||
*
|
||||
* @param hwAlarmRule 报警规则
|
||||
* @return 报警规则集合
|
||||
*/
|
||||
public List<HwAlarmRule> selectHwAlarmRulesWithLink(HwAlarmRule hwAlarmRule);
|
||||
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.dataprocess.mapper.HwAlarmRuleMapper">
|
||||
|
||||
<resultMap type="HwAlarmRule" id="HwAlarmRuleResult">
|
||||
<result property="alarmRuleId" column="alarm_rule_id" />
|
||||
<result property="alarmRuleName" column="alarm_rule_name" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="sceneId" column="scene_id" />
|
||||
<result property="languageCode" column="language_code" />
|
||||
<result property="alarmLevelId" column="alarm_level_id" />
|
||||
<result property="alarmTypeId" column="alarm_type_id" />
|
||||
<result property="ruleType" column="rule_type" />
|
||||
<result property="ruleDeviceId" column="rule_device_id" />
|
||||
<result property="ruleFunctionTotal" column="rule_function_total" />
|
||||
<result property="triggerExpression" column="trigger_expression" />
|
||||
<result property="linkFlag" column="link_flag" />
|
||||
<result property="alarmRuleStatus" column="alarm_rule_status" />
|
||||
<result property="alarmPushFlag" column="alarm_push_flag" />
|
||||
<result property="alarmPushContent" column="alarm_push_content" />
|
||||
<result property="alarmRecoverContent" column="alarm_recover_content" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="alarmRuleField" column="alarm_rule_field" />
|
||||
<result property="tenantName" column="tenant_name" />
|
||||
<result property="sceneName" column="scene_name" />
|
||||
<result property="alarmTypeName" column="alarm_type_name" />
|
||||
<result property="alarmLevelName" column="alarm_level_name" />
|
||||
<result property="ruleDeviceName" column="device_name" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="HwAlarmRuleHwAlarmRuleLinkResult" type="HwAlarmRule" extends="HwAlarmRuleResult">
|
||||
<collection property="hwAlarmRuleLinkList" notNullColumn="sub_rule_link_id" javaType="java.util.List" resultMap="HwAlarmRuleLinkResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="HwAlarmRuleLink" id="HwAlarmRuleLinkResult">
|
||||
<result property="ruleLinkId" column="sub_rule_link_id" />
|
||||
<result property="alarmRuleId" column="sub_alarm_rule_id" />
|
||||
<result property="linkType" column="sub_link_type" />
|
||||
<result property="linkDeviceId" column="sub_link_device_id" />
|
||||
<result property="linkDeviceFunctionId" column="sub_link_device_function_id" />
|
||||
<result property="linkDeviceFunctionIdentifier" column="sub_link_device_function_identifier" />
|
||||
<result property="linkDeviceFunctionData" column="sub_link_device_function_data" />
|
||||
<result property="linkDeviceName" column="sub_link_device_name" />
|
||||
<result property="linkDeviceModeFunctionName" column="sub_link_device_mode_function_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHwAlarmRuleVo">
|
||||
select alarm_rule_id, alarm_rule_name, tenant_id, scene_id, language_code, alarm_level_id, alarm_type_id, rule_type, rule_device_id, rule_function_total, trigger_expression, link_flag, alarm_rule_status, alarm_push_flag, alarm_push_content, alarm_recover_content, remark, create_by, create_time, update_by, update_time, alarm_rule_field from hw_alarm_rule
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectHwAlarmRulesWithLink" parameterType="HwAlarmRule" resultMap="HwAlarmRuleHwAlarmRuleLinkResult">
|
||||
select a.alarm_rule_id, a.alarm_rule_name, a.tenant_id, a.scene_id, a.language_code, a.alarm_level_id, a.alarm_type_id, a.rule_type, a.rule_device_id, a.rule_function_total, a.trigger_expression, a.link_flag, a.alarm_rule_status, a.alarm_push_flag, a.alarm_push_content, a.alarm_recover_content, a.remark, a.create_by, a.create_time, a.update_by, a.update_time, a.alarm_rule_field,
|
||||
b.rule_link_id as sub_rule_link_id, b.alarm_rule_id as sub_alarm_rule_id, b.link_type as sub_link_type, b.link_device_id as sub_link_device_id, b.link_device_function_id as sub_link_device_function_id, b.link_device_function_identifier as sub_link_device_function_identifier, b.link_device_function_data as sub_link_device_function_data
|
||||
from hw_alarm_rule a
|
||||
left join hw_alarm_rule_link b on b.alarm_rule_id = a.alarm_rule_id
|
||||
<where>
|
||||
<if test="alarmRuleName != null and alarmRuleName != ''"> and a.alarm_rule_name like concat('%', #{alarmRuleName}, '%')</if>
|
||||
<if test="tenantId != null "> and a.tenant_id = #{tenantId}</if>
|
||||
<if test="sceneId != null "> and a.scene_id = #{sceneId}</if>
|
||||
<if test="alarmLevelId != null "> and a.alarm_level_id = #{alarmLevelId}</if>
|
||||
<if test="alarmTypeId != null "> and a.alarm_type_id = #{alarmTypeId}</if>
|
||||
<if test="ruleType != null and ruleType != ''"> and a.rule_type = #{ruleType}</if>
|
||||
<if test="ruleDeviceId != null "> and a.rule_device_id = #{ruleDeviceId}</if>
|
||||
<if test="ruleFunctionTotal != null "> and a.rule_function_total = #{ruleFunctionTotal}</if>
|
||||
<if test="linkFlag != null and linkFlag != ''"> and a.link_flag = #{linkFlag}</if>
|
||||
<if test="alarmRuleStatus != null and alarmRuleStatus != ''"> and a.alarm_rule_status = #{alarmRuleStatus}</if>
|
||||
<if test="alarmPushFlag != null and alarmPushFlag != ''"> and a.alarm_push_flag = #{alarmPushFlag}</if>
|
||||
|
||||
</where>
|
||||
|
||||
order by a.alarm_rule_id desc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue