监测平台系统bug优化处理

breach-zhy
马雪伟 3 months ago
parent 69d73d1afc
commit 8e141b9607

@ -138,14 +138,17 @@ public class HwAlarmRuleController extends BaseController {
alarmLevel.setSceneId(sceneId);
List<HwAlarmLevel> alarmLevels = hwAlarmLevelService.selectHwAlarmLevelList(alarmLevel);
HwDevice device = new HwDevice();
device.setSceneId(sceneId);
List<HwDevice> devices = hwDeviceService.selectHwDeviceListWithDeviceMode(device);
// HwDevice device = new HwDevice();
// device.setSceneId(sceneId);
// List<HwDevice> devices = hwDeviceService.selectHwDeviceListWithDeviceMode(device);
List<HwDeviceMode> models = hwDeviceModeService.selectModel(sceneId);
JSONObject result = new JSONObject();
result.put("alarmTypes", alarmTypes);
result.put("alarmLevels",alarmLevels);
result.put("devices",devices);
// result.put("devices",devices);
result.put("models",models);
return success(result);
}

@ -246,5 +246,9 @@ public class HwDeviceController extends BaseController {
public void computeOnlineDevicecCount(@PathVariable("days") int days) {
hwDeviceService.computeOnlineDevicecCount(days);
}
@GetMapping("/getDeviceByModel")
public AjaxResult getDeviceByModel(Long modelId){
return AjaxResult.success(hwDeviceModeService.getDeviceByModel(modelId));
}
}

@ -147,4 +147,6 @@ public class HwDeviceModeController extends BaseController {
public void rebuildTdSuperTables() {
hwDeviceModeService.rebuildTdSuperTables();
}
}

@ -0,0 +1,25 @@
package com.ruoyi.business.controller;
import com.ruoyi.business.domain.HwOfflineRule;
import com.ruoyi.business.service.HwOfflineRuleService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/offlineRule")
public class HwOfflineRuleController extends BaseController {
@Autowired
private HwOfflineRuleService hwOfflineRuleService;
@GetMapping("list")
public TableDataInfo list(HwOfflineRule hwOfflineRule){
startPage();
List<HwOfflineRule> hwOfflineRules = hwOfflineRuleService.selectRuleList(hwOfflineRule);
return getDataTable(hwOfflineRules);
}
}

@ -170,4 +170,6 @@ public interface HwDeviceMapper
* id
* */
Long selectDeviceIfAlarm(Long deviceId);
List<HwDevice> getDeviceByModel(Long modelId);
}

@ -143,4 +143,6 @@ public interface HwDeviceModeMapper
* @return
*/
public List<HwDeviceMode> selectHwDeviceModeJoinList(HwDeviceMode hwDeviceMode);
List<HwDeviceMode> selectModel(Long sceneId);
}

@ -0,0 +1,12 @@
package com.ruoyi.business.mapper;
import com.ruoyi.business.domain.HwOfflineRule;
import java.util.List;
public interface HwOfflineRuleMapper {
List<HwOfflineRule> selectHwOfflineRuleJoinList(HwOfflineRule hwOfflineRule);
}

@ -0,0 +1,9 @@
package com.ruoyi.business.service;
import com.ruoyi.business.domain.HwOfflineRule;
import java.util.List;
public interface HwOfflineRuleService {
List<HwOfflineRule> selectRuleList(HwOfflineRule hwOfflineRule);
}

@ -3,6 +3,7 @@ package com.ruoyi.business.service;
import java.util.List;
import java.util.Map;
import com.ruoyi.business.domain.HwDevice;
import com.ruoyi.business.domain.HwDeviceMode;
import com.ruoyi.business.domain.HwDeviceModeFunction;
import com.ruoyi.business.domain.HwDeviceModeParameter;
@ -134,4 +135,7 @@ public interface IHwDeviceModeService
*/
public HwDeviceMode selectHwDeviceModeByDeviceId(Long deviceId);
List<HwDeviceMode> selectModel(Long sceneId);
List<HwDevice> getDeviceByModel(Long modelId);
}

