change - 温度阵列阈值设置、报警

master
yinq 1 year ago
parent 4c0e49fb13
commit 2e0fb5d4d4

@ -62,6 +62,12 @@ public class TSetmonitorthresholdvalueController extends BaseController
case 16:
url = "/SetMonitorThresholdValueTemp";
break;
case 20:
url = "/SetMonitorThresholdValueVibration";//振动
break;
case 30:
url = "/SetMonitorThresholdValueArray";//温度阵列
break;
}
return prefix + url;
}
@ -149,6 +155,12 @@ public class TSetmonitorthresholdvalueController extends BaseController
case 16:
url ="/Tempedit";
break;
case 20:
url ="/VibrationEdit";
break;
case 30:
url ="/ArrayEdit";
break;
}
return prefix + url;
}
@ -156,7 +168,7 @@ public class TSetmonitorthresholdvalueController extends BaseController
/**
*
*/
@RequiresPermissions("system:SetMonitorThresholdValue:edit")
// @RequiresPermissions("system:SetMonitorThresholdValue:edit")
@Log(title = "仪阈值设置信息", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody

@ -135,7 +135,7 @@
title: '异常数据'
},
{
field: 'alarmIdea',
field: 'cause',
title: '专家意见'
}]
};

@ -208,7 +208,7 @@
$('.centerDiv' + index).css({'display': 'inline-block'})
let getColorByTemperature = {}
$('#temInfo' + index).html(`<span style="color:#ff0000">最高温度:${e.data?.[index - 1]?.maxTemperature || ''}℃</span> <span style="color:#0b05f7">最低温度:${e.data?.[index - 1]?.minTemperature || ''}℃</span> <span style="color:#0066e4">平均温度:${e.data?.[index - 1]?.avgTemperature || ''}℃</span>`)
$('#timeInfo' + index).html(`<span style="color:#0b05f7">名称:${e.data?.[index - 1]?.monitorName || ''} 采集时间:${e.data?.[index - 1]?.collectTime || ''}</span> `)
$('#timeInfo' + index).html(`<span style="color:#0b05f7">名称:${e.data?.[index - 1]?.monitorName || ''} </br> 采集时间:${e.data?.[index - 1]?.collectTime || ''}</span> `)
let colors = []
let tems = []
for (i in e.data[index - 1]) {

@ -0,0 +1,191 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改温度阵列阈值设置信息')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-SetMonitorThresholdValue-edit" th:object="${tSetmonitorthresholdvalue}">
<input name="objId" th:field="*{objId}" type="hidden">
<input name="monitorType" th:field="*{monitorType}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">测控点编号:</label>
<div class="col-sm-8">
<input name="monitorId" th:field="*{monitorId}" class="form-control" type="text" readonly="true">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">测控点名称:</label>
<div class="col-sm-8">
<input name="monitorId" th:field="*{monitorName}" class="form-control" type="text" readonly="true">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">温度最大值:</label>
<div class="col-sm-8">
<input name="temperatureMax" th:field="*{temperatureMax}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">温度过高意见:</label>
<div class="col-sm-8">
<input name="tMaxIdea" th:field="*{tMaxIdea}" class="form-control" type="text">
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">温度最小值:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="temperatureMin" th:field="*{temperatureMin}" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">温度过低意见:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="tMinIdea" th:field="*{tMinIdea}" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">湿度最大值:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="humidityMax" th:field="*{humidityMax}" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">湿度过高意见:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="hMaxIdea" th:field="*{hMaxIdea}" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">湿度最小值:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="humidityMin" th:field="*{humidityMin}" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">湿度过低意见:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="hMinIdea" th:field="*{hMinIdea}" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">照度最大值:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="illuminanceMax" th:field="*{illuminanceMax}" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">照度过高意见:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="iMaxIdea" th:field="*{iMaxIdea}" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">照度最小值:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="illuminanceMin" th:field="*{illuminanceMin}" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="col-sm-3 control-label">照度过低意见:</label>-->
<!-- <div class="col-sm-8">-->
<!-- <input name="iMinIdea" th:field="*{iMinIdea}" class="form-control" type="text">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="col-sm-3 control-label">是否启用:</label>
<div class="col-sm-8">
<select name="deleted" class="form-control m-b" th:with="type=${@dict.getType('isKey')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{deleted}"></option>
</select>
</div>
</div>
<!--<div class="form-group">
<label class="col-sm-3 control-label">A相电流最大值</label>
<div class="col-sm-8">
<input name="iAMax" th:field="*{iAMax}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">A相电流最小值</label>
<div class="col-sm-8">
<input name="iAMin" th:field="*{iAMin}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">B相电流最大值</label>
<div class="col-sm-8">
<input name="iBMax" th:field="*{iBMax}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">B相电流最小值</label>
<div class="col-sm-8">
<input name="iBMin" th:field="*{iBMin}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">C相电流最大值</label>
<div class="col-sm-8">
<input name="iCMax" th:field="*{iCMax}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">C相电流最小值</label>
<div class="col-sm-8">
<input name="iCMin" th:field="*{iCMin}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">A相电压最大值</label>
<div class="col-sm-8">
<input name="vAMax" th:field="*{vAMax}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">A相电压最小值</label>
<div class="col-sm-8">
<input name="vAMin" th:field="*{vAMin}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">B相电压最大值</label>
<div class="col-sm-8">
<input name="vBMax" th:field="*{vBMax}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">B相电压最小值</label>
<div class="col-sm-8">
<input name="vBMin" th:field="*{vBMin}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">C相电压最大值</label>
<div class="col-sm-8">
<input name="vCMax" th:field="*{vCMax}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">C相电压最小值</label>
<div class="col-sm-8">
<input name="vCMin" th:field="*{vCMin}" class="form-control" type="text">
</div>
</div>-->
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/SetMonitorThresholdValue";
$("#form-SetMonitorThresholdValue-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-SetMonitorThresholdValue-edit').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,300 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('温度阵列阈值设置')" />
<th:block th:include="include :: layout-latest-css" />
<th:block th:include="include :: ztree-css" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="gray-bg">
<div class="ui-layout-west">
<div class="box box-main">
<div class="box-header">
<div class="box-title">
<i class="fa icon-grid"></i> 测控点信息
</div>
<div class="box-tools pull-right">
<a type="button" class="btn btn-box-tool" href="#" onclick="dept()" title="测控点信息"><i class="fa fa-edit"></i></a>
<button type="button" class="btn btn-box-tool" id="btnExpand" title="展开" style="display:none;"><i class="fa fa-chevron-up"></i></button>
<button type="button" class="btn btn-box-tool" id="btnCollapse" title="折叠"><i class="fa fa-chevron-down"></i></button>
<button type="button" class="btn btn-box-tool" id="btnRefresh" title="刷新"><i class="fa fa-refresh"></i></button>
</div>
<!--<div class="select-list">
<ul>
<li>
能源类型:
<select id="monitorType" style="width: 50%; height: 20px" th:with="type=${@energyTypeService.getEnergyType()}">
&lt;!&ndash;<option value="">所有</option>&ndash;&gt;
<option th:each="dict : ${type}" th:text="${dict.energyName}" th:value="${dict.energyTypeId}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded" onclick="queryDeptTree()" style="width: 60px;height: 23px;padding: 1px 7px"><i class="fa fa-search" ></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded" style="width: 60px;height: 23px;padding: 1px 7px"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>-->
</div>
<div class="ui-layout-content">
<div id="tree" class="ztree"></div>
</div>
</div>
</div>
<div class="ui-layout-center">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<input type="text" id="monitorType" name="monitorType" hidden="true"/>
<input type="text" id="monitorId" name="monitorId" hidden="true"/>
<div class="select-list">
<ul>
<li>
<label>是否启用:</label>
<select name="deleted" th:with="type=${@dict.getType('isKey')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:SetMonitorThresholdValue:add">
<i class="fa fa-plus"></i> 添加
</a>-->
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:SetMonitorThresholdValue:edit">
<i class="fa fa-edit"></i> 修改
</a>
<!--<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:SetMonitorThresholdValue:remove">
<i class="fa fa-remove"></i> 删除
</a>-->
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:SetMonitorThresholdValue:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: layout-latest-js" />
<th:block th:include="include :: ztree-js" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:SetMonitorThresholdValue:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:SetMonitorThresholdValue:remove')}]];
var deletedDatas = [[${@dict.getType('isKey')}]];
var prefix = ctx + "system/SetMonitorThresholdValue";
$("#monitorType").val(30);
$(function() {
var panehHidden = false;
if ($(this).width() < 769) {
panehHidden = true;
}
$('body').layout({ initClosed: panehHidden, west__size: 245 });
queryUserList();
queryDeptTree();
});
function queryUserList() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "仪阈值设置信息",
columns: [{
checkbox: true
},
{
field: 'objId',
title: '标识',
visible: false
},
{
field: 'monitorId',
title: '测控点编号',
visible: false
},
{
field: 'monitorName',
title: '测控点名称',
width: '180'
},
{
field: 'monitorType',
title: '类型',
visible: false
},
{
field: 'temperatureMax',
title: '温度最大值'
},
{
field: 'temperatureMin',
title: '温度最小值',
visible: false
},
{
field: 'tMaxIdea',
title: '温度过高意见'
},
{
field: 'humidityMax',
title: '湿度最大值',
visible: false
},
{
field: 'humidityMin',
title: '湿度最小值',
visible: false
},
{
field: 'illuminanceMax',
title: '照度最大值',
visible: false
},
{
field: 'illuminanceMin',
title: '照度最小值',
visible: false
},
/*{
field: 'iAMax',
title: 'A相电流最大值'
},
{
field: 'iAMin',
title: 'A相电流最小值'
},
{
field: 'iBMax',
title: 'B相电流最大值'
},
{
field: 'iBMin',
title: 'B相电流最小值'
},
{
field: 'iCMax',
title: 'C相电流最大值'
},
{
field: 'iCMin',
title: 'C相电流最小值'
},
{
field: 'vAMax',
title: 'A相电压最大值'
},
{
field: 'vAMin',
title: 'A相电压最小值'
},
{
field: 'vBMax',
title: 'B相电压最大值'
},
{
field: 'vBMin',
title: 'B相电压最小值'
},
{
field: 'vCMax',
title: 'C相电压最大值'
},
{
field: 'vCMin',
title: 'C相电压最小值'
},*/
{
field: 'deleted',
title: '是否启用',
formatter: function(value, row, index) {
return $.table.selectDictLabel(deletedDatas, value);
}
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.objId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.objId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
}
function queryDeptTree()
{
var url = ctx + "system/Monitor/treeData?monitorType=30";
var options = {
url: url,
expandLevel: 1,
onClick : zOnClick
};
$.tree.init(options);
function zOnClick(event, treeId, treeNode) {
$("#monitorId").val(treeNode.id);
//alert(treeNode.level);
$.table.search();
}
}
$('#btnExpand').click(function() {
$._tree.expandAll(true);
$(this).hide();
$('#btnCollapse').show();
});
$('#btnCollapse').click(function() {
$._tree.expandAll(false);
$(this).hide();
$('#btnExpand').show();
});
$('#btnRefresh').click(function() {
queryDeptTree();
});
/* 测控点信息 */
function dept() {
var url = ctx + "system/Monitor?id=30";
$.modal.openTab("测控点信息", url);
}
<!-- laydate示例 -->
layui.use('laydate', function(){
var laydate = layui.laydate;
laydate.render({
elem: '#laydate-demo-3',
type: 'datetime',
trigger: 'click'
});
laydate.render({
elem: '#laydate-demo-4',
type: 'datetime',
trigger: 'click'
});
});
</script>
</body>
</html>

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('仪阈值设置信息列表')" />
<th:block th:include="include :: header('物联环境阈值设置')" />
<th:block th:include="include :: layout-latest-css" />
<th:block th:include="include :: ztree-css" />
<th:block th:include="include :: datetimepicker-css" />

@ -1,49 +1,94 @@
package com.ruoyi.quartz.task;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.TArraytemperaturedata;
import com.ruoyi.system.domain.T_Alarm_Data;
import com.ruoyi.system.domain.dto.T_Alarm_DataDTO;
import com.ruoyi.system.mapper.TArraytemperaturedataMapper;
import com.ruoyi.system.mapper.T_Alarm_DataMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.ruoyi.common.utils.StringUtils;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
/**
*
*
*
* @author ruoyi
*/
@Component("ryTask")
public class RyTask
{
public class RyTask {
@Autowired
private TArraytemperaturedataMapper tArraytemperaturedataMapper;
public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i)
{
@Autowired
private T_Alarm_DataMapper tAlarmDataMapper;
public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
}
public void ryParams(String params)
{
public void ryParams(String params) {
System.out.println("执行有参方法:" + params);
}
public void ryNoParams()
{
public void ryNoParams() {
System.out.println("执行无参方法");
}
/**
*
*
* @param days
*/
public void deleteArrayDataTask(Integer days){
public void deleteArrayDataTask(Integer days) {
days = -days;
System.out.printf("deleteArrayDataTask: %s!", days);
tArraytemperaturedataMapper.deleteTArraytemperaturedataBycollectTime(days);
}
/**
*
*/
public void ArrayTemperatureSensorAlarm() {
String nowTime = DateUtils.getTime();
String beginTime = LocalDateTime
.parse(nowTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
.plusMinutes(-1) // 加一分钟
.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
TArraytemperaturedata selectData = new TArraytemperaturedata();
HashMap<String, Object> selectMap = new HashMap<>();
selectMap.put("beginTime", beginTime);
selectMap.put("endTime", nowTime);
selectData.setParams(selectMap);
List<TArraytemperaturedata> dataList = tArraytemperaturedataMapper.selectArrayTemperatureSensorAlarmList(selectData);
T_Alarm_Data alarmData = new T_Alarm_Data();
alarmData.setAlarmStatus(1); //0-已处理 1-未处理
List<T_Alarm_DataDTO> dataDTOList = tAlarmDataMapper.selectT_Alarm_DataList(alarmData);
List<String> alarmList = dataDTOList.stream().map(T_Alarm_DataDTO::getMonitorId).collect(Collectors.toList());
for (TArraytemperaturedata data : dataList) {
if (alarmList.contains(data.getMonitorId())){
continue;
}
if (data.getMaxTemperature().compareTo(data.getTemperatureMax()) > 0){
T_Alarm_Data insertData = new T_Alarm_Data();
insertData.setMonitorId(data.getMonitorId());
insertData.setCollectTime(DateUtils.getNowDate());
insertData.setAlarmType(0);//0-过高报警 1-过低报警
insertData.setMonitorType(30);
insertData.setAlarmStatus(1);
insertData.setAlarmData(data.getMaxTemperature());
insertData.setCause(data.gettMaxIdea());
tAlarmDataMapper.insertT_Alarm_Data(insertData);
}
}
}
}

@ -4680,6 +4680,26 @@ public class TArraytemperaturedata extends BaseEntity {
private List<String> monitorList;
private BigDecimal temperatureMax;
private String tMaxIdea;
public String gettMaxIdea() {
return tMaxIdea;
}
public void settMaxIdea(String tMaxIdea) {
this.tMaxIdea = tMaxIdea;
}
public BigDecimal getTemperatureMax() {
return temperatureMax;
}
public void setTemperatureMax(BigDecimal temperatureMax) {
this.temperatureMax = temperatureMax;
}
public List<String> getMonitorList() {
return monitorList;
}

@ -121,7 +121,17 @@ public class TSetmonitorthresholdvalue extends BaseEntity
private String iMinIdea;
public void setObjId(Long objId)
private String monitorName;
public String getMonitorName() {
return monitorName;
}
public void setMonitorName(String monitorName) {
this.monitorName = monitorName;
}
public void setObjId(Long objId)
{
this.objId = objId;
}

@ -75,4 +75,11 @@ public interface TArraytemperaturedataMapper
List<HashMap<String, Object>> getHighestPointTemperature(TArraytemperaturedata tArraytemperaturedata);
public int deleteTArraytemperaturedataBycollectTime(Integer days);
/**
*
* @param selectData
* @return
*/
List<TArraytemperaturedata> selectArrayTemperatureSensorAlarmList(TArraytemperaturedata selectData);
}

@ -782,6 +782,8 @@
<result property="Site766" column="Site766"/>
<result property="Site767" column="Site767"/>
<result property="Site768" column="Site768"/>
<result property="temperatureMax" column="temperatureMax"/>
<result property="tMaxIdea" column="tMaxIdea"/>
</resultMap>
<sql id="selectTArraytemperaturedataVo">
@ -1577,6 +1579,9 @@
<if test="avgTemperature != null ">and t.avgTemperature = #{avgTemperature}</if>
<if test="collectTime != null ">and t.collectTime = #{collectTime}</if>
<if test="recodeTime != null ">and t.recodeTime = #{recodeTime}</if>
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
and t.collectTime between #{params.beginTime} and #{params.endTime}
</if>
</where>
</select>
@ -3978,6 +3983,21 @@
order by monitorId, collectTime
</select>
<select id="selectArrayTemperatureSensorAlarmList" parameterType="TArraytemperaturedata"
resultMap="TArraytemperaturedataResult">
select ta.monitorId, ta.collectTime, ta.maxTemperature, ta.minTemperature, ta.recodeTime, st.temperatureMax,st.tMaxIdea
from T_ArrayTemperatureData ta
left join T_Monitor m on ta.monitorId = m.monitorId
left join T_SetMonitorThresholdValue st on st.monitorId = m.monitorId
<where>
temperatureMax is not null
<if test="monitorId != null and monitorId != ''">and monitorId = #{monitorId}</if>
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
and ta.collectTime between #{params.beginTime} and #{params.endTime}
</if>
</where>
</select>
<!-- SELECT monitorId, collectTime, MAX(SiteValue) AS tempreture
FROM (
SELECT monitorId, collectTime, SiteValue

@ -1,112 +1,149 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.TSetmonitorthresholdvalueMapper">
<resultMap type="TSetmonitorthresholdvalue" id="TSetmonitorthresholdvalueResult">
<result property="objId" column="objId" />
<result property="monitorId" column="monitorId" />
<result property="monitorType" column="monitorType" />
<result property="temperatureMax" column="temperatureMax" />
<result property="temperatureMin" column="temperatureMin" />
<result property="humidityMax" column="humidityMax" />
<result property="humidityMin" column="humidityMin" />
<result property="illuminanceMax" column="illuminanceMax" />
<result property="illuminanceMin" column="illuminanceMin" />
<result property="iAMax" column="iAMax" />
<result property="iAMin" column="iAMin" />
<result property="iBMax" column="iBMax" />
<result property="iBMin" column="iBMin" />
<result property="iCMax" column="iCMax" />
<result property="iCMin" column="iCMin" />
<result property="vAMax" column="vAMax" />
<result property="vAMin" column="vAMin" />
<result property="vBMax" column="vBMax" />
<result property="vBMin" column="vBMin" />
<result property="vCMax" column="vCMax" />
<result property="vCMin" column="vCMin" />
<result property="tMaxIdea" column="tMaxIdea" />
<result property="tMinIdea" column="tMinIdea" />
<result property="hMaxIdea" column="hMaxIdea" />
<result property="hMinIdea" column="hMinIdea" />
<result property="iMaxIdea" column="iMaxIdea" />
<result property="iMinIdea" column="iMinIdea" />
<result property="objId" column="objId"/>
<result property="monitorId" column="monitorId"/>
<result property="monitorType" column="monitorType"/>
<result property="temperatureMax" column="temperatureMax"/>
<result property="temperatureMin" column="temperatureMin"/>
<result property="humidityMax" column="humidityMax"/>
<result property="humidityMin" column="humidityMin"/>
<result property="illuminanceMax" column="illuminanceMax"/>
<result property="illuminanceMin" column="illuminanceMin"/>
<result property="iAMax" column="iAMax"/>
<result property="iAMin" column="iAMin"/>
<result property="iBMax" column="iBMax"/>
<result property="iBMin" column="iBMin"/>
<result property="iCMax" column="iCMax"/>
<result property="iCMin" column="iCMin"/>
<result property="vAMax" column="vAMax"/>
<result property="vAMin" column="vAMin"/>
<result property="vBMax" column="vBMax"/>
<result property="vBMin" column="vBMin"/>
<result property="vCMax" column="vCMax"/>
<result property="vCMin" column="vCMin"/>
<result property="tMaxIdea" column="tMaxIdea"/>
<result property="tMinIdea" column="tMinIdea"/>
<result property="hMaxIdea" column="hMaxIdea"/>
<result property="hMinIdea" column="hMinIdea"/>
<result property="iMaxIdea" column="iMaxIdea"/>
<result property="iMinIdea" column="iMinIdea"/>
<result property="deleted" column="deleted"/>
<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="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<resultMap type="TSetmonitorthresholdvalueDTO" id="TSetmonitorthresholdvalueDTOResult">
<result property="objId" column="objId" />
<result property="monitorId" column="monitorId" />
<result property="monitorName" column="monitorName" />
<result property="monitorType" column="monitorType" />
<result property="p_monitor" column="p_monitor" />
<result property="temperatureMax" column="temperatureMax" />
<result property="temperatureMin" column="temperatureMin" />
<result property="humidityMax" column="humidityMax" />
<result property="humidityMin" column="humidityMin" />
<result property="illuminanceMax" column="illuminanceMax" />
<result property="illuminanceMin" column="illuminanceMin" />
<result property="iAMax" column="iAMax" />
<result property="iAMin" column="iAMin" />
<result property="iBMax" column="iBMax" />
<result property="iBMin" column="iBMin" />
<result property="iCMax" column="iCMax" />
<result property="iCMin" column="iCMin" />
<result property="vAMax" column="vAMax" />
<result property="vAMin" column="vAMin" />
<result property="vBMax" column="vBMax" />
<result property="vBMin" column="vBMin" />
<result property="vCMax" column="vCMax" />
<result property="vCMin" column="vCMin" />
<result property="tMaxIdea" column="tMaxIdea" />
<result property="tMinIdea" column="tMinIdea" />
<result property="hMaxIdea" column="hMaxIdea" />
<result property="hMinIdea" column="hMinIdea" />
<result property="iMaxIdea" column="iMaxIdea" />
<result property="iMinIdea" column="iMinIdea" />
<result property="objId" column="objId"/>
<result property="monitorId" column="monitorId"/>
<result property="monitorName" column="monitorName"/>
<result property="monitorType" column="monitorType"/>
<result property="p_monitor" column="p_monitor"/>
<result property="temperatureMax" column="temperatureMax"/>
<result property="temperatureMin" column="temperatureMin"/>
<result property="humidityMax" column="humidityMax"/>
<result property="humidityMin" column="humidityMin"/>
<result property="illuminanceMax" column="illuminanceMax"/>
<result property="illuminanceMin" column="illuminanceMin"/>
<result property="iAMax" column="iAMax"/>
<result property="iAMin" column="iAMin"/>
<result property="iBMax" column="iBMax"/>
<result property="iBMin" column="iBMin"/>
<result property="iCMax" column="iCMax"/>
<result property="iCMin" column="iCMin"/>
<result property="vAMax" column="vAMax"/>
<result property="vAMin" column="vAMin"/>
<result property="vBMax" column="vBMax"/>
<result property="vBMin" column="vBMin"/>
<result property="vCMax" column="vCMax"/>
<result property="vCMin" column="vCMin"/>
<result property="tMaxIdea" column="tMaxIdea"/>
<result property="tMinIdea" column="tMinIdea"/>
<result property="hMaxIdea" column="hMaxIdea"/>
<result property="hMinIdea" column="hMinIdea"/>
<result property="iMaxIdea" column="iMaxIdea"/>
<result property="iMinIdea" column="iMinIdea"/>
<result property="deleted" column="deleted"/>
<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="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="monitorName" column="monitorName"/>
</resultMap>
<sql id="selectTSetmonitorthresholdvalueVo">
select objId, monitorId, monitorType,temperatureMax, temperatureMin, humidityMax, humidityMin, illuminanceMax, illuminanceMin, iAMax, iAMin, iBMax, iBMin, iCMax, iCMin, vAMax, vAMin, vBMax, vBMin, vCMax, vCMin, create_by, create_time, update_by, update_time,deleted
,tMaxIdea,tMinIdea,hMaxIdea,hMinIdea,iMaxIdea,iMinIdea from T_SetMonitorThresholdValue
select stv.objId,
stv.monitorId,
stv.monitorType,
stv.temperatureMax,
stv.temperatureMin,
stv.humidityMax,
stv.humidityMin,
stv.illuminanceMax,
stv.illuminanceMin,
stv.iAMax,
stv.iAMin,
stv.iBMax,
stv.iBMin,
stv.iCMax,
stv.iCMin,
stv.vAMax,
stv.vAMin,
stv.vBMax,
stv.vBMin,
stv.vCMax,
stv.vCMin,
stv.create_by,
stv.create_time,
stv.update_by,
stv.update_time,
stv.deleted,
stv.tMaxIdea,
stv.tMinIdea,
stv.hMaxIdea,
stv.hMinIdea,
stv.iMaxIdea,
stv.iMinIdea,
t1.monitorName
from T_SetMonitorThresholdValue stv
left join T_Monitor t1 on t1.monitorId = stv.monitorId
</sql>
<sql id="selectTSetmonitorthresholdvalueDTOVo">
select t2.*,t1.p_monitorId,t1.monitorName from T_Monitor t1
left join T_SetMonitorThresholdValue t2 on t1.monitorId = t2.monitorId
select t2.*, t1.p_monitorId, t1.monitorName
from T_Monitor t1
left join T_SetMonitorThresholdValue t2 on t1.monitorId = t2.monitorId
</sql>
<select id="selectTSetmonitorthresholdvalueList" parameterType="TSetmonitorthresholdvalue" resultMap="TSetmonitorthresholdvalueResult">
<select id="selectTSetmonitorthresholdvalueList" parameterType="TSetmonitorthresholdvalue"
resultMap="TSetmonitorthresholdvalueResult">
<include refid="selectTSetmonitorthresholdvalueVo"/>
<where>
<if test="monitorId != null and monitorId != ''"> and monitorId = #{monitorId}</if>
<if test="monitorId != null and monitorId != ''">and stv.monitorId = #{monitorId}</if>
</where>
</select>
<select id="selectTSetmonitorthresholdvalueDTOList" parameterType="TSetmonitorthresholdvalueDTO" resultMap="TSetmonitorthresholdvalueDTOResult">
<select id="selectTSetmonitorthresholdvalueDTOList" parameterType="TSetmonitorthresholdvalueDTO"
resultMap="TSetmonitorthresholdvalueDTOResult">
<include refid="selectTSetmonitorthresholdvalueDTOVo"/>
<where>
<if test="monitorId != null and monitorId != ''"> and t1.monitorId = #{monitorId}</if>
<if test="p_monitor != null and p_monitor != ''"> and t1.p_monitorId = #{p_monitor}</if>
<if test="monitorType != null and monitorType != ''"> and t2.monitorType = #{monitorType}</if>
<if test="deleted != null and deleted != ''"> and t2.deleted = #{deleted}</if>
<if test="monitorId != null and monitorId != ''">and t1.monitorId = #{monitorId}</if>
<if test="p_monitor != null and p_monitor != ''">and (t1.monitorId = #{p_monitor} or t1.p_monitorId = #{p_monitor})</if>
<if test="monitorType != null and monitorType != ''">and t2.monitorType = #{monitorType}</if>
<if test="deleted != null and deleted != ''">and t2.deleted = #{deleted}</if>
</where>
</select>
<select id="selectTSetmonitorthresholdvalueById" parameterType="Long" resultMap="TSetmonitorthresholdvalueResult">
<include refid="selectTSetmonitorthresholdvalueVo"/>
where objId = #{objId}
where stv.objId = #{objId}
</select>
<insert id="insertTSetmonitorthresholdvalue" parameterType="TSetmonitorthresholdvalue">
@ -144,7 +181,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objId != null">#{objId},</if>
<if test="monitorId != null">#{monitorId},</if>
@ -178,7 +215,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</trim>
</insert>
<update id="updateTSetmonitorthresholdvalue" parameterType="TSetmonitorthresholdvalue">
@ -219,7 +256,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteTSetmonitorthresholdvalueById" parameterType="Long">
delete from T_SetMonitorThresholdValue where objId = #{objId}
delete
from T_SetMonitorThresholdValue
where objId = #{objId}
</delete>
<delete id="deleteTSetmonitorthresholdvalueByIds" parameterType="String">

@ -89,7 +89,7 @@ group by a.unitName,a.unitId
<select id="selectAlarmPromptDataList" parameterType="AlarmPromptDTO" resultMap="AlarmPromptDTOResult">
select t5.monitorName,
t5.monitorId,
t4.monitorId,
t5.monitorAddr,
t4.alarmData,
t4.collectTime,
@ -122,6 +122,7 @@ group by a.unitName,a.unitId
<if test="monitorType != null">monitorType,</if>
<if test="alarmStatus != null">alarmStatus,</if>
<if test="alarmData != null">alarmData,</if>
<if test="cause != null">cause,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objId != null">#{objId},</if>
@ -131,6 +132,7 @@ group by a.unitName,a.unitId
<if test="monitorType != null">#{monitorType},</if>
<if test="alarmStatus != null">#{alarmStatus},</if>
<if test="alarmData != null">#{alarmData},</if>
<if test="cause != null">#{cause},</if>
</trim>
</insert>

Loading…
Cancel
Save