Commit ac51d6b0 authored by 耿迪迪's avatar 耿迪迪

数据监控问题修改 gengdidi

parent b7309a0e
...@@ -12,7 +12,7 @@ import com.zehong.common.core.domain.BaseEntity; ...@@ -12,7 +12,7 @@ import com.zehong.common.core.domain.BaseEntity;
* 设备监控对象 t_device_report_data * 设备监控对象 t_device_report_data
* *
* @author zehong * @author zehong
* @date 2022-02-16 * @date 2022-02-17
*/ */
public class TDeviceReportData extends BaseEntity public class TDeviceReportData extends BaseEntity
{ {
...@@ -21,6 +21,10 @@ public class TDeviceReportData extends BaseEntity ...@@ -21,6 +21,10 @@ public class TDeviceReportData extends BaseEntity
/** 设备上报id */ /** 设备上报id */
private Long deviceReportDataId; private Long deviceReportDataId;
/** 设备名称 */
@Excel(name = "设备名称")
private String deviceName;
/** 设备id(物联网编号) */ /** 设备id(物联网编号) */
@Excel(name = "设备id", readConverterExp = "物=联网编号") @Excel(name = "设备id", readConverterExp = "物=联网编号")
private String deviceNum; private String deviceNum;
...@@ -70,6 +74,14 @@ public class TDeviceReportData extends BaseEntity ...@@ -70,6 +74,14 @@ public class TDeviceReportData extends BaseEntity
@Excel(name = "设备状态") @Excel(name = "设备状态")
private String deviceStatus; private String deviceStatus;
/** 所属企业id */
@Excel(name = "所属企业id")
private Long beyondEnterpriseId;
/** 所属企业名称 */
@Excel(name = "所属企业名称")
private String beyondEnterpriseName;
/** 是否删除(0正常,1删除) */ /** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)") @Excel(name = "是否删除(0正常,1删除)")
private String isDel; private String isDel;
...@@ -87,6 +99,15 @@ public class TDeviceReportData extends BaseEntity ...@@ -87,6 +99,15 @@ public class TDeviceReportData extends BaseEntity
{ {
return deviceReportDataId; return deviceReportDataId;
} }
public void setDeviceName(String deviceName)
{
this.deviceName = deviceName;
}
public String getDeviceName()
{
return deviceName;
}
public void setDeviceNum(String deviceNum) public void setDeviceNum(String deviceNum)
{ {
this.deviceNum = deviceNum; this.deviceNum = deviceNum;
...@@ -195,6 +216,24 @@ public class TDeviceReportData extends BaseEntity ...@@ -195,6 +216,24 @@ public class TDeviceReportData extends BaseEntity
{ {
return deviceStatus; return deviceStatus;
} }
public void setBeyondEnterpriseId(Long beyondEnterpriseId)
{
this.beyondEnterpriseId = beyondEnterpriseId;
}
public Long getBeyondEnterpriseId()
{
return beyondEnterpriseId;
}
public void setBeyondEnterpriseName(String beyondEnterpriseName)
{
this.beyondEnterpriseName = beyondEnterpriseName;
}
public String getBeyondEnterpriseName()
{
return beyondEnterpriseName;
}
public void setIsDel(String isDel) public void setIsDel(String isDel)
{ {
this.isDel = isDel; this.isDel = isDel;
...@@ -218,6 +257,7 @@ public class TDeviceReportData extends BaseEntity ...@@ -218,6 +257,7 @@ public class TDeviceReportData extends BaseEntity
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("deviceReportDataId", getDeviceReportDataId()) .append("deviceReportDataId", getDeviceReportDataId())
.append("deviceName", getDeviceName())
.append("deviceNum", getDeviceNum()) .append("deviceNum", getDeviceNum())
.append("standardConditionAccumulation", getStandardConditionAccumulation()) .append("standardConditionAccumulation", getStandardConditionAccumulation())
.append("workingConditionAccumulation", getWorkingConditionAccumulation()) .append("workingConditionAccumulation", getWorkingConditionAccumulation())
...@@ -230,6 +270,8 @@ public class TDeviceReportData extends BaseEntity ...@@ -230,6 +270,8 @@ public class TDeviceReportData extends BaseEntity
.append("reportTime", getReportTime()) .append("reportTime", getReportTime())
.append("communicationStatus", getCommunicationStatus()) .append("communicationStatus", getCommunicationStatus())
.append("deviceStatus", getDeviceStatus()) .append("deviceStatus", getDeviceStatus())
.append("beyondEnterpriseId", getBeyondEnterpriseId())
.append("beyondEnterpriseName", getBeyondEnterpriseName())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
......
...@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="TDeviceReportData" id="TDeviceReportDataResult"> <resultMap type="TDeviceReportData" id="TDeviceReportDataResult">
<result property="deviceReportDataId" column="device_report_data_id" /> <result property="deviceReportDataId" column="device_report_data_id" />
<result property="deviceName" column="device_name" />
<result property="deviceNum" column="device_num" /> <result property="deviceNum" column="device_num" />
<result property="standardConditionAccumulation" column="standard_condition_accumulation" /> <result property="standardConditionAccumulation" column="standard_condition_accumulation" />
<result property="workingConditionAccumulation" column="working_condition_accumulation" /> <result property="workingConditionAccumulation" column="working_condition_accumulation" />
...@@ -18,6 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -18,6 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="reportTime" column="report_time" /> <result property="reportTime" column="report_time" />
<result property="communicationStatus" column="communication_status" /> <result property="communicationStatus" column="communication_status" />
<result property="deviceStatus" column="device_status" /> <result property="deviceStatus" column="device_status" />
<result property="beyondEnterpriseId" column="beyond_enterprise_id" />
<result property="beyondEnterpriseName" column="beyond_enterprise_name" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
...@@ -27,13 +30,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -27,13 +30,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTDeviceReportDataVo"> <sql id="selectTDeviceReportDataVo">
select device_report_data_id, 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, create_by, create_time, update_by, update_time, is_del, remarks from t_device_report_data 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
</sql> </sql>
<select id="selectTDeviceReportDataList" parameterType="TDeviceReportData" resultMap="TDeviceReportDataResult"> <select id="selectTDeviceReportDataList" parameterType="TDeviceReportData" resultMap="TDeviceReportDataResult">
<include refid="selectTDeviceReportDataVo"/> <include refid="selectTDeviceReportDataVo"/>
<where> <where>
<if test="deviceNum != null and deviceNum != ''"> and device_num = #{deviceNum}</if> <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="standardConditionAccumulation != null "> and standard_condition_accumulation = #{standardConditionAccumulation}</if>
<if test="workingConditionAccumulation != null "> and working_condition_accumulation = #{workingConditionAccumulation}</if> <if test="workingConditionAccumulation != null "> and working_condition_accumulation = #{workingConditionAccumulation}</if>
<if test="backingStandardConditionAccumulation != null "> and backing_standard_condition_accumulation = #{backingStandardConditionAccumulation}</if> <if test="backingStandardConditionAccumulation != null "> and backing_standard_condition_accumulation = #{backingStandardConditionAccumulation}</if>
...@@ -45,6 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -45,6 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="reportTime != null "> and report_time = #{reportTime}</if> <if test="reportTime != null "> and report_time = #{reportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</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="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="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if> <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where> </where>
...@@ -58,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -58,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertTDeviceReportData" parameterType="TDeviceReportData" useGeneratedKeys="true" keyProperty="deviceReportDataId"> <insert id="insertTDeviceReportData" parameterType="TDeviceReportData" useGeneratedKeys="true" keyProperty="deviceReportDataId">
insert into t_device_report_data insert into t_device_report_data
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceName != null">device_name,</if>
<if test="deviceNum != null and deviceNum != ''">device_num,</if> <if test="deviceNum != null and deviceNum != ''">device_num,</if>
<if test="standardConditionAccumulation != null">standard_condition_accumulation,</if> <if test="standardConditionAccumulation != null">standard_condition_accumulation,</if>
<if test="workingConditionAccumulation != null">working_condition_accumulation,</if> <if test="workingConditionAccumulation != null">working_condition_accumulation,</if>
...@@ -70,6 +77,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -70,6 +77,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="reportTime != null">report_time,</if> <if test="reportTime != null">report_time,</if>
<if test="communicationStatus != null">communication_status,</if> <if test="communicationStatus != null">communication_status,</if>
<if test="deviceStatus != null">device_status,</if> <if test="deviceStatus != null">device_status,</if>
<if test="beyondEnterpriseId != null">beyond_enterprise_id,</if>
<if test="beyondEnterpriseName != null">beyond_enterprise_name,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
...@@ -78,6 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -78,6 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remarks != null">remarks,</if> <if test="remarks != null">remarks,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceName != null">#{deviceName},</if>
<if test="deviceNum != null and deviceNum != ''">#{deviceNum},</if> <if test="deviceNum != null and deviceNum != ''">#{deviceNum},</if>
<if test="standardConditionAccumulation != null">#{standardConditionAccumulation},</if> <if test="standardConditionAccumulation != null">#{standardConditionAccumulation},</if>
<if test="workingConditionAccumulation != null">#{workingConditionAccumulation},</if> <if test="workingConditionAccumulation != null">#{workingConditionAccumulation},</if>
...@@ -90,6 +100,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -90,6 +100,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="reportTime != null">#{reportTime},</if> <if test="reportTime != null">#{reportTime},</if>
<if test="communicationStatus != null">#{communicationStatus},</if> <if test="communicationStatus != null">#{communicationStatus},</if>
<if test="deviceStatus != null">#{deviceStatus},</if> <if test="deviceStatus != null">#{deviceStatus},</if>
<if test="beyondEnterpriseId != null">#{beyondEnterpriseId},</if>
<if test="beyondEnterpriseName != null">#{beyondEnterpriseName},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
...@@ -102,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -102,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateTDeviceReportData" parameterType="TDeviceReportData"> <update id="updateTDeviceReportData" parameterType="TDeviceReportData">
update t_device_report_data update t_device_report_data
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="deviceName != null">device_name = #{deviceName},</if>
<if test="deviceNum != null and deviceNum != ''">device_num = #{deviceNum},</if> <if test="deviceNum != null and deviceNum != ''">device_num = #{deviceNum},</if>
<if test="standardConditionAccumulation != null">standard_condition_accumulation = #{standardConditionAccumulation},</if> <if test="standardConditionAccumulation != null">standard_condition_accumulation = #{standardConditionAccumulation},</if>
<if test="workingConditionAccumulation != null">working_condition_accumulation = #{workingConditionAccumulation},</if> <if test="workingConditionAccumulation != null">working_condition_accumulation = #{workingConditionAccumulation},</if>
...@@ -114,6 +127,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -114,6 +127,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="reportTime != null">report_time = #{reportTime},</if> <if test="reportTime != null">report_time = #{reportTime},</if>
<if test="communicationStatus != null">communication_status = #{communicationStatus},</if> <if test="communicationStatus != null">communication_status = #{communicationStatus},</if>
<if test="deviceStatus != null">device_status = #{deviceStatus},</if> <if test="deviceStatus != null">device_status = #{deviceStatus},</if>
<if test="beyondEnterpriseId != null">beyond_enterprise_id = #{beyondEnterpriseId},</if>
<if test="beyondEnterpriseName != null">beyond_enterprise_name = #{beyondEnterpriseName},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="queryParams.deviceName"
placeholder="请输入设备名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备编号" prop="deviceNum"> <el-form-item label="设备编号" prop="deviceNum">
<el-input <el-input
v-model="queryParams.deviceNum" v-model="queryParams.deviceNum"
...@@ -10,6 +19,23 @@ ...@@ -10,6 +19,23 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="所属企业" prop="beyondEnterpriseId">
<!--<el-input
v-model="queryParams.beyondEnterpriseName"
placeholder="请输入所属企业名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>-->
<el-select v-model="queryParams.beyondEnterpriseId" placeholder="请选择所属企业">
<el-option
v-for="item in enterprises"
:key="item.enterpriseId"
:label="item.enterpriseName"
:value="item.enterpriseId"
></el-option>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
...@@ -65,20 +91,22 @@ ...@@ -65,20 +91,22 @@
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<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="deviceNum" width="155"/>
<el-table-column label="标况累计量" align="center" prop="standardConditionAccumulation" /> <el-table-column label="所属企业" align="center" prop="beyondEnterpriseName" />
<el-table-column label="工况累计量" align="center" prop="workingConditionAccumulation" /> <el-table-column label="标况累计量(m³)" align="center" prop="standardConditionAccumulation"/>
<el-table-column label="逆向标况累计量" align="center" prop="backingStandardConditionAccumulation" /> <el-table-column label="工况累计量(m³)" align="center" prop="workingConditionAccumulation" />
<el-table-column label="剩余量" align="center" prop="residualQuantity" /> <el-table-column label="逆向标况累计量(m³)" align="center" prop="backingStandardConditionAccumulation" />
<el-table-column label="标况流量" align="center" prop="standardConditionFlow" /> <el-table-column label="剩余量(m³)" align="center" prop="residualQuantity" />
<el-table-column label="工况流量" align="center" prop="workingConditionFlow" /> <el-table-column label="标况流量(m³/h)" align="center" prop="standardConditionFlow" />
<el-table-column label="温度" align="center" prop="temperature" /> <el-table-column label="工况流量(m³/h)" align="center" prop="workingConditionFlow" />
<el-table-column label="压力" align="center" prop="pressure" /> <el-table-column label="温度(℃)" align="center" prop="temperature" />
<el-table-column label="上报时间" align="center" prop="reportTime" width="180"> <el-table-column label="压力(KPa)" align="center" prop="pressure" />
<template slot-scope="scope"> <el-table-column label="上报时间" align="center" prop="createTime" width="180" />
<!-- <template slot-scope="scope">
<span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>-->
<!--<el-table-column label="创建时间" align="center" prop="createTime" />--> <!--<el-table-column label="创建时间" align="center" prop="createTime" />-->
<!--<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <!--<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -173,7 +201,7 @@ ...@@ -173,7 +201,7 @@
<script> <script>
import { listData, getData, delData, addData, updateData, exportData } from "@/api/operationMonitor/data"; import { listData, getData, delData, addData, updateData, exportData } from "@/api/operationMonitor/data";
import { enterpriseLists } from "@/api/regulation/info";
export default { export default {
name: "Data", name: "Data",
components: { components: {
...@@ -226,11 +254,13 @@ export default { ...@@ -226,11 +254,13 @@ export default {
deviceNum: [ deviceNum: [
{ required: true, message: "设备id不能为空", trigger: "blur" } { required: true, message: "设备id不能为空", trigger: "blur" }
], ],
} },
enterprises:[]
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getEnterpriseLists();
}, },
methods: { methods: {
/** 查询设备监控列表 */ /** 查询设备监控列表 */
...@@ -352,6 +382,12 @@ export default { ...@@ -352,6 +382,12 @@ export default {
this.download(response.msg); this.download(response.msg);
this.exportLoading = false; this.exportLoading = false;
}).catch(() => {}); }).catch(() => {});
},
//所属单位
getEnterpriseLists(){
enterpriseLists().then(response => {
this.enterprises = response.rows;
});
} }
} }
}; };
......
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