@ -433,6 +433,16 @@ public class HwDeviceModeServiceImpl implements IHwDeviceModeService {
return deviceMode;
}
@Override
public List<HwDeviceMode> selectModel(Long sceneId) {
return hwDeviceModeMapper.selectModel(sceneId);
}
@Override
public List<HwDevice> getDeviceByModel(Long modelId) {
return hwDeviceMapper.getDeviceByModel(modelId);
}
/**
* @param: hwDeviceModeFunction

@ -55,7 +55,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- <result property="areaStatus" column="area_status" />-->
<!-- <result property="orderNum" column="order_num" />-->
</resultMap>
<!--以下为监控平台接口所用-->
<resultMap id="DeviceModeVoResult" type="com.ruoyi.business.domain.VO.DeviceModeVo" >
<result property="deviceModeName" column="device_mode_name"/>
@ -63,9 +62,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="err" column="err"/>
</resultMap>
<select id="selectDeviceModeNameVo" resultMap="DeviceModeVoResult">
SELECT b.device_mode_name ,a.sum FROM hw_device_mode b
SELECT concat(c.scene_name,'',b.device_mode_name) as device_mode_name ,a.sum as sum FROM hw_device_mode b
LEFT JOIN (SELECT device_mode_id,count(*) as sum FROM hw_device GROUP BY device_mode_id order by sum desc
) a on a.device_mode_id = b.device_mode_id
) a on a.device_mode_id = b.device_mode_id left join hw_scene c on b.scene_id = c.scene_id
</select>
<select id="selectDeviceByDeviceModeByDeviceModeFunction" parameterType="Long" resultType="String">
@ -404,6 +403,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 租户数据范围过滤 -->
${params.tenantDataScope}
</select>
<select id="getOnlineDeviceNum1" resultType="java.lang.Integer" parameterType="java.lang.Long">
select count(1) from
(select
b.device_mode_name device_mode_name
from
hw_device hd left join hw_device_mode b on hd.device_mode_id = b.device_mode_id
where
hd.device_status = 1
and ((hd.device_type = 2
and exists (
select
1
from
hw_device hdd
where
hd.releated_device_id = hdd.device_id
and hdd.online_status = 1
and hdd.device_status = 1))
or (hd.device_type = 3
and hd.online_status = 1))
<if test="sceneId != null and sceneId!=0"> and hd.scene_id=#{sceneId}</if>) a where a.device_mode_name = '定位信标'
</select>
<select id="getDeviceByModel" resultType="com.ruoyi.business.domain.HwDevice"
parameterType="java.lang.Long">
select * from hw_device where device_mode_id = #{modelId}
</select>
<select id="selectDeviceList" resultMap="TreeDeviceVoResult">
select hd.device_id as vo_id ,hd.monitor_unit_id as parent_id ,hd.device_name as vo_name ,

@ -327,6 +327,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by hdm.device_mode_id desc
</select>
<select id="selectModel" parameterType="java.lang.Long">
select * from hw_device_mode where scene_id = #{sceneId}
</select>
</mapper>

@ -236,5 +236,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
order by hor.offline_rule_id desc
</select>
<select id="selectRuleList" resultType="com.ruoyi.business.domain.HwOfflineRule"
parameterType="com.ruoyi.business.domain.HwOfflineRule"></select>
</mapper>

@ -80,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectHwSceneList" parameterType="HwScene" resultMap="HwSceneResult">
<include refid="selectHwSceneVo"/>
<where>
scene_status != '9'
<if test="sceneName != null and sceneName != ''"> and scene_name like concat('%', #{sceneName}, '%')</if>
<if test="tenantId != null"> and tenant_id = #{tenantId}</if>
<if test="sceneModeId != null "> and scene_mode_id = #{sceneModeId}</if>

Loading…
Cancel
Save