|
@@ -31,7 +31,7 @@
|
|
|
<result property="pointX" column="point_x" jdbcType="VARCHAR"/>
|
|
|
<result property="pointY" column="point_y" jdbcType="VARCHAR"/>
|
|
|
<result property="address" column="address" jdbcType="VARCHAR"/>
|
|
|
- <result property="sceneState" column="scene_state" jdbcType="INTEGER"/>
|
|
|
+ <result property="deviceState" column="device_state" jdbcType="INTEGER"/>
|
|
|
<collection property="MonitorDataEntities" ofType="com.huaxu.dto.MonitorDataDto" javaType="list">
|
|
|
<result property="attributeId" column="attribute_id" jdbcType="INTEGER"/>
|
|
|
<result property="attributeName" column="attribute_name" jdbcType="VARCHAR"/>
|
|
@@ -331,15 +331,16 @@
|
|
|
<!--查询设备地图参数数据-->
|
|
|
<select id="selectDeviceMapParam" resultMap="deviceDataMap">
|
|
|
select distinct t1.id device_id,t1.device_code,t1.device_name,t1.point_x,point_y,t1.address,t2.attribute_id, ifnull(t2.remark, t3.`name`) attribute_name,t3.unit,
|
|
|
- case when t2.attribute_id is null then null when t6.id is null then 0 else 1 end is_alarm, if (t4.alarm_count>0, 1, 0) scene_state
|
|
|
+ t2.seq,case when t2.attribute_id is null then null when t6.id is null then 0 else 1 end is_alarm, if (t4.alarm_count>0, 1, 0) device_state
|
|
|
from sms_device t1
|
|
|
- left join sms_device_parm t2 on t2.device_id=t1.id and t2.is_map=1
|
|
|
- left join sms_device_attribute t3 on t2.attribute_id=t3.id
|
|
|
+ left join sms_device_parm t2 on t2.device_id=t1.id and t2.is_map=1 and t2.status=1
|
|
|
+ left join sms_device_attribute t3 on t2.attribute_id=t3.id and t3.status=1
|
|
|
left join (
|
|
|
select a1.device_id,count(1) alarm_count from sms_alarm_details a1 where a1.device_id= #{deviceId} and a1.`status` = 1 and a1.state = 1
|
|
|
)t4 on t4.device_id=t1.id
|
|
|
left join sms_alarm_details t6 on t6.device_id=t1.id and t6.attribute_id=t2.attribute_id and t6.status = 1 and t6.state=1
|
|
|
where t1. status = 1 and t1. enable_state = 1 and t1.id= #{deviceId}
|
|
|
+ order by t2.seq
|
|
|
</select>
|
|
|
<!--统计设备合格数据-->
|
|
|
<select id="statsDeviceQualified" resultType="com.huaxu.dto.DeviceCountStatsDto">
|
|
@@ -381,7 +382,7 @@
|
|
|
count(t8.device_id) alarmCount
|
|
|
from sms_scene t1
|
|
|
<include refid="deviceInnerJoins"/>
|
|
|
- inner join sms_device_parm t7 on t7.scene_id=t2.scene_id and t7.device_id=t2.device_id
|
|
|
+ inner join sms_device_parm t7 on t7.scene_id=t2.scene_id and t7.device_id=t2.device_id and t7.status=1
|
|
|
<if test="sceneTypeName == '压力'">
|
|
|
and t7.parm_type in(13)
|
|
|
</if>
|
|
@@ -414,7 +415,7 @@
|
|
|
<if test="type == 4 ">,t9.latest_value</if>
|
|
|
from sms_scene t1
|
|
|
<include refid="deviceInnerJoins"/>
|
|
|
- left join sms_device_parm t7 on t7.scene_id=t2.scene_id and t7.device_id=t2.device_id
|
|
|
+ left join sms_device_parm t7 on t7.scene_id=t2.scene_id and t7.device_id=t2.device_id and t7.status=1
|
|
|
<if test="type == 1 ">
|
|
|
and t7.parm_type in(13)
|
|
|
</if>
|
|
@@ -487,7 +488,7 @@
|
|
|
<if test="onlineDataDto.deviceName != null and onlineDataDto.deviceName != ''">
|
|
|
and t6.device_name like concat('%', #{onlineDataDto.deviceName},'%')
|
|
|
</if>
|
|
|
- order by t6.date_create
|
|
|
+ order by t6.last_update_time desc
|
|
|
</select>
|
|
|
<!--查询管网地图图层及设备-->
|
|
|
<select id="selectPipeNetLayer" resultMap="layerMap">
|