123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- <?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.sooka.sponest.data.digitalfirecontrol.mapper.FireControlBigDataMapper">
- <parameterMap id="pm_VisuForestCloudMapVO"
- type="com.sooka.sponest.data.app.domain.VisuForestCloudMapVO"></parameterMap>
- <resultMap type="com.sooka.sponest.data.digitalforest.domain.bo.VisuForestCloudEventTypeBO" id="VisuForestCloudEventTypeBOResult">
- <result property="name" column="name"/>
- <result property="value" column="value"/>
- </resultMap>
- <resultMap type="CenterdataTForestWeatherinformation" id="CenterdataTForestWeatherinformationResult">
- <result property="id" column="id"/>
- <result property="weatherinformationTime" column="weatherinformation_time"/>
- <result property="weatherinformationWeather" column="weatherinformation_weather"/>
- <result property="weatherinformationPower" column="weatherinformation_power"/>
- <result property="weatherinformationDirection" column="weatherinformation_direction"/>
- <result property="weatherinformationLow" column="weatherinformation_low"/>
- <result property="weatherinformationHigh" column="weatherinformation_high"/>
- <result property="weatherinformationTemperature" column="weatherinformation_temperature"/>
- <result property="forestWeatherinformationLevel" column="forest_weatherinformation_level"/>
- <result property="createBy" column="create_by"/>
- <result property="createTime" column="create_time"/>
- <result property="updateBy" column="update_by"/>
- <result property="updateTime" column="update_time"/>
- <result property="dataStatus" column="data_status"/>
- <result property="deptId" column="dept_id"/>
- <result property="deptName" column="dept_name"/>
- </resultMap>
- <select id="selectBigDataWatercraneDeptCount" parameterType="CenterdataTForestWatercrane"
- resultMap="VisuForestCloudEventTypeBOResult">
- select a.dept_name name,count(a.id) value from centerdata_t_forest_watercrane a
- left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
- where 1=1 ${params.dataScope}
- group by a.dept_id,a.dept_name
- ORDER BY VALUE desc
- LIMIT 8
- </select>
- <select id="geFireControltTotal" parameterMap="pm_VisuForestCloudMapVO" resultType="map">
- select '水鹤' name,count(*) value from centerdata_t_forest_watercrane a
- left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
- where 1=1 ${params.dataScope}
- union all
- select '取水口' name,count(*) value from centerdata_t_forest_waterintake a
- left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
- where 1=1 ${params.dataScope}
- union all
- SELECT a.dict_label name,count(b.firehydrant_type) value FROM ${database_system}.sys_dict_data a left join
- (SELECT a.firehydrant_type FROM centerdata_t_forest_firehydrant a
- left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
- where 1=1 ${params.dataScope}) b on a.dict_value = b.firehydrant_type
- where a.dict_type = 'firehydrant'
- GROUP BY a.dict_value
- union all
- select '泡沫液' name,count(*) value from centerdata_t_firecontrol_foam_liquid a
- left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
- where 1=1 ${params.dataScope}
- union all
- select '消防力量' name,count(*) value from centerdata_t_firecontrol_fire_force a
- left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
- where 1=1 ${params.dataScope}
- union all
- select '专职站' name,count(*) value from centerdata_t_firecontrol_fulltime_station a
- left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
- where 1=1 ${params.dataScope}
- union all
- select '重点场所' name,count(*) value from centerdata_t_firecontrol_fire_key_places a
- left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
- where 1=1 ${params.dataScope}
- union all
- select '压力传感器' name,count(*) value from centerdata_t_firecontrol_fire_pressure_sensor a
- left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
- where 1=1 ${params.dataScope}
- union all
- select '基本联动力量' name,count(*) value from centerdata_t_firecontrol_basic_linkage_force a
- left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
- where 1=1 ${params.dataScope}
- union all
- select '其他联动力量' name,count(*) value from centerdata_t_firecontrol_other_linkage_force a
- left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
- where 1=1 ${params.dataScope}
- </select>
- <select id="selectBigDataWaterintakeDeptCount" parameterType="CenterdataTForestWaterintake"
- resultMap="VisuForestCloudEventTypeBOResult">
- select a.dept_name name,count(a.id) value from centerdata_t_forest_waterintake a
- left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
- where 1=1 ${params.dataScope}
- group by a.dept_id,a.dept_name
- ORDER BY VALUE DESC
- LIMIT 8;
- </select>
- <select id="selectBigDataByYearMonth" parameterType="CenterdataTForestWeatherinformationBigDataVO"
- resultMap="CenterdataTForestWeatherinformationResult">
- select date_format(weatherinformation_time,'%Y-%m-%d') weatherinformation_time, IFNULL(weatherinformation_low,'') weatherinformation_low, IFNULL(weatherinformation_high,'') weatherinformation_high
- from centerdata_t_forest_weatherinformation
- where weatherinformation_time like concat('%', #{day}, '%')
- order by weatherinformation_time asc
- </select>
- <select id="selectBigDataFirecontrolFulltimeStationDeptCount" parameterType="CenterdataTFirecontrolFulltimeStation"
- resultMap="VisuForestCloudEventTypeBOResult">
- select a.dept_name name,count(a.id) value from centerdata_t_firecontrol_fulltime_station a
- left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
- where 1=1 ${params.dataScope}
- group by a.dept_id,a.dept_name
- </select>
- <select id="selectBigDataFirehydrantDeptCount" parameterType="CenterdataTForestFirehydrant"
- resultMap="VisuForestCloudEventTypeBOResult">
- select a.dept_name name,count(a.id) value from centerdata_t_forest_firehydrant a
- left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
- where 1=1 ${params.dataScope}
- group by a.dept_id,a.dept_name
- </select>
- <select id="selectBigDataFirecontrolFoamLiquidDeptCount" parameterType="CenterdataTFirecontrolFoamLiquid"
- resultType="java.util.Map">
- SELECT
- d.ancestors AS ancestors,
- a.dept_id AS deptId,
- SUM( a.reserves ) AS reserves
- FROM
- centerdata_t_firecontrol_foam_liquid a
- LEFT JOIN ${database_system}.sys_dept d ON d.dept_id = a.dept_id
- WHERE 1 = 1 ${params.dataScope}
- GROUP BY
- a.dept_id,
- d.ancestors;
- </select>
- <select id="getbasiclinkageforeList" parameterType="CenterdataTFirecontrolBasicLinkageForce"
- resultType="map">
- SELECT d.ancestors ancestors,a.dept_id deptId,a.forklift_num forkliftNum,a.fire_fighting_truck_num fightingNum,a.fire_fighting_truck_tonnage ton
- from centerdata_t_firecontrol_basic_linkage_force a
- left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
- WHERE 1=1 ${params.dataScope}
- </select>
- <select id="getOtherlinkageforceList" parameterType="CenterdataTFirecontrolOtherLinkageForce" resultType="java.util.Map">
- SELECT
- a.dept_name AS 'name',
- count( a.id )
- as 'value'
- FROM
- centerdata_t_firecontrol_other_linkage_force a
- LEFT JOIN ${database_system}.sys_dept d ON d.dept_id = a.dept_id
- WHERE
- 1 = 1 ${params.dataScope}
- GROUP BY
- a.dept_id,
- a.dept_name
- </select>
- <select id="selectBigDataImportareaDeptCount" parameterType="CenterdataTForestImportarea"
- resultMap="VisuForestCloudEventTypeBOResult">
- select a.dept_name name,count(a.id) num from centerdata_t_forest_importarea a
- left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
- where a.area_type = #{areaType} ${params.dataScope}
- group by a.dept_name,a.dept_id
- </select>
- <select id="selectBigDataFireforceDeptCount" resultType="java.util.Map">
- select d.ancestors ancestors, a.dept_id deptId,count(a.id) value from centerdata_t_firecontrol_fire_force a
- left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
- where 1=1 ${params.dataScope}
- group by a.dept_id
- </select>
- <select id="selectBigDataNumWithDeptCount" parameterMap="pm_VisuForestCloudMapVO" resultType="map">
- SELECT a.ancestors,a.deptId,
- sum(CASE WHEN a.`name` = '消火栓' THEN a.value ELSE 0 END) AS 'fireHydrant',
- sum(CASE WHEN a.`name` = '取水口' THEN a.value ELSE 0 END) AS 'waterIntake',
- sum(CASE WHEN a.`name` = '水鹤' THEN a.value ELSE 0 END) AS 'waterCranes'
- FROM (
- SELECT d.ancestors ancestors, a.dept_id deptId, '水鹤' name, COUNT(*) value
- FROM centerdata_t_forest_watercrane a
- LEFT JOIN ${database_system}.sys_dept d ON d.dept_id = a.dept_id
- WHERE 1 = 1 ${params.dataScope}
- AND del_flag = 0
- GROUP BY a.dept_id
- UNION ALL
- SELECT d.ancestors ancestors, a.dept_id deptId, '取水口' name, COUNT(*) value
- FROM centerdata_t_forest_waterintake a
- LEFT JOIN ${database_system}.sys_dept d ON d.dept_id = a.dept_id
- WHERE 1 = 1 ${params.dataScope}
- AND del_flag = 0
- GROUP BY a.dept_id
- UNION ALL
- SELECT d.ancestors ancestors, a.dept_id deptId, '消火栓' name, COUNT(*) value
- FROM centerdata_t_forest_firehydrant a
- LEFT JOIN ${database_system}.sys_dept d ON d.dept_id = a.dept_id
- WHERE 1 = 1 ${params.dataScope}
- AND del_flag = 0
- GROUP BY a.dept_id
- ) a GROUP BY a.ancestors,a.deptId
- </select>
- <select id="selectKeyLocations" resultType="java.util.Map">
- SELECT d.ancestors ancestors,a.dept_id deptId,count(a.id) num
- FROM centerdata_t_firecontrol_fire_key_places a
- left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
- WHERE 1=1 ${params.dataScope}
- GROUP BY a.dept_id
- </select>
- </mapper>
|