|
|
@ -39,6 +39,15 @@ |
|
|
</sql> |
|
|
</sql> |
|
|
|
|
|
|
|
|
<sql id="deviceDataCommonWhere"> |
|
|
<sql id="deviceDataCommonWhere"> |
|
|
|
|
|
<if test="buildingId != null"> |
|
|
|
|
|
and basic_building.building_id = #{buildingId} |
|
|
|
|
|
</if> |
|
|
|
|
|
<if test="bindBuildingIdList != null"> |
|
|
|
|
|
and basic_building.building_id in |
|
|
|
|
|
<foreach collection="bindBuildingIdList" item="item" open="(" separator="," close=")"> |
|
|
|
|
|
#{item} |
|
|
|
|
|
</foreach> |
|
|
|
|
|
</if> |
|
|
<if test="keyword != null and keyword != ''"> |
|
|
<if test="keyword != null and keyword != ''"> |
|
|
and device_info.monitoring_point_name LIKE CONCAT('%',#{keyword},'%') |
|
|
and device_info.monitoring_point_name LIKE CONCAT('%',#{keyword},'%') |
|
|
</if> |
|
|
</if> |
|
|
@ -112,9 +121,6 @@ |
|
|
<include refid="deviceDataFromAndJoin"/> |
|
|
<include refid="deviceDataFromAndJoin"/> |
|
|
left join device_rawdata_realtime drr on drr.device_id = device_info.device_id |
|
|
left join device_rawdata_realtime drr on drr.device_id = device_info.device_id |
|
|
<where> |
|
|
<where> |
|
|
<if test="buildingId != null"> |
|
|
|
|
|
and basic_building.building_id = #{buildingId} |
|
|
|
|
|
</if> |
|
|
|
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
</where> |
|
|
</where> |
|
|
<include refid="drrOrder"/> |
|
|
<include refid="drrOrder"/> |
|
|
@ -131,9 +137,6 @@ |
|
|
left join device_rawdata_realtime drr on drr.device_id = device_info.device_id |
|
|
left join device_rawdata_realtime drr on drr.device_id = device_info.device_id |
|
|
left join dashboard_device_group_relation ddgr on ddgr.device_info_id = device_info.id |
|
|
left join dashboard_device_group_relation ddgr on ddgr.device_info_id = device_info.id |
|
|
<where> |
|
|
<where> |
|
|
<if test="buildingId != null"> |
|
|
|
|
|
and basic_building.building_id = #{buildingId} |
|
|
|
|
|
</if> |
|
|
|
|
|
and ddgr.device_group_id = #{deviceGroupId} |
|
|
and ddgr.device_group_id = #{deviceGroupId} |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
</where> |
|
|
</where> |
|
|
@ -149,9 +152,6 @@ |
|
|
<include refid="deviceDataFromAndJoin"/> |
|
|
<include refid="deviceDataFromAndJoin"/> |
|
|
left join device_rawdata_realtime drr on drr.device_id = device_info.device_id |
|
|
left join device_rawdata_realtime drr on drr.device_id = device_info.device_id |
|
|
<where> |
|
|
<where> |
|
|
<if test="buildingId != null"> |
|
|
|
|
|
and basic_building.building_id = #{buildingId} |
|
|
|
|
|
</if> |
|
|
|
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
</where> |
|
|
</where> |
|
|
<include refid="drrOrder"/> |
|
|
<include refid="drrOrder"/> |
|
|
@ -168,9 +168,6 @@ |
|
|
left join device_rawdata_realtime drr on drr.device_id = device_info.device_id |
|
|
left join device_rawdata_realtime drr on drr.device_id = device_info.device_id |
|
|
left join dashboard_device_group_relation ddgr on ddgr.device_info_id = device_info.id |
|
|
left join dashboard_device_group_relation ddgr on ddgr.device_info_id = device_info.id |
|
|
<where> |
|
|
<where> |
|
|
<if test="buildingId != null"> |
|
|
|
|
|
and basic_building.building_id = #{buildingId} |
|
|
|
|
|
</if> |
|
|
|
|
|
and ddgr.device_group_id = #{deviceGroupId} |
|
|
and ddgr.device_group_id = #{deviceGroupId} |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
</where> |
|
|
</where> |
|
|
@ -228,9 +225,6 @@ |
|
|
<include refid="deviceDataFromAndJoin"/> |
|
|
<include refid="deviceDataFromAndJoin"/> |
|
|
left join ba_status_statistics bss on bss.device_info_id = device_info.id |
|
|
left join ba_status_statistics bss on bss.device_info_id = device_info.id |
|
|
<where> |
|
|
<where> |
|
|
<if test="buildingId != null"> |
|
|
|
|
|
and basic_building.building_id = #{buildingId} |
|
|
|
|
|
</if> |
|
|
|
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
</where> |
|
|
</where> |
|
|
<include refid="BaStatusOrder"/> |
|
|
<include refid="BaStatusOrder"/> |
|
|
@ -251,9 +245,6 @@ |
|
|
left join dashboard_device_group_relation ddgr on ddgr.device_info_id = device_info.id |
|
|
left join dashboard_device_group_relation ddgr on ddgr.device_info_id = device_info.id |
|
|
left join ba_status_statistics bss on bss.device_info_id = device_info.id |
|
|
left join ba_status_statistics bss on bss.device_info_id = device_info.id |
|
|
<where> |
|
|
<where> |
|
|
<if test="buildingId != null"> |
|
|
|
|
|
and basic_building.building_id = #{buildingId} |
|
|
|
|
|
</if> |
|
|
|
|
|
and ddgr.device_group_id = #{deviceGroupId} |
|
|
and ddgr.device_group_id = #{deviceGroupId} |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
</where> |
|
|
</where> |
|
|
@ -343,9 +334,6 @@ |
|
|
<where> |
|
|
<where> |
|
|
and device_info.flag = 0 and basic_monitoring_asset.flag != 1 |
|
|
and device_info.flag = 0 and basic_monitoring_asset.flag != 1 |
|
|
and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1 |
|
|
and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1 |
|
|
<if test="buildingId != null"> |
|
|
|
|
|
and basic_building.building_id = #{buildingId} |
|
|
|
|
|
</if> |
|
|
|
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
<choose> |
|
|
<choose> |
|
|
<when test="searchType == 1"> |
|
|
<when test="searchType == 1"> |
|
|
@ -407,9 +395,6 @@ |
|
|
<where> |
|
|
<where> |
|
|
and device_info.flag = 0 and basic_monitoring_asset.flag != 1 |
|
|
and device_info.flag = 0 and basic_monitoring_asset.flag != 1 |
|
|
and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1 |
|
|
and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1 |
|
|
<if test="buildingId != null"> |
|
|
|
|
|
and basic_building.building_id = #{buildingId} |
|
|
|
|
|
</if> |
|
|
|
|
|
and ddgr.device_group_id = #{deviceGroupId} |
|
|
and ddgr.device_group_id = #{deviceGroupId} |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
<choose> |
|
|
<choose> |
|
|
@ -438,9 +423,6 @@ |
|
|
<include refid="deviceDataFromAndJoin"/> |
|
|
<include refid="deviceDataFromAndJoin"/> |
|
|
left join device_rawdata_realtime drr on drr.device_id = device_info.device_id |
|
|
left join device_rawdata_realtime drr on drr.device_id = device_info.device_id |
|
|
<where> |
|
|
<where> |
|
|
<if test="buildingId != null"> |
|
|
|
|
|
and basic_building.building_id = #{buildingId} |
|
|
|
|
|
</if> |
|
|
|
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
</where> |
|
|
</where> |
|
|
<include refid="drrOrder"/> |
|
|
<include refid="drrOrder"/> |
|
|
@ -457,9 +439,6 @@ |
|
|
left join device_rawdata_realtime drr on drr.device_id = device_info.device_id |
|
|
left join device_rawdata_realtime drr on drr.device_id = device_info.device_id |
|
|
left join dashboard_device_group_relation ddgr on ddgr.device_info_id = device_info.id |
|
|
left join dashboard_device_group_relation ddgr on ddgr.device_info_id = device_info.id |
|
|
<where> |
|
|
<where> |
|
|
<if test="buildingId != null"> |
|
|
|
|
|
and basic_building.building_id = #{buildingId} |
|
|
|
|
|
</if> |
|
|
|
|
|
and ddgr.device_group_id = #{deviceGroupId} |
|
|
and ddgr.device_group_id = #{deviceGroupId} |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
</where> |
|
|
</where> |
|
|
|