Commit 81713b8b authored by yaqizhang's avatar yaqizhang

Merge branch 'master' of ssh://111.61.77.35:15/gengdidi/gassafety-progress into master

parents 03a53fa8 5f3f3579
......@@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectTDetectorReportDataList" parameterType="TDetectorReportDataForm" resultType="TDetectorAlarmInfoVO">
select * from(
select rd.id,
rd.cancel_time cancelTime,
rd.detector_code detectorCode,
......@@ -45,7 +46,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="cancelTimeStart != null "> and rd.cancel_time &gt;= #{cancelTimeStart}</if>
<if test="cancelTimeEnd != null "> and rd.cancel_time &lt;= #{cancelTimeEnd}</if>
</where>
ORDER BY rd.create_time desc
union
SELECT rd.id,
rd.cancel_time cancelTime,
rd.detector_code detectorCode,
CONCAT_WS("#",ti.device_name,ti.linkman) unitName,
di.detector_type detectorType,
rd.status_name statusName,
rd.create_time alarmTime,
rd.is_cancel_alarm handledStatus
FROM t_detector_report_data rd
LEFT JOIN t_detector_info di ON rd.detector_code = di.detector_code
LEFT JOIN t_relation_device_detail_info ri ON rd.detector_code = ri.iot_no
LEFT JOIN t_device_info ti ON ri.relation_device_id = ti.device_id
<where> ri.relation_device_type = '1' and ri.is_del = '0' and ti.is_del = '0'
<if test="detectorCode != null and detectorCode != ''"> and rd.detector_code = #{detectorCode}</if>
<if test="statusName != null and statusName != ''"> and rd.status_name = #{statusName}</if>
<if test="createTimeStart != null "> and rd.create_time &gt;= #{createTimeStart}</if>
<if test="createTimeEnd != null "> and rd.create_time &lt;= #{createTimeEnd}</if>
<if test="isCancelAlarm != null and isCancelAlarm != ''"> and is_cancel_alarm = #{isCancelAlarm}</if>
<if test="cancelTimeStart != null "> and rd.cancel_time &gt;= #{cancelTimeStart}</if>
<if test="cancelTimeEnd != null "> and rd.cancel_time &lt;= #{cancelTimeEnd}</if>
</where>
union
SELECT rd.id,
rd.cancel_time cancelTime,
rd.detector_code detectorCode,
CONCAT_WS("#",si.site_station_name,si.build_unit) unitName,
di.detector_type detectorType,
rd.status_name statusName,
rd.create_time alarmTime,
rd.is_cancel_alarm handledStatus
FROM t_detector_report_data rd
LEFT JOIN t_detector_info di ON rd.detector_code = di.detector_code
LEFT JOIN t_relation_device_detail_info ti ON rd.detector_code = ti.iot_no
LEFT JOIN t_site_station_info si ON ti.relation_device_id = si.site_station_id
<where> ti.relation_device_type = '2' and ti.is_del = '0' and si.is_del = '0'
<if test="detectorCode != null and detectorCode != ''"> and rd.detector_code = #{detectorCode}</if>
<if test="statusName != null and statusName != ''"> and rd.status_name = #{statusName}</if>
<if test="createTimeStart != null "> and rd.create_time &gt;= #{createTimeStart}</if>
<if test="createTimeEnd != null "> and rd.create_time &lt;= #{createTimeEnd}</if>
<if test="isCancelAlarm != null and isCancelAlarm != ''"> and is_cancel_alarm = #{isCancelAlarm}</if>
<if test="cancelTimeStart != null "> and rd.cancel_time &gt;= #{cancelTimeStart}</if>
<if test="cancelTimeEnd != null "> and rd.cancel_time &lt;= #{cancelTimeEnd}</if>
</where>
)t
ORDER BY t.alarmTime DESC
</select>
<select id="selectTDetectorReportDataById" parameterType="Long" resultMap="TDetectorReportDataResult">
......@@ -61,6 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectTDetectorAlarm" resultType="TDetectorAlarmInfoVO">
select * from(
SELECT
rd.detector_code detectorCode,
CONCAT_WS("#",IFNULL(u.nick_name,IFNULL(di.linkman,di.detector_addr)),di.linkman) unitName,
......@@ -76,7 +123,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN t_detector_info di ON rd.detector_code = di.detector_code
LEFT JOIN t_detector_user u ON u.user_id = di.user_id
WHERE u.is_del = '0' and di.is_del = '0' and rd.is_cancel_alarm = '0'
ORDER BY rd.create_time DESC LIMIT 50
union
SELECT
rd.detector_code detectorCode,
CONCAT_WS("#",ti.device_name,ti.linkman) unitName,
di.detector_type detectorType,
rd.status_name statusName,
rd.create_time alarmTime,
IF (
rd.is_cancel_alarm = 0,
'未消除',
'已消除'
) handledStatus
FROM t_detector_report_data rd
LEFT JOIN t_detector_info di ON rd.detector_code = di.detector_code
LEFT JOIN t_relation_device_detail_info ri ON rd.detector_code = ri.iot_no
LEFT JOIN t_device_info ti ON ri.relation_device_id = ti.device_id
WHERE ri.relation_device_type = '1' and ri.is_del = '0' and ti.is_del = '0' and rd.is_cancel_alarm = '0'
union
SELECT
rd.detector_code detectorCode,
CONCAT_WS("#",si.site_station_name,si.build_unit) unitName,
di.detector_type detectorType,
rd.status_name statusName,
rd.create_time alarmTime,
IF (
rd.is_cancel_alarm = 0,
'未消除',
'已消除'
) handledStatus
FROM t_detector_report_data rd
LEFT JOIN t_detector_info di ON rd.detector_code = di.detector_code
LEFT JOIN t_relation_device_detail_info ti ON rd.detector_code = ti.iot_no
LEFT JOIN t_site_station_info si ON ti.relation_device_id = si.site_station_id
WHERE ti.relation_device_type = '2' and ti.is_del = '0' and si.is_del = '0' and rd.is_cancel_alarm = '0'
)t
ORDER BY t.alarmTime DESC LIMIT 50
</select>
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px">
<el-form :model="queryParams" ref="queryParams" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="设备编号" prop="detectorCode">
<el-input
v-model="queryParams.detectorCode"
......@@ -67,15 +67,15 @@
<span>{{ scope.row.cancelTime }}</span>
</template>
</el-table-column>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
......@@ -134,7 +134,16 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams = {
pageNum: 1,
pageSize: 10,
detectorCode: null,
statusName: null,
isCancelAlarm: null,
createTimeStart: null,
createTimeEnd: null
}
this.resetForm("queryParams");
this.handleQuery();
},
}
......
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