。。。
This commit is contained in:
parent
093014b211
commit
2b413ba9e5
|
@ -1,6 +1,5 @@
|
||||||
package com.hisense.monitormanage.controller;
|
package com.hisense.monitormanage.controller;
|
||||||
|
|
||||||
import com.hisense.monitormanage.dto.BuildingRecordsDtos;
|
|
||||||
import com.hisense.monitormanage.dto.EventDto;
|
import com.hisense.monitormanage.dto.EventDto;
|
||||||
import com.hisense.monitormanage.dto.KeyAreaDto;
|
import com.hisense.monitormanage.dto.KeyAreaDto;
|
||||||
import com.hisense.monitormanage.dto.KeyAreaDtos;
|
import com.hisense.monitormanage.dto.KeyAreaDtos;
|
||||||
|
@ -67,7 +66,7 @@ public class KeyAreaController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("selectKeyArea")
|
@GetMapping("selectKeyArea")
|
||||||
@ApiOperation("根据区域类型查询区域的最新时间的人数")
|
@ApiOperation("根据区域类型查询区域的最新时间的人数")
|
||||||
public Result selectKeyArea(String type) {
|
public Result selectKeyArea(String type, String area_name) {
|
||||||
PassengerFlow maxId = passengerFlowMapper.getByMaxId();
|
PassengerFlow maxId = passengerFlowMapper.getByMaxId();
|
||||||
String timeId = maxId.getTimeId();
|
String timeId = maxId.getTimeId();
|
||||||
List<KeyAreaDto> keyAreaDtos = keyAreaMapper.selectKeyArea(type, timeId);
|
List<KeyAreaDto> keyAreaDtos = keyAreaMapper.selectKeyArea(type, timeId);
|
||||||
|
|
|
@ -39,4 +39,8 @@ public class KeyAreaDto {
|
||||||
|
|
||||||
private String picUrl;
|
private String picUrl;
|
||||||
|
|
||||||
|
private String phone; // 联系电话
|
||||||
|
|
||||||
|
private String manager; // 负责人
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,4 +29,8 @@ public class KeyArea {
|
||||||
|
|
||||||
private String channelName;
|
private String channelName;
|
||||||
|
|
||||||
|
private String phone; // 联系电话
|
||||||
|
|
||||||
|
private String manager; // 负责人
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,16 +39,43 @@
|
||||||
LEFT JOIN t_key_area_location kal ON kal.area_id = a.area_id
|
LEFT JOIN t_key_area_location kal ON kal.area_id = a.area_id
|
||||||
</select>
|
</select>
|
||||||
<select id="selectKeyArea" resultType="com.hisense.monitormanage.dto.KeyAreaDto">
|
<select id="selectKeyArea" resultType="com.hisense.monitormanage.dto.KeyAreaDto">
|
||||||
SELECT * FROM
|
SELECT
|
||||||
(SELECT ka.type,ka.location,ka.service_time,ka.management,ka.scenic_level,
|
*
|
||||||
ka.about,ka.area_id,ka.area_name,ka.channel_code,ka.channel_name,ss.allNums,ss.localNums,ss.nonlocalNums
|
FROM
|
||||||
FROM t_key_area ka LEFT JOIN
|
(
|
||||||
(SELECT pt.area_name,SUM(pf.all_nums) AS allNums,SUM(pf.local_nums) AS localNums,
|
SELECT
|
||||||
SUM(pf.nonlocal_nums) AS nonlocalNums
|
ka.type,
|
||||||
FROM t_passenger_flow pf JOIN t_passenger_test pt
|
ka.location,
|
||||||
ON pf.longitude = pt.longitude AND pf.latitude = pt.latitude
|
ka.service_time,
|
||||||
WHERE pf.time_id = #{timeId} AND pt.type = #{type} GROUP BY pt.area_name)
|
ka.management,
|
||||||
ss ON ka.area_name = ss.area_name WHERE ka.type = #{type}) a
|
ka.scenic_level,
|
||||||
|
ka.about,
|
||||||
|
ka.area_id,
|
||||||
|
ka.area_name,
|
||||||
|
ka.channel_code,
|
||||||
|
ka.channel_name,
|
||||||
|
ka.phone,
|
||||||
|
ka.manager,
|
||||||
|
ss.allNums,
|
||||||
|
ss.localNums,
|
||||||
|
ss.nonlocalNums
|
||||||
|
FROM
|
||||||
|
t_key_area ka
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
pt.area_name,
|
||||||
|
SUM( pf.all_nums ) AS allNums,
|
||||||
|
SUM( pf.local_nums ) AS localNums,
|
||||||
|
SUM( pf.nonlocal_nums ) AS nonlocalNums
|
||||||
|
FROM
|
||||||
|
t_passenger_flow pf
|
||||||
|
JOIN t_passenger_test pt ON pf.longitude = pt.longitude
|
||||||
|
AND pf.latitude = pt.latitude
|
||||||
|
WHERE
|
||||||
|
pf.time_id = #{timeId} AND pt.type = #{type} GROUP BY pt.area_name)
|
||||||
|
ss ON ka.area_name = ss.area_name
|
||||||
|
WHERE
|
||||||
|
ka.type = #{type}) a
|
||||||
LEFT JOIN t_key_area_location kal ON kal.area_id = a.area_id
|
LEFT JOIN t_key_area_location kal ON kal.area_id = a.area_id
|
||||||
</select>
|
</select>
|
||||||
<select id="selectByAreaEvent" resultType="com.hisense.monitormanage.dto.EventDto">
|
<select id="selectByAreaEvent" resultType="com.hisense.monitormanage.dto.EventDto">
|
||||||
|
|
Loading…
Reference in New Issue