|
@ -5,7 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
<mapper namespace="com.zc.business.mapper.DcGantryStatisticsDataMapper"> |
|
|
<mapper namespace="com.zc.business.mapper.DcGantryStatisticsDataMapper"> |
|
|
<resultMap type="map" id="countMap"> |
|
|
<resultMap type="map" id="countMap"> |
|
|
<result property="volume" column="total_traffic_volume"/> |
|
|
<result property="volume" column="total_traffic_volume"/> |
|
|
<result property="name" column="interval_name"/> |
|
|
<result property="name" column="facility_name"/> |
|
|
<result property="totalPassengerFlow" column="total_passenger_flow"/> |
|
|
<result property="totalPassengerFlow" column="total_passenger_flow"/> |
|
|
<result property="typeSpecialVehicleFlow" column="type_special_vehicle_flow"/> |
|
|
<result property="typeSpecialVehicleFlow" column="type_special_vehicle_flow"/> |
|
|
<result property="typeTruckFlow" column="type_truck_flow"/> |
|
|
<result property="typeTruckFlow" column="type_truck_flow"/> |
|
@ -204,75 +204,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
|
|
|
|
|
<select id="realTimeTrafficFlow" resultMap="countMap" resultType="map" > |
|
|
<select id="realTimeTrafficFlow" resultMap="countMap" resultType="map" > |
|
|
SELECT |
|
|
SELECT |
|
|
intervals.interval_name, |
|
|
ps.facility_code, |
|
|
intervals.stake_make, |
|
|
ps.facility_name, |
|
|
intervals.end_make, |
|
|
|
|
|
COALESCE(SUM(dgsd.traffic_volume), 0) AS total_traffic_volume, |
|
|
COALESCE(SUM(dgsd.traffic_volume), 0) AS total_traffic_volume, |
|
|
COALESCE(SUM(dgsd.type1_passenger_flow), 0) + |
|
|
COALESCE(SUM(dgsd.type1_passenger_flow), 0) + |
|
|
COALESCE(SUM(dgsd.type2_passenger_flow), 0) + |
|
|
COALESCE(SUM(dgsd.type2_passenger_flow), 0) + |
|
|
COALESCE(SUM(dgsd.type3_passenger_flow), 0) + |
|
|
COALESCE(SUM(dgsd.type3_passenger_flow), 0) + |
|
|
COALESCE(SUM(dgsd.type4_passenger_flow), 0) AS total_passenger_flow, |
|
|
COALESCE(SUM(dgsd.type4_passenger_flow), 0) AS total_passenger_flow, |
|
|
|
|
|
|
|
|
COALESCE(SUM(dgsd.type1_truck_flow ), 0) + |
|
|
COALESCE(SUM(dgsd.type1_truck_flow), 0) + |
|
|
COALESCE(SUM(dgsd.type2_truck_flow ), 0) + |
|
|
COALESCE(SUM(dgsd.type2_truck_flow), 0) + |
|
|
COALESCE(SUM(dgsd.type3_truck_flow ), 0) + |
|
|
COALESCE(SUM(dgsd.type3_truck_flow), 0) + |
|
|
COALESCE(SUM(dgsd.type4_truck_flow ), 0) + |
|
|
COALESCE(SUM(dgsd.type4_truck_flow), 0) + |
|
|
COALESCE(SUM(dgsd.type5_truck_flow ), 0) + |
|
|
COALESCE(SUM(dgsd.type5_truck_flow), 0) + |
|
|
COALESCE(SUM(dgsd.type6_truck_flow ), 0) AS type_truck_flow, |
|
|
COALESCE(SUM(dgsd.type6_truck_flow), 0) AS type_truck_flow, |
|
|
|
|
|
|
|
|
COALESCE(SUM(dgsd.type1_special_vehicle_flow ), 0) + |
|
|
|
|
|
COALESCE(SUM(dgsd.type2_special_vehicle_flow ), 0) + |
|
|
|
|
|
COALESCE(SUM(dgsd.type3_special_vehicle_flow ), 0) + |
|
|
|
|
|
COALESCE(SUM(dgsd.type4_special_vehicle_flow ), 0) + |
|
|
|
|
|
COALESCE(SUM(dgsd.type5_special_vehicle_flow ), 0) + |
|
|
|
|
|
COALESCE(SUM(dgsd.type6_special_vehicle_flow ), 0) AS type_special_vehicle_flow |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COALESCE(SUM(dgsd.type1_special_vehicle_flow), 0) + |
|
|
|
|
|
COALESCE(SUM(dgsd.type2_special_vehicle_flow), 0) + |
|
|
|
|
|
COALESCE(SUM(dgsd.type3_special_vehicle_flow), 0) + |
|
|
|
|
|
COALESCE(SUM(dgsd.type4_special_vehicle_flow), 0) + |
|
|
|
|
|
COALESCE(SUM(dgsd.type5_special_vehicle_flow), 0) + |
|
|
|
|
|
COALESCE(SUM(dgsd.type6_special_vehicle_flow), 0) AS type_special_vehicle_flow |
|
|
FROM |
|
|
FROM |
|
|
( |
|
|
dc_facility ps |
|
|
SELECT 'K054+394' AS stake_make, 'K059+289' AS end_make, '殷家林枢纽' AS interval_name UNION ALL |
|
|
LEFT JOIN |
|
|
SELECT 'K059+289', 'K072+847', '大学城立交' UNION ALL |
|
|
dc_gantry_statistics_data dgsd ON ps.facility_code = dgsd.gantry_code |
|
|
SELECT 'K072+847', 'K083+835', '长清立交' UNION ALL |
|
|
AND dgsd.period_type = #{periodType} |
|
|
SELECT 'K083+835', 'K086+499', '松竹枢纽' UNION ALL |
|
|
AND ( |
|
|
SELECT 'K086+499', 'K099+750', '孝里立交' UNION ALL |
|
|
|
|
|
SELECT 'K099+750', 'K105+904', '平阴北立交' UNION ALL |
|
|
|
|
|
SELECT 'K105+904', 'K117+878', '平阴立交' UNION ALL |
|
|
|
|
|
SELECT 'K117+878', 'K126+233', '孔村枢纽' UNION ALL |
|
|
|
|
|
SELECT 'K126+233', 'K133+588', '平阴南立交' UNION ALL |
|
|
|
|
|
SELECT 'K133+588', 'K145+933', '魏雪枢纽' UNION ALL |
|
|
|
|
|
SELECT 'K145+933', 'K155+652', '东平立交' UNION ALL |
|
|
|
|
|
SELECT 'K155+652', 'K173+950', '东平湖枢纽' UNION ALL |
|
|
|
|
|
SELECT 'K173+950', 'K179+396', '梁山东立交' UNION ALL |
|
|
|
|
|
SELECT 'K179+396', 'K182+987', '梁山立交' UNION ALL |
|
|
|
|
|
SELECT 'K182+987', 'K190+495', '信楼枢纽' UNION ALL |
|
|
|
|
|
SELECT 'K190+495', 'K202+979', '嘉祥西立交' |
|
|
|
|
|
)AS intervals |
|
|
|
|
|
LEFT JOIN ( |
|
|
|
|
|
SELECT |
|
|
|
|
|
facility_code, |
|
|
|
|
|
stake_mark, |
|
|
|
|
|
facility_name, |
|
|
|
|
|
direction |
|
|
|
|
|
FROM |
|
|
|
|
|
dc_facility |
|
|
|
|
|
WHERE |
|
|
|
|
|
direction = #{direction} |
|
|
|
|
|
) AS ps ON ps.stake_mark BETWEEN CONCAT(intervals.stake_make, '+0') AND CONCAT(intervals.end_make, '+0') |
|
|
|
|
|
LEFT JOIN dc_gantry_statistics_data dgsd ON ps.facility_code = dgsd.gantry_code |
|
|
|
|
|
AND |
|
|
|
|
|
<if test="periodType == 1"> |
|
|
<if test="periodType == 1"> |
|
|
YEAR(dgsd.statistical_date) = #{startDate} |
|
|
YEAR(dgsd.statistical_date) = #{startDate} |
|
|
</if> |
|
|
</if> |
|
|
<if test="periodType == 3"> |
|
|
<if test="periodType == 3"> |
|
|
DATE_FORMAT(dgsd.statistical_date, '%Y-%m')= #{startDate} |
|
|
DATE_FORMAT(dgsd.statistical_date, '%Y-%m') = #{startDate} |
|
|
</if> |
|
|
</if> |
|
|
<if test="periodType == 4"> |
|
|
<if test="periodType == 4"> |
|
|
DATE(dgsd.statistical_date) = DATE(#{startDate}) |
|
|
DATE(dgsd.statistical_date) = DATE(#{startDate}) |
|
|
</if> |
|
|
</if> |
|
|
AND dgsd.period_type =#{periodType} |
|
|
) |
|
|
|
|
|
WHERE |
|
|
|
|
|
ps.direction = #{direction} |
|
|
|
|
|
AND ps.facility_type = '10' |
|
|
GROUP BY |
|
|
GROUP BY |
|
|
intervals.interval_name, |
|
|
ps.facility_code, |
|
|
intervals.stake_make, |
|
|
ps.facility_name; |
|
|
intervals.end_make; |
|
|
|
|
|
|
|
|
|
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|