Commit 3b628f8b authored by 耿迪迪's avatar 耿迪迪

企业数据监控 gengdidi

parent 7dbf6501
......@@ -152,4 +152,16 @@ public class TDetectorInfoController extends BaseController
return AjaxResult.success(map);
}
/**
* 获取探测器监控数据
* @param tDetectorInfo
* @return
*/
@GetMapping("/selectDetectorMointor")
public TableDataInfo selectDetectorMointor(TDetectorInfo tDetectorInfo){
startPage();
List<TDetectorInfo> list = tDetectorInfoService.selectDetectorMointor(tDetectorInfo);
return getDataTable(list);
}
}
......@@ -84,6 +84,28 @@ public class TDetectorInfo extends BaseEntity
@Excel(name = "备注")
private String remarks;
/**所属设备名称*/
private String beyondDevicename;
public String getBeyondDevicename() {
return beyondDevicename;
}
public void setBeyondDevicename(String beyondDevicename) {
this.beyondDevicename = beyondDevicename;
}
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
/**所属企业名称*/
private String enterpriseName;
public void setDetectorId(Long detectorId)
{
this.detectorId = detectorId;
......
......@@ -90,7 +90,27 @@ public class TDeviceReportData extends BaseEntity
@Excel(name = "备注")
private String remarks;
public void setDeviceReportDataId(Long deviceReportDataId)
private String beyondDeviceName;
private String deviceType;
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public String getBeyondDeviceName() {
return beyondDeviceName;
}
public void setBeyondDeviceName(String beyondDeviceName) {
this.beyondDeviceName = beyondDeviceName;
}
public void setDeviceReportDataId(Long deviceReportDataId)
{
this.deviceReportDataId = deviceReportDataId;
}
......
......@@ -79,4 +79,11 @@ public interface TDetectorInfoMapper
* @return
*/
public Map<String,Object> selectDetectorNum(@Param("enterpriseIds")String[] enterpriseIds);
/**
* 获取探测器监控数据
* @param tDetectorInfo
* @return
*/
List<TDetectorInfo> selectDetectorMointor(TDetectorInfo tDetectorInfo);
}
......@@ -86,4 +86,11 @@ public interface ITDetectorInfoService
* @return
*/
public Map<String,Object> selectDetectorNum(String enterpriseId);
/**
* 获取探测器监控数据
* @param tDetectorInfo
* @return
*/
List<TDetectorInfo> selectDetectorMointor(TDetectorInfo tDetectorInfo);
}
......@@ -156,4 +156,14 @@ public class TDetectorInfoServiceImpl implements ITDetectorInfoService
public Map<String,Object> selectDetectorNum(String enterpriseId){
return tDetectorInfoMapper.selectDetectorNum(enterpriseId.split(","));
}
/**
* 获取探测器监控数据
* @param tDetectorInfo
* @return
*/
@Override
public List<TDetectorInfo> selectDetectorMointor(TDetectorInfo tDetectorInfo){
return tDetectorInfoMapper.selectDetectorMointor(tDetectorInfo);
}
}
......@@ -24,6 +24,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="detectorStatus" column="detector_status" />
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
<result property="beyondDevicename" column="beyondDevicename" />
<result property="enterpriseName" column="enterprise_name" />
</resultMap>
<sql id="selectTDetectorInfoVo">
......@@ -262,4 +264,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
(SELECT COUNT(user_id) FROM t_detector_user WHERE is_del = 0) AS userNum
FROM t_detector_info WHERE is_del = 0
</select>
<select id="selectDetectorMointor" parameterType="TDetectorInfo" resultMap="TDetectorInfoResult">
SELECT
device.device_name AS beyondDevicename,
detector.detector_name,
detector.detector_code,
enterprise.enterprise_name,
detector.medium,
detector.detector_status,
detector.update_time AS reportTime
FROM
t_relation_device_detail_info relation
INNER JOIN t_detector_info detector ON detector.detector_code = relation.iot_no
INNER JOIN t_device_info device ON device.device_id = relation.relation_device_id
INNER JOIN t_enterprise_info enterprise ON enterprise.enterprise_id = device.beyond_enterprise_id
<where>
relation.device_type = '3' AND relation.is_del = '0'
<if test="enterpriseId != null and enterpriseId != ''"> and enterprise.enterprise_id = #{enterpriseId}</if>
<if test="detectorName != null and detectorName != ''"> and detector.detector_name like concat('%', #{detectorName}, '%')</if>
<if test="detectorCode != null and detectorCode != ''"> and detector.detector_code like concat('%', #{detectorCode}, '%')</if>
</where>
</select>
</mapper>
\ No newline at end of file
......@@ -27,38 +27,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
<result property="beyondDeviceName" column="beyondDeviceName" />
<result property="deviceType" column="device_type" />
</resultMap>
<sql id="selectTDeviceReportDataVo">
select device_report_data_id, device_name, device_num, standard_condition_accumulation, working_condition_accumulation, backing_standard_condition_accumulation, residual_quantity, standard_condition_flow, working_condition_flow, temperature, pressure, report_time, communication_status, device_status, beyond_enterprise_id, beyond_enterprise_name, create_by, create_time, update_by, update_time, is_del, remarks from t_device_report_data
SELECT
report.device_report_data_id,
report.device_name,
report.device_num,
report.standard_condition_accumulation,
report.working_condition_accumulation,
report.backing_standard_condition_accumulation,
report.residual_quantity,
report.standard_condition_flow,
report.working_condition_flow,
report.temperature,
report.pressure,
report.report_time,
report.communication_status,
report.device_status,
report.beyond_enterprise_id,
enterprise.enterprise_name AS beyond_enterprise_name,
report.create_by,
report.create_time,
report.update_by,
report.update_time,
report.is_del,
report.remarks,
device.device_name AS beyondDeviceName
FROM
t_device_report_data report
INNER JOIN t_relation_device_detail_info detail ON detail.iot_no = report.device_num
INNER JOIN t_device_info device ON device.device_id = detail.relation_device_id
INNER JOIN t_enterprise_info enterprise ON enterprise.enterprise_id = report.beyond_enterprise_id
</sql>
<select id="selectTDeviceReportDataList" parameterType="TDeviceReportData" resultMap="TDeviceReportDataResult">
<include refid="selectTDeviceReportDataVo"/>
<where>
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceNum != null and deviceNum != ''"> and device_num like concat('%', #{deviceNum}, '%')</if>
<if test="standardConditionAccumulation != null "> and standard_condition_accumulation = #{standardConditionAccumulation}</if>
<if test="workingConditionAccumulation != null "> and working_condition_accumulation = #{workingConditionAccumulation}</if>
<if test="backingStandardConditionAccumulation != null "> and backing_standard_condition_accumulation = #{backingStandardConditionAccumulation}</if>
<if test="residualQuantity != null "> and residual_quantity = #{residualQuantity}</if>
<if test="standardConditionFlow != null "> and standard_condition_flow = #{standardConditionFlow}</if>
<if test="workingConditionFlow != null "> and working_condition_flow = #{workingConditionFlow}</if>
<if test="temperature != null "> and temperature = #{temperature}</if>
<if test="pressure != null "> and pressure = #{pressure}</if>
<if test="reportTime != null "> and report_time = #{reportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</if>
<if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if>
<if test="beyondEnterpriseId != null "> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
<if test="deviceName != null and deviceName != ''"> and report.device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceNum != null and deviceNum != ''"> and report.device_num like concat('%', #{deviceNum}, '%')</if>
<if test="standardConditionAccumulation != null "> and report.standard_condition_accumulation = #{standardConditionAccumulation}</if>
<if test="workingConditionAccumulation != null "> and report.working_condition_accumulation = #{workingConditionAccumulation}</if>
<if test="backingStandardConditionAccumulation != null "> and report.backing_standard_condition_accumulation = #{backingStandardConditionAccumulation}</if>
<if test="residualQuantity != null "> and report.residual_quantity = #{residualQuantity}</if>
<if test="standardConditionFlow != null "> and report.standard_condition_flow = #{standardConditionFlow}</if>
<if test="workingConditionFlow != null "> and report.working_condition_flow = #{workingConditionFlow}</if>
<if test="temperature != null "> and report.temperature = #{temperature}</if>
<if test="pressure != null "> and report.pressure = #{pressure}</if>
<if test="reportTime != null "> and report.report_time = #{reportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and report.communication_status = #{communicationStatus}</if>
<if test="deviceStatus != null and deviceStatus != ''"> and report.device_status = #{deviceStatus}</if>
<if test="beyondEnterpriseId != null "> and report.beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and report.beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if>
<if test="isDel != null and isDel != ''"> and report.is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and report.remarks = #{remarks}</if>
<if test="deviceType != null and deviceType != ''">AND detail.device_type = #{deviceType}</if>
</where>
</select>
<select id="selectTDeviceReportDataById" parameterType="Long" resultMap="TDeviceReportDataResult">
<include refid="selectTDeviceReportDataVo"/>
where device_report_data_id = #{deviceReportDataId}
where report.device_report_data_id = #{deviceReportDataId}
</select>
<insert id="insertTDeviceReportData" parameterType="TDeviceReportData" useGeneratedKeys="true" keyProperty="deviceReportDataId">
......
......@@ -81,3 +81,16 @@ export function selectDeviceNum(query) {
params: query
})
}
//数据监控获取探测器数据
export function selectDetectorMointor(query){
return request({
url: '/detector/detectorInfo/selectDetectorMointor',
method: 'get',
params: {
pageNum: 1,
pageSize: 20,
...query,
},
})
}
<template>
<div class="detectorTab">
<el-table v-loading="loading" :data="childrenDataList">
<el-table-column label="所属设备名称" align="center" prop="beyondDevicename"/>
<el-table-column label="设备名称" align="center" prop="detectorName"/>
<el-table-column label="设备编号" align="center" prop="detectorCode"/>
<el-table-column label="所属企业" align="center" prop="enterpriseName" />
<el-table-column label="探测介质" align="center" prop="medium">
<template slot-scope="scope">
<span v-if="scope.row.medium == 1">甲烷</span>
<span v-if="scope.row.medium == 2">氨气</span>
<span v-if="scope.row.medium == 3">一氧化碳</span>
<span v-if="scope.row.medium == 4">可燃气体</span>
<span v-if="scope.row.medium == 5">有毒气体</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="detectorStatus">
<template slot-scope="scope">
<span v-if="scope.row.detectorStatus == 0">正常</span>
<span v-if="scope.row.detectorStatus == 1">离线</span>
<span v-if="scope.row.detectorStatus == 2">报警</span>
</template>
</el-table-column>
<el-table-column label="上报时间" align="center" prop="workingConditionAccumulation" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { selectDetectorMointor } from "@/api/detector/detectorInfo"
export default {
props:{
childrenQueryParams: {}
},
name: "DetectorTabData",
components: {
},
data() {
return {
queryParams: {
pageNum: 1,
pageSize: 10,
enterpriseId: 0,
detectorName: "",
detectorCode: ""
},
loading: true,
childrenDataList: [],
total: 0
};
},
created() {
this.getList();
},
methods: {
getList() {
this.loading = true;
this.queryParams.enterpriseId = this.childrenQueryParams.beyondEnterpriseId;
this.queryParams.detectorName = this.childrenQueryParams.deviceName;
this.queryParams.detectorCode = this.childrenQueryParams.deviceNum;
selectDetectorMointor(this.queryParams).then(response => {
this.childrenDataList = response.rows;
this.total = response.total;
this.loading = false;
});
},
detectorHandleQuery(){
this.queryParams.pageNum = 1;
this.getList();
}
}
};
</script>
<style>
.detectorTab{
margin-bottom: 20px;
}
</style>
<template>
<div class="flowmeterTab">
<el-table v-loading="loading" :data="childrenDataList">
<el-table-column label="所属设备名称" align="center" prop="beyondDeviceName" width="155"/>
<el-table-column label="设备名称" align="center" prop="deviceName" width="155"/>
<el-table-column label="设备编号" align="center" prop="deviceNum" width="155"/>
<el-table-column label="所属企业" align="center" prop="beyondEnterpriseName" />
<el-table-column label="标况累计量(m³)" align="center" prop="standardConditionAccumulation"/>
<el-table-column label="工况累计量(m³)" align="center" prop="workingConditionAccumulation" />
<el-table-column label="逆向标况累计量(m³)" align="center" prop="backingStandardConditionAccumulation" />
<el-table-column label="剩余量(m³)" align="center" prop="residualQuantity" />
<el-table-column label="标况流量(m³/h)" align="center" prop="standardConditionFlow" />
<el-table-column label="工况流量(m³/h)" align="center" prop="workingConditionFlow" />
<el-table-column label="温度(℃)" align="center" prop="temperature" />
<el-table-column label="压力(KPa)" align="center" prop="pressure" />
<el-table-column label="上报时间" align="center" prop="createTime" width="180" />
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listData, getData, delData, addData, updateData, exportData } from "@/api/operationMonitor/data";
export default {
props:{
childrenQueryParams: {}
},
name: "FlowmeterTabData",
components: {
},
data() {
return {
queryParams: {
pageNum: 1,
pageSize: 10
},
loading: true,
childrenDataList: [],
total: 0
};
},
created() {
this.getList();
},
methods: {
getList() {
this.loading = true;
this.childrenQueryParams.pageNum = this.queryParams.pageNum;
this.childrenQueryParams.pageSize = this.queryParams.pageSize;
this.childrenQueryParams.deviceType = '2';
listData(this.childrenQueryParams).then(response => {
this.childrenDataList = response.rows;
this.total = response.total;
this.loading = false;
});
},
flowmeterHandleQuery(){
this.queryParams.pageNum = 1;
this.getList();
}
}
};
</script>
<style>
.flowmeterTab {
margin-bottom: 20px;
}
</style>
<template>
<div class="pressureTab">
<el-table v-loading="loading" :data="childrenDataList">
<el-table-column label="所属设备名称" align="center" prop="beyondDeviceName"/>
<el-table-column label="设备名称" align="center" prop="deviceName"/>
<el-table-column label="设备编号" align="center" prop="deviceNum"/>
<el-table-column label="所属企业" align="center" prop="beyondEnterpriseName"/>
<el-table-column label="压力(KPa)" align="center" prop="pressure" />
<el-table-column label="上报时间" align="center" prop="createTime"/>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listData, getData, delData, addData, updateData, exportData } from "@/api/operationMonitor/data";
export default {
props:{
childrenQueryParams: {}
},
name: "PressureTabData",
components: {
},
data() {
return {
queryParams: {
pageNum: 1,
pageSize: 10
},
loading: true,
childrenDataList: [],
total: 0
};
},
created() {
this.getList();
},
methods: {
getList() {
this.loading = true;
this.childrenQueryParams.pageNum = this.queryParams.pageNum;
this.childrenQueryParams.pageSize = this.queryParams.pageSize;
this.childrenQueryParams.deviceType = '1';
listData(this.childrenQueryParams).then(response => {
this.childrenDataList = response.rows;
this.total = response.total;
this.loading = false;
});
},
pressureHandleQuery(){
this.queryParams.pageNum = 1;
this.getList();
}
}
};
</script>
<style>
.pressureTab{
margin-bottom: 20px;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment