From 84537fa3adc27d454c8cfcba453bdc2ed213a353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E9=9B=AA=E4=BC=9F?= Date: Wed, 11 Sep 2024 11:12:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=91=E6=B5=8B=E5=B9=B3=E5=8F=B0=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E9=A1=B5=E9=9D=A2=E6=8E=A5=E5=8F=A3=E7=9A=84sql?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=92=8C=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/business/HwAlarmInfoMapper.xml | 25 +++ .../mapper/business/HwDeviceMapper.xml | 2 +- .../mapper/business/HwFenceTargetMapper.xml | 6 + .../business/HwMonitorUnitAttributeDao.xml | 193 ++++++++++++++++++ .../mapper/business/HwMonitorUnitMapper.xml | 7 +- 5 files changed, 231 insertions(+), 2 deletions(-) create mode 100644 ruoyi-modules/hw-business/src/main/resources/mapper/business/HwMonitorUnitAttributeDao.xml diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwAlarmInfoMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwAlarmInfoMapper.xml index a1bb1c2..1137e9d 100644 --- a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwAlarmInfoMapper.xml +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwAlarmInfoMapper.xml @@ -175,6 +175,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + update hw_alarm_info @@ -247,6 +249,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join hw_monitor_unit_type hmut on hmu.monitor_unit_type_id = hmut.monitor_unit_type_id where hai.alarm_time between #{startTime} and #{endTime} + + update hw_alarm_info diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceMapper.xml index a1f7f2d..d237899 100644 --- a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceMapper.xml +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwDeviceMapper.xml @@ -446,7 +446,7 @@ select a.device_mode_name,sum(a.sum) sum from (select + select + attribute_id, monitor_unit_id, attribute_name, attribute_value, create_by, create_time, update_by, update_time + from hw_monitor_unit_attribute + where attribute_id = #{attributeId} + + + + + + + + + + + + + insert into hw_monitor_unit_attribute(monitor_unit_id, attribute_name, attribute_value, create_by, create_time, update_by, update_time) + values (#{monitorUnitId}, #{attributeName}, #{attributeValue}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}) + + + + insert into hw_monitor_unit_attribute(monitor_unit_id, attribute_name, attribute_value, create_by, create_time, update_by, update_time) + values + + (#{entity.monitorUnitId}, #{entity.attributeName}, #{entity.attributeValue}, #{entity.createBy}, #{entity.createTime}, #{entity.updateBy}, #{entity.updateTime}) + + + + + insert into hw_monitor_unit_attribute(monitor_unit_id, attribute_name, attribute_value, create_by, create_time, update_by, update_time) + values + + (#{entity.monitorUnitId}, #{entity.attributeName}, #{entity.attributeValue}, #{entity.createBy}, #{entity.createTime}, #{entity.updateBy}, #{entity.updateTime}) + + on duplicate key update + monitor_unit_id = values(monitor_unit_id), + attribute_name = values(attribute_name), + attribute_value = values(attribute_value), + create_by = values(create_by), + create_time = values(create_time), + update_by = values(update_by), + update_time = values(update_time) + + + + + update hw_monitor_unit_attribute + + + monitor_unit_id = #{monitorUnitId}, + + + attribute_name = #{attributeName}, + + + attribute_value = #{attributeValue}, + + + create_by = #{createBy}, + + + create_time = #{createTime}, + + + update_by = #{updateBy}, + + + update_time = #{updateTime}, + + + where attribute_id = #{attributeId} + + + update hw_monitor_unit_attribute + + + monitor_unit_id = #{monitorUnitId}, + + + attribute_name = #{attributeName}, + + + attribute_value = #{attributeValue}, + + + create_by = #{createBy}, + + + create_time = #{createTime}, + + + update_by = #{updateBy}, + + + update_time = #{updateTime}, + + + where attribute_id = #{attributeId} + + + + + delete from hw_monitor_unit_attribute where attribute_id = #{attributeId} + + + delete from hw_monitor_unit_attribute where attribute_id = #{attributeId} + + + + diff --git a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwMonitorUnitMapper.xml b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwMonitorUnitMapper.xml index ef81f04..713f9ea 100644 --- a/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwMonitorUnitMapper.xml +++ b/ruoyi-modules/hw-business/src/main/resources/mapper/business/HwMonitorUnitMapper.xml @@ -239,6 +239,11 @@ #{monitorUnitField}, + + update hw_monitor_unit + set attribute = #{attribute} + where monitor_unit_id = #{monitorUnitId} + update hw_monitor_unit @@ -347,7 +352,7 @@ select * from hw_monitor_unit and monitor_unit_status !=9 - and area_id is not null +-- and area_id is not null and tenant_id=#{tenantId}