7 changed files with 182 additions and 59 deletions
@ -0,0 +1,19 @@ |
|||||
|
package com.dongjian.dashboard.back.dao.ex; |
||||
|
|
||||
|
import com.dongjian.dashboard.back.vo.data.OverviewCategoryVO; |
||||
|
import com.dongjian.dashboard.back.vo.data.OverviewInfo; |
||||
|
import com.dongjian.dashboard.back.vo.data.OverviewVO; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface OverviewInfoMapperExt { |
||||
|
|
||||
|
List<OverviewInfo> getOverviewInfo(Map<String, Object> paramMap); |
||||
|
|
||||
|
List<OverviewVO> getBuildingInfo(Map<String, Object> buildingMap); |
||||
|
|
||||
|
List<OverviewCategoryVO> getExistingCategoryList(Map<String, Object> allCategoryParamMap); |
||||
|
} |
||||
@ -0,0 +1,77 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
<mapper namespace="com.dongjian.dashboard.back.dao.ex.OverviewInfoMapperExt"> |
||||
|
|
||||
|
|
||||
|
<select id="getOverviewInfo" resultType="com.dongjian.dashboard.back.vo.data.OverviewInfo"> |
||||
|
SELECT |
||||
|
bbuilding.building_id, |
||||
|
bbuilding.name AS buildingName, |
||||
|
ah.device_id, |
||||
|
ah.receive_ts, |
||||
|
basic_asset_class_big.id AS monitoringPointCategoryId, |
||||
|
basic_asset_class_big.class_name AS monitoringPointCategoryName |
||||
|
FROM |
||||
|
basic_building bbuilding |
||||
|
INNER JOIN basic_floor on basic_floor.building_id = bbuilding.building_id |
||||
|
INNER JOIN basic_space on basic_space.floor_id = basic_floor.floor_id |
||||
|
INNER JOIN basic_monitoring_asset on basic_monitoring_asset.space_id = basic_space.space_id |
||||
|
INNER JOIN device_info dinfo ON dinfo.asset_id = basic_monitoring_asset.equipment_id |
||||
|
INNER JOIN alert_history ah ON dinfo.device_id = ah.device_id |
||||
|
LEFT JOIN basic_asset_class_big on basic_asset_class_big.id = basic_monitoring_asset.class_big_id |
||||
|
LEFT JOIN type ty ON dinfo.type_id = ty.id |
||||
|
WHERE |
||||
|
bbuilding.company_id = #{companyId} AND bbuilding.flag = 0 AND basic_floor.flag = 0 AND basic_space.flag = 0 |
||||
|
AND basic_monitoring_asset.flag = 0 AND dinfo.flag = 0 AND basic_asset_class_big.flag = 0 |
||||
|
AND ah.confirm_status = 0 AND ah.handle_status = 1 |
||||
|
AND ty.device_category_id in |
||||
|
<foreach collection="categoryIdList" item="categoryId" open="(" separator="," close=")"> |
||||
|
#{categoryId} |
||||
|
</foreach> |
||||
|
</select> |
||||
|
|
||||
|
<select id="getBuildingInfo" resultType="com.dongjian.dashboard.back.vo.data.OverviewVO"> |
||||
|
SELECT |
||||
|
bbuilding.building_id, |
||||
|
bbuilding.name buildingName, |
||||
|
bbuilding.retain_alert, |
||||
|
bbuilding.latitude, |
||||
|
bbuilding.longitude, |
||||
|
bbuilding.picture_introduction, |
||||
|
bbuilding.udf_building_id |
||||
|
FROM |
||||
|
basic_building bbuilding |
||||
|
WHERE |
||||
|
bbuilding.flag != 1 |
||||
|
AND bbuilding.company_id = #{companyId} |
||||
|
<if test="bindBuildingIdList != null"> |
||||
|
AND bbuilding.building_id IN <foreach collection="bindBuildingIdList" item="item" open="(" separator="," close=")">#{item}</foreach> |
||||
|
</if> |
||||
|
order by bbuilding.building_id desc |
||||
|
</select> |
||||
|
|
||||
|
<select id="getExistingCategoryList" resultType="com.dongjian.dashboard.back.vo.data.OverviewCategoryVO"> |
||||
|
SELECT |
||||
|
bbuilding.building_id, |
||||
|
bbuilding.name AS buildingName, |
||||
|
dinfo.device_id, |
||||
|
basic_asset_class_big.id AS monitoringPointCategoryId, |
||||
|
basic_asset_class_big.class_name AS monitoringPointCategoryName |
||||
|
FROM |
||||
|
basic_building bbuilding |
||||
|
INNER JOIN basic_floor on basic_floor.building_id = bbuilding.building_id |
||||
|
INNER JOIN basic_space on basic_space.floor_id = basic_floor.floor_id |
||||
|
INNER JOIN basic_monitoring_asset on basic_monitoring_asset.space_id = basic_space.space_id |
||||
|
INNER JOIN device_info dinfo ON dinfo.asset_id = basic_monitoring_asset.equipment_id |
||||
|
LEFT JOIN basic_asset_class_big on basic_asset_class_big.id = basic_monitoring_asset.class_big_id |
||||
|
LEFT JOIN type ty ON dinfo.type_id = ty.id |
||||
|
WHERE |
||||
|
bbuilding.company_id = #{companyId} AND bbuilding.flag = 0 AND basic_floor.flag = 0 AND basic_space.flag = 0 |
||||
|
AND basic_monitoring_asset.flag = 0 AND dinfo.flag = 0 AND basic_asset_class_big.flag = 0 AND ty.flag = 0 |
||||
|
AND ty.device_category_id in |
||||
|
<foreach collection="categoryIdList" item="categoryId" open="(" separator="," close=")"> |
||||
|
#{categoryId} |
||||
|
</foreach> |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
@ -0,0 +1,23 @@ |
|||||
|
package com.dongjian.dashboard.back.vo.data; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
public class OverviewCategoryVO { |
||||
|
|
||||
|
private Long buildingId; |
||||
|
|
||||
|
private String buildingName; |
||||
|
|
||||
|
private String deviceId; |
||||
|
|
||||
|
private Long monitoringPointCategoryId; |
||||
|
|
||||
|
private String monitoringPointCategoryName; |
||||
|
|
||||
|
|
||||
|
} |
||||
Loading…
Reference in new issue