若依微服务1.3.3
修复bug: 1、标准场景传scenceid值不对的问题 2、定位场景告警信息没有传sceneid的问题 3、设备监测页面监控单元信息显示的问题 4、设备监测页面查看设备信息传参传反的问题dev 1.3.3
parent
deb1044dd4
commit
76a99b2d02
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-api</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>hw-api-business</artifactId>
|
||||
|
||||
<description>
|
||||
hw-api-business平台业务模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- RuoYi Common Core-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -0,0 +1,21 @@
|
||||
package com.ruoyi.business.api;
|
||||
|
||||
import com.ruoyi.business.api.factory.RemoteBusinessFallbackFactory;
|
||||
import com.ruoyi.common.core.constant.ServiceNameConstants;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
@FeignClient(contextId = "remoteBusinessService", value = ServiceNameConstants.BUSINESS_SERVICE, fallbackFactory = RemoteBusinessFallbackFactory.class)
|
||||
public interface RemoteBusinessService {
|
||||
|
||||
/**
|
||||
* 通过用户名查询用户信息
|
||||
*
|
||||
* @param days 几天前的
|
||||
* @return 结果
|
||||
*/
|
||||
@GetMapping("/device/computeOnlineDevicecCount/{days}")
|
||||
public R<?> computeOnlineDevicecCount(@PathVariable("days") int days);
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.ruoyi.business.api.factory;
|
||||
|
||||
import com.ruoyi.business.api.RemoteBusinessService;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 平台业务模块服务降级处理
|
||||
* @ClassName: RemoteBusinessFallbackFactory
|
||||
* @Author : xins
|
||||
* @Date :2023-09-20 20:25
|
||||
* @Version :1.0
|
||||
*/
|
||||
public class RemoteBusinessFallbackFactory implements FallbackFactory<RemoteBusinessService> {
|
||||
@Override
|
||||
public RemoteBusinessService create(Throwable throwable) {
|
||||
return new RemoteBusinessService() {
|
||||
@Override
|
||||
public R<?> computeOnlineDevicecCount(int days) {
|
||||
return R.fail("获取租户信息失败:" + throwable.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
com.ruoyi.business.api.factory.RemoteBusinessFallbackFactory
|
||||
|
@ -0,0 +1,11 @@
|
||||
package com.ruoyi.business.domain.VO;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AlarmInfoVo {
|
||||
|
||||
private Integer alarmCount;
|
||||
|
||||
|
||||
}
|
@ -1,105 +0,0 @@
|
||||
package com.ruoyi.business.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.business.domain.HwAlarmRule;
|
||||
import com.ruoyi.business.service.IHwAlarmRuleService;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 报警规则Controller
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-09-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/alarmRule")
|
||||
public class HwAlarmRuleController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IHwAlarmRuleService hwAlarmRuleService;
|
||||
|
||||
/**
|
||||
* 查询报警规则列表
|
||||
*/
|
||||
@RequiresPermissions("business:alarmRule:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HwAlarmRule hwAlarmRule)
|
||||
{
|
||||
startPage();
|
||||
List<HwAlarmRule> list = hwAlarmRuleService.selectHwAlarmRuleList(hwAlarmRule);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出报警规则列表
|
||||
*/
|
||||
@RequiresPermissions("business:alarmRule:export")
|
||||
@Log(title = "报警规则", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HwAlarmRule hwAlarmRule)
|
||||
{
|
||||
List<HwAlarmRule> list = hwAlarmRuleService.selectHwAlarmRuleList(hwAlarmRule);
|
||||
ExcelUtil<HwAlarmRule> util = new ExcelUtil<HwAlarmRule>(HwAlarmRule.class);
|
||||
util.exportExcel(response, list, "报警规则数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取报警规则详细信息
|
||||
*/
|
||||
@RequiresPermissions("business:alarmRule:query")
|
||||
@GetMapping(value = "/{alarmRuleId}")
|
||||
public AjaxResult getInfo(@PathVariable("alarmRuleId") Long alarmRuleId)
|
||||
{
|
||||
return success(hwAlarmRuleService.selectHwAlarmRuleByAlarmRuleId(alarmRuleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增报警规则
|
||||
*/
|
||||
@RequiresPermissions("business:alarmRule:add")
|
||||
@Log(title = "报警规则", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody HwAlarmRule hwAlarmRule)
|
||||
{
|
||||
return toAjax(hwAlarmRuleService.insertHwAlarmRule(hwAlarmRule));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报警规则
|
||||
*/
|
||||
@RequiresPermissions("business:alarmRule:edit")
|
||||
@Log(title = "报警规则", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody HwAlarmRule hwAlarmRule)
|
||||
{
|
||||
return toAjax(hwAlarmRuleService.updateHwAlarmRule(hwAlarmRule));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除报警规则
|
||||
*/
|
||||
@RequiresPermissions("business:alarmRule:remove")
|
||||
@Log(title = "报警规则", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{alarmRuleIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] alarmRuleIds)
|
||||
{
|
||||
return toAjax(hwAlarmRuleService.deleteHwAlarmRuleByAlarmRuleIds(alarmRuleIds));
|
||||
}
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
package com.ruoyi.business.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.HwAlarmRule;
|
||||
|
||||
/**
|
||||
* 报警规则Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-09-16
|
||||
*/
|
||||
public interface HwAlarmRuleMapper
|
||||
{
|
||||
/**
|
||||
* 查询报警规则
|
||||
*
|
||||
* @param alarmRuleId 报警规则主键
|
||||
* @return 报警规则
|
||||
*/
|
||||
public HwAlarmRule selectHwAlarmRuleByAlarmRuleId(Long alarmRuleId);
|
||||
|
||||
/**
|
||||
* 查询报警规则列表
|
||||
*
|
||||
* @param hwAlarmRule 报警规则
|
||||
* @return 报警规则集合
|
||||
*/
|
||||
public List<HwAlarmRule> selectHwAlarmRuleList(HwAlarmRule hwAlarmRule);
|
||||
|
||||
/**
|
||||
* 新增报警规则
|
||||
*
|
||||
* @param hwAlarmRule 报警规则
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHwAlarmRule(HwAlarmRule hwAlarmRule);
|
||||
|
||||
/**
|
||||
* 修改报警规则
|
||||
*
|
||||
* @param hwAlarmRule 报警规则
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHwAlarmRule(HwAlarmRule hwAlarmRule);
|
||||
|
||||
/**
|
||||
* 删除报警规则
|
||||
*
|
||||
* @param alarmRuleId 报警规则主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwAlarmRuleByAlarmRuleId(Long alarmRuleId);
|
||||
|
||||
/**
|
||||
* 批量删除报警规则
|
||||
*
|
||||
* @param alarmRuleIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwAlarmRuleByAlarmRuleIds(Long[] alarmRuleIds);
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
package com.ruoyi.business.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.business.domain.HwAlarmRule;
|
||||
|
||||
/**
|
||||
* 报警规则Service接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-09-16
|
||||
*/
|
||||
public interface IHwAlarmRuleService
|
||||
{
|
||||
/**
|
||||
* 查询报警规则
|
||||
*
|
||||
* @param alarmRuleId 报警规则主键
|
||||
* @return 报警规则
|
||||
*/
|
||||
public HwAlarmRule selectHwAlarmRuleByAlarmRuleId(Long alarmRuleId);
|
||||
|
||||
/**
|
||||
* 查询报警规则列表
|
||||
*
|
||||
* @param hwAlarmRule 报警规则
|
||||
* @return 报警规则集合
|
||||
*/
|
||||
public List<HwAlarmRule> selectHwAlarmRuleList(HwAlarmRule hwAlarmRule);
|
||||
|
||||
/**
|
||||
* 新增报警规则
|
||||
*
|
||||
* @param hwAlarmRule 报警规则
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHwAlarmRule(HwAlarmRule hwAlarmRule);
|
||||
|
||||
/**
|
||||
* 修改报警规则
|
||||
*
|
||||
* @param hwAlarmRule 报警规则
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHwAlarmRule(HwAlarmRule hwAlarmRule);
|
||||
|
||||
/**
|
||||
* 批量删除报警规则
|
||||
*
|
||||
* @param alarmRuleIds 需要删除的报警规则主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwAlarmRuleByAlarmRuleIds(Long[] alarmRuleIds);
|
||||
|
||||
/**
|
||||
* 删除报警规则信息
|
||||
*
|
||||
* @param alarmRuleId 报警规则主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwAlarmRuleByAlarmRuleId(Long alarmRuleId);
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
package com.ruoyi.business.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.business.mapper.HwAlarmRuleMapper;
|
||||
import com.ruoyi.business.domain.HwAlarmRule;
|
||||
import com.ruoyi.business.service.IHwAlarmRuleService;
|
||||
|
||||
/**
|
||||
* 报警规则Service业务层处理
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-09-16
|
||||
*/
|
||||
@Service
|
||||
public class HwAlarmRuleServiceImpl implements IHwAlarmRuleService
|
||||
{
|
||||
@Autowired
|
||||
private HwAlarmRuleMapper hwAlarmRuleMapper;
|
||||
|
||||
/**
|
||||
* 查询报警规则
|
||||
*
|
||||
* @param alarmRuleId 报警规则主键
|
||||
* @return 报警规则
|
||||
*/
|
||||
@Override
|
||||
public HwAlarmRule selectHwAlarmRuleByAlarmRuleId(Long alarmRuleId)
|
||||
{
|
||||
return hwAlarmRuleMapper.selectHwAlarmRuleByAlarmRuleId(alarmRuleId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询报警规则列表
|
||||
*
|
||||
* @param hwAlarmRule 报警规则
|
||||
* @return 报警规则
|
||||
*/
|
||||
@Override
|
||||
public List<HwAlarmRule> selectHwAlarmRuleList(HwAlarmRule hwAlarmRule)
|
||||
{
|
||||
return hwAlarmRuleMapper.selectHwAlarmRuleList(hwAlarmRule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增报警规则
|
||||
*
|
||||
* @param hwAlarmRule 报警规则
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertHwAlarmRule(HwAlarmRule hwAlarmRule)
|
||||
{
|
||||
hwAlarmRule.setCreateTime(DateUtils.getNowDate());
|
||||
return hwAlarmRuleMapper.insertHwAlarmRule(hwAlarmRule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报警规则
|
||||
*
|
||||
* @param hwAlarmRule 报警规则
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateHwAlarmRule(HwAlarmRule hwAlarmRule)
|
||||
{
|
||||
hwAlarmRule.setUpdateTime(DateUtils.getNowDate());
|
||||
return hwAlarmRuleMapper.updateHwAlarmRule(hwAlarmRule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除报警规则
|
||||
*
|
||||
* @param alarmRuleIds 需要删除的报警规则主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHwAlarmRuleByAlarmRuleIds(Long[] alarmRuleIds)
|
||||
{
|
||||
return hwAlarmRuleMapper.deleteHwAlarmRuleByAlarmRuleIds(alarmRuleIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除报警规则信息
|
||||
*
|
||||
* @param alarmRuleId 报警规则主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteHwAlarmRuleByAlarmRuleId(Long alarmRuleId)
|
||||
{
|
||||
return hwAlarmRuleMapper.deleteHwAlarmRuleByAlarmRuleId(alarmRuleId);
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.ruoyi.dataprocess.mapper;
|
||||
|
||||
import com.ruoyi.dataprocess.domain.HwFenceArea;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电子围栏区域Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2023-09-19
|
||||
*/
|
||||
public interface HwFenceAreaMapper
|
||||
{
|
||||
/**
|
||||
* 查询电子围栏区域
|
||||
*
|
||||
* @param fenceAreaId 电子围栏区域主键
|
||||
* @return 电子围栏区域
|
||||
*/
|
||||
public HwFenceArea selectHwFenceAreaByFenceAreaId(Long fenceAreaId);
|
||||
|
||||
/**
|
||||
* 查询电子围栏区域列表
|
||||
*
|
||||
* @param hwFenceArea 电子围栏区域
|
||||
* @return 电子围栏区域集合
|
||||
*/
|
||||
public List<HwFenceArea> selectHwFenceAreaList(HwFenceArea hwFenceArea);
|
||||
|
||||
/**
|
||||
* 新增电子围栏区域
|
||||
*
|
||||
* @param hwFenceArea 电子围栏区域
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHwFenceArea(HwFenceArea hwFenceArea);
|
||||
|
||||
/**
|
||||
* 修改电子围栏区域
|
||||
*
|
||||
* @param hwFenceArea 电子围栏区域
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHwFenceArea(HwFenceArea hwFenceArea);
|
||||
|
||||
/**
|
||||
* 删除电子围栏区域
|
||||
*
|
||||
* @param fenceAreaId 电子围栏区域主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwFenceAreaByFenceAreaId(Long fenceAreaId);
|
||||
|
||||
/**
|
||||
* 批量删除电子围栏区域
|
||||
*
|
||||
* @param fenceAreaIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHwFenceAreaByFenceAreaIds(Long[] fenceAreaIds);
|
||||
}
|
@ -1,196 +0,0 @@
|
||||
<?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.business.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="alarmLevelId" column="alarm_level_id" />
|
||||
<result property="alarmTypeId" column="alarm_type_id" />
|
||||
<result property="ruleType" column="rule_type" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="deviceModeId" column="device_mode_id" />
|
||||
<result property="modeFunctionId" column="mode_function_id" />
|
||||
<result property="triggerCondition" column="trigger_condition" />
|
||||
<result property="triggerDataA" column="trigger_data_a" />
|
||||
<result property="triggerDataB" column="trigger_data_b" />
|
||||
<result property="triggerDeadzone" column="trigger_deadzone" />
|
||||
<result property="triggerNumber" column="trigger_number" />
|
||||
<result property="triggerTimeFrame" column="trigger_time_frame" />
|
||||
<result property="linkFlag" column="link_flag" />
|
||||
<result property="linkType" column="link_type" />
|
||||
<result property="linkDeviceId" column="link_device_id" />
|
||||
<result property="linkDeviceFunctionId" column="link_device_function_id" />
|
||||
<result property="linkDeviceFunctionData" column="link_device_function_data" />
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHwAlarmRuleVo">
|
||||
select alarm_rule_id, alarm_rule_name, tenant_id, scene_id, alarm_level_id, alarm_type_id, rule_type, device_id, device_mode_id, mode_function_id, trigger_condition, trigger_data_a, trigger_data_b, trigger_deadzone, trigger_number, trigger_time_frame, link_flag, link_type, link_device_id, link_device_function_id, link_device_function_data, 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="selectHwAlarmRuleList" parameterType="HwAlarmRule" resultMap="HwAlarmRuleResult">
|
||||
<include refid="selectHwAlarmRuleVo"/>
|
||||
<where>
|
||||
<if test="alarmRuleName != null and alarmRuleName != ''"> and alarm_rule_name like concat('%', #{alarmRuleName}, '%')</if>
|
||||
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
|
||||
<if test="sceneId != null "> and scene_id = #{sceneId}</if>
|
||||
<if test="alarmLevelId != null "> and alarm_level_id = #{alarmLevelId}</if>
|
||||
<if test="alarmTypeId != null "> and alarm_type_id = #{alarmTypeId}</if>
|
||||
<if test="ruleType != null and ruleType != ''"> and rule_type = #{ruleType}</if>
|
||||
<if test="deviceId != null "> and device_id = #{deviceId}</if>
|
||||
<if test="deviceModeId != null "> and device_mode_id = #{deviceModeId}</if>
|
||||
<if test="modeFunctionId != null "> and mode_function_id = #{modeFunctionId}</if>
|
||||
<if test="triggerCondition != null and triggerCondition != ''"> and trigger_condition = #{triggerCondition}</if>
|
||||
<if test="triggerDataA != null and triggerDataA != ''"> and trigger_data_a = #{triggerDataA}</if>
|
||||
<if test="triggerDataB != null and triggerDataB != ''"> and trigger_data_b = #{triggerDataB}</if>
|
||||
<if test="triggerDeadzone != null and triggerDeadzone != ''"> and trigger_deadzone = #{triggerDeadzone}</if>
|
||||
<if test="triggerNumber != null "> and trigger_number = #{triggerNumber}</if>
|
||||
<if test="triggerTimeFrame != null "> and trigger_time_frame = #{triggerTimeFrame}</if>
|
||||
<if test="linkFlag != null and linkFlag != ''"> and link_flag = #{linkFlag}</if>
|
||||
<if test="linkType != null and linkType != ''"> and link_type = #{linkType}</if>
|
||||
<if test="linkDeviceId != null "> and link_device_id = #{linkDeviceId}</if>
|
||||
<if test="linkDeviceFunctionId != null "> and link_device_function_id = #{linkDeviceFunctionId}</if>
|
||||
<if test="linkDeviceFunctionData != null and linkDeviceFunctionData != ''"> and link_device_function_data = #{linkDeviceFunctionData}</if>
|
||||
<if test="alarmRuleStatus != null and alarmRuleStatus != ''"> and alarm_rule_status = #{alarmRuleStatus}</if>
|
||||
<if test="alarmPushFlag != null and alarmPushFlag != ''"> and alarm_push_flag = #{alarmPushFlag}</if>
|
||||
<if test="alarmPushContent != null and alarmPushContent != ''"> and alarm_push_content = #{alarmPushContent}</if>
|
||||
<if test="alarmRecoverContent != null and alarmRecoverContent != ''"> and alarm_recover_content = #{alarmRecoverContent}</if>
|
||||
<if test="alarmRuleField != null and alarmRuleField != ''"> and alarm_rule_field = #{alarmRuleField}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHwAlarmRuleByAlarmRuleId" parameterType="Long" resultMap="HwAlarmRuleResult">
|
||||
<include refid="selectHwAlarmRuleVo"/>
|
||||
where alarm_rule_id = #{alarmRuleId}
|
||||
</select>
|
||||
|
||||
<insert id="insertHwAlarmRule" parameterType="HwAlarmRule" useGeneratedKeys="true" keyProperty="alarmRuleId">
|
||||
insert into hw_alarm_rule
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="alarmRuleName != null and alarmRuleName != ''">alarm_rule_name,</if>
|
||||
<if test="tenantId != null">tenant_id,</if>
|
||||
<if test="sceneId != null">scene_id,</if>
|
||||
<if test="alarmLevelId != null">alarm_level_id,</if>
|
||||
<if test="alarmTypeId != null">alarm_type_id,</if>
|
||||
<if test="ruleType != null and ruleType != ''">rule_type,</if>
|
||||
<if test="deviceId != null">device_id,</if>
|
||||
<if test="deviceModeId != null">device_mode_id,</if>
|
||||
<if test="modeFunctionId != null">mode_function_id,</if>
|
||||
<if test="triggerCondition != null and triggerCondition != ''">trigger_condition,</if>
|
||||
<if test="triggerDataA != null and triggerDataA != ''">trigger_data_a,</if>
|
||||
<if test="triggerDataB != null">trigger_data_b,</if>
|
||||
<if test="triggerDeadzone != null">trigger_deadzone,</if>
|
||||
<if test="triggerNumber != null">trigger_number,</if>
|
||||
<if test="triggerTimeFrame != null">trigger_time_frame,</if>
|
||||
<if test="linkFlag != null and linkFlag != ''">link_flag,</if>
|
||||
<if test="linkType != null">link_type,</if>
|
||||
<if test="linkDeviceId != null">link_device_id,</if>
|
||||
<if test="linkDeviceFunctionId != null">link_device_function_id,</if>
|
||||
<if test="linkDeviceFunctionData != null">link_device_function_data,</if>
|
||||
<if test="alarmRuleStatus != null and alarmRuleStatus != ''">alarm_rule_status,</if>
|
||||
<if test="alarmPushFlag != null and alarmPushFlag != ''">alarm_push_flag,</if>
|
||||
<if test="alarmPushContent != null">alarm_push_content,</if>
|
||||
<if test="alarmRecoverContent != null">alarm_recover_content,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="alarmRuleField != null">alarm_rule_field,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="alarmRuleName != null and alarmRuleName != ''">#{alarmRuleName},</if>
|
||||
<if test="tenantId != null">#{tenantId},</if>
|
||||
<if test="sceneId != null">#{sceneId},</if>
|
||||
<if test="alarmLevelId != null">#{alarmLevelId},</if>
|
||||
<if test="alarmTypeId != null">#{alarmTypeId},</if>
|
||||
<if test="ruleType != null and ruleType != ''">#{ruleType},</if>
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="deviceModeId != null">#{deviceModeId},</if>
|
||||
<if test="modeFunctionId != null">#{modeFunctionId},</if>
|
||||
<if test="triggerCondition != null and triggerCondition != ''">#{triggerCondition},</if>
|
||||
<if test="triggerDataA != null and triggerDataA != ''">#{triggerDataA},</if>
|
||||
<if test="triggerDataB != null">#{triggerDataB},</if>
|
||||
<if test="triggerDeadzone != null">#{triggerDeadzone},</if>
|
||||
<if test="triggerNumber != null">#{triggerNumber},</if>
|
||||
<if test="triggerTimeFrame != null">#{triggerTimeFrame},</if>
|
||||
<if test="linkFlag != null and linkFlag != ''">#{linkFlag},</if>
|
||||
<if test="linkType != null">#{linkType},</if>
|
||||
<if test="linkDeviceId != null">#{linkDeviceId},</if>
|
||||
<if test="linkDeviceFunctionId != null">#{linkDeviceFunctionId},</if>
|
||||
<if test="linkDeviceFunctionData != null">#{linkDeviceFunctionData},</if>
|
||||
<if test="alarmRuleStatus != null and alarmRuleStatus != ''">#{alarmRuleStatus},</if>
|
||||
<if test="alarmPushFlag != null and alarmPushFlag != ''">#{alarmPushFlag},</if>
|
||||
<if test="alarmPushContent != null">#{alarmPushContent},</if>
|
||||
<if test="alarmRecoverContent != null">#{alarmRecoverContent},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="alarmRuleField != null">#{alarmRuleField},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHwAlarmRule" parameterType="HwAlarmRule">
|
||||
update hw_alarm_rule
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="alarmRuleName != null and alarmRuleName != ''">alarm_rule_name = #{alarmRuleName},</if>
|
||||
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
||||
<if test="sceneId != null">scene_id = #{sceneId},</if>
|
||||
<if test="alarmLevelId != null">alarm_level_id = #{alarmLevelId},</if>
|
||||
<if test="alarmTypeId != null">alarm_type_id = #{alarmTypeId},</if>
|
||||
<if test="ruleType != null and ruleType != ''">rule_type = #{ruleType},</if>
|
||||
<if test="deviceId != null">device_id = #{deviceId},</if>
|
||||
<if test="deviceModeId != null">device_mode_id = #{deviceModeId},</if>
|
||||
<if test="modeFunctionId != null">mode_function_id = #{modeFunctionId},</if>
|
||||
<if test="triggerCondition != null and triggerCondition != ''">trigger_condition = #{triggerCondition},</if>
|
||||
<if test="triggerDataA != null and triggerDataA != ''">trigger_data_a = #{triggerDataA},</if>
|
||||
<if test="triggerDataB != null">trigger_data_b = #{triggerDataB},</if>
|
||||
<if test="triggerDeadzone != null">trigger_deadzone = #{triggerDeadzone},</if>
|
||||
<if test="triggerNumber != null">trigger_number = #{triggerNumber},</if>
|
||||
<if test="triggerTimeFrame != null">trigger_time_frame = #{triggerTimeFrame},</if>
|
||||
<if test="linkFlag != null and linkFlag != ''">link_flag = #{linkFlag},</if>
|
||||
<if test="linkType != null">link_type = #{linkType},</if>
|
||||
<if test="linkDeviceId != null">link_device_id = #{linkDeviceId},</if>
|
||||
<if test="linkDeviceFunctionId != null">link_device_function_id = #{linkDeviceFunctionId},</if>
|
||||
<if test="linkDeviceFunctionData != null">link_device_function_data = #{linkDeviceFunctionData},</if>
|
||||
<if test="alarmRuleStatus != null and alarmRuleStatus != ''">alarm_rule_status = #{alarmRuleStatus},</if>
|
||||
<if test="alarmPushFlag != null and alarmPushFlag != ''">alarm_push_flag = #{alarmPushFlag},</if>
|
||||
<if test="alarmPushContent != null">alarm_push_content = #{alarmPushContent},</if>
|
||||
<if test="alarmRecoverContent != null">alarm_recover_content = #{alarmRecoverContent},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="alarmRuleField != null">alarm_rule_field = #{alarmRuleField},</if>
|
||||
</trim>
|
||||
where alarm_rule_id = #{alarmRuleId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHwAlarmRuleByAlarmRuleId" parameterType="Long">
|
||||
delete from hw_alarm_rule where alarm_rule_id = #{alarmRuleId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHwAlarmRuleByAlarmRuleIds" parameterType="String">
|
||||
delete from hw_alarm_rule where alarm_rule_id in
|
||||
<foreach item="alarmRuleId" collection="array" open="(" separator="," close=")">
|
||||
#{alarmRuleId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,66 @@
|
||||
<?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.HwFenceAreaMapper">
|
||||
|
||||
<resultMap type="HwFenceArea" id="HwFenceAreaResult">
|
||||
<result property="fenceAreaId" column="fence_area_id" />
|
||||
<result property="electronicFenceId" column="electronic_fence_id" />
|
||||
<result property="areaShapeFlag" column="area_shape_flag" />
|
||||
<result property="areaRange" column="area_range" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectHwFenceAreaVo">
|
||||
select fence_area_id, electronic_fence_id, area_shape_flag, area_range from hw_fence_area
|
||||
</sql>
|
||||
|
||||
<select id="selectHwFenceAreaList" parameterType="HwFenceArea" resultMap="HwFenceAreaResult">
|
||||
<include refid="selectHwFenceAreaVo"/>
|
||||
<where>
|
||||
<if test="electronicFenceId != null "> and electronic_fence_id = #{electronicFenceId}</if>
|
||||
<if test="areaShapeFlag != null and areaShapeFlag != ''"> and area_shape_flag = #{areaShapeFlag}</if>
|
||||
<if test="areaRange != null and areaRange != ''"> and area_range = #{areaRange}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectHwFenceAreaByFenceAreaId" parameterType="Long" resultMap="HwFenceAreaResult">
|
||||
<include refid="selectHwFenceAreaVo"/>
|
||||
where fence_area_id = #{fenceAreaId}
|
||||
</select>
|
||||
|
||||
<insert id="insertHwFenceArea" parameterType="HwFenceArea" useGeneratedKeys="true" keyProperty="fenceAreaId">
|
||||
insert into hw_fence_area
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="electronicFenceId != null">electronic_fence_id,</if>
|
||||
<if test="areaShapeFlag != null and areaShapeFlag != ''">area_shape_flag,</if>
|
||||
<if test="areaRange != null">area_range,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="electronicFenceId != null">#{electronicFenceId},</if>
|
||||
<if test="areaShapeFlag != null and areaShapeFlag != ''">#{areaShapeFlag},</if>
|
||||
<if test="areaRange != null">#{areaRange},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateHwFenceArea" parameterType="HwFenceArea">
|
||||
update hw_fence_area
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="electronicFenceId != null">electronic_fence_id = #{electronicFenceId},</if>
|
||||
<if test="areaShapeFlag != null and areaShapeFlag != ''">area_shape_flag = #{areaShapeFlag},</if>
|
||||
<if test="areaRange != null">area_range = #{areaRange},</if>
|
||||
</trim>
|
||||
where fence_area_id = #{fenceAreaId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteHwFenceAreaByFenceAreaId" parameterType="Long">
|
||||
delete from hw_fence_area where fence_area_id = #{fenceAreaId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteHwFenceAreaByFenceAreaIds" parameterType="String">
|
||||
delete from hw_fence_area where fence_area_id in
|
||||
<foreach item="fenceAreaId" collection="array" open="(" separator="," close=")">
|
||||
#{fenceAreaId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue