|
|
@ -6,6 +6,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<resultMap type="map" id="countMap"> |
|
|
|
<result property="volume" column="total_traffic_volume"/> |
|
|
|
<result property="name" column="interval_name"/> |
|
|
|
<result property="totalPassengerFlow" column="total_passenger_flow"/> |
|
|
|
<result property="typeSpecialVehicleFlow" column="type_special_vehicle_flow"/> |
|
|
|
<result property="typeTruckFlow" column="type_truck_flow"/> |
|
|
|
</resultMap> |
|
|
|
<resultMap type="map" id="trafficPeriodAnalysisMap"> |
|
|
|
<result property="gantryCode" column="gantry_code"/> |
|
|
@ -193,22 +196,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
intervals.interval_name, |
|
|
|
intervals.stake_make, |
|
|
|
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.type2_passenger_flow), 0) + |
|
|
|
COALESCE(SUM(dgsd.type3_passenger_flow), 0) + |
|
|
|
COALESCE(SUM(dgsd.type4_passenger_flow), 0) AS total_passenger_flow, |
|
|
|
|
|
|
|
COALESCE(SUM(dgsd.type1_truck_flow ), 0) + |
|
|
|
COALESCE(SUM(dgsd.type2_truck_flow ), 0) + |
|
|
|
COALESCE(SUM(dgsd.type3_truck_flow ), 0) + |
|
|
|
COALESCE(SUM(dgsd.type4_truck_flow ), 0) + |
|
|
|
COALESCE(SUM(dgsd.type5_truck_flow ), 0) + |
|
|
|
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 |
|
|
|
|
|
|
|
FROM |
|
|
|
( |
|
|
|
SELECT 'K054+394' AS stake_make, 'K059+289' AS end_make, '殷家林枢纽-大学城立交' AS interval_name UNION ALL |
|
|
|
SELECT 'K059+289', 'K072+847', '大学城立交-长清立交' UNION ALL |
|
|
|
SELECT 'K072+847', 'K083+835', '长清立交-松竹枢纽' UNION ALL |
|
|
|
SELECT 'K083+835', 'K086+499', '松竹枢纽-孝里立交' UNION ALL |
|
|
|
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', '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', 'K190+495', '梁山立交-嘉祥西立交' UNION ALL |
|
|
|
SELECT 'K054+394' AS stake_make, 'K059+289' AS end_make, '殷家林枢纽' AS interval_name UNION ALL |
|
|
|
SELECT 'K059+289', 'K072+847', '大学城立交' UNION ALL |
|
|
|
SELECT 'K072+847', 'K083+835', '长清立交' UNION ALL |
|
|
|
SELECT 'K083+835', 'K086+499', '松竹枢纽' UNION ALL |
|
|
|
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', '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', 'K190+495', '梁山立交' UNION ALL |
|
|
|
SELECT 'K190+495', 'K202+979', '嘉祥西立交' |
|
|
|
)AS intervals |
|
|
|
LEFT JOIN ( |
|
|
@ -223,7 +245,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
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 dgsd.statistical_date =#{startDate} |
|
|
|
AND |
|
|
|
<if test="periodType == 1"> |
|
|
|
YEAR(dgsd.statistical_date) = #{startDate} |
|
|
|
</if> |
|
|
|
<if test="periodType == 3"> |
|
|
|
DATE_FORMAT(dgsd.statistical_date, '%Y-%m')= #{startDate} |
|
|
|
</if> |
|
|
|
<if test="periodType == 4"> |
|
|
|
DATE(dgsd.statistical_date) = DATE(#{startDate}) |
|
|
|
</if> |
|
|
|
AND dgsd.period_type =#{periodType} |
|
|
|
GROUP BY |
|
|
|
intervals.interval_name, |
|
|
@ -251,7 +282,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="periodType == 1"> |
|
|
|
YEAR(dg.statistical_date) = #{startDate} |
|
|
|
</if> |
|
|
|
<if test="periodType == 2"> |
|
|
|
<if test="periodType == 3"> |
|
|
|
DATE_FORMAT(dg.statistical_date, '%Y-%m') = #{startDate} |
|
|
|
</if> |
|
|
|
<if test="periodType == 4"> |
|
|
@ -302,8 +333,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
AND dgsd.period_type = #{periodType} |
|
|
|
</if> |
|
|
|
ORDER BY |
|
|
|
dgsd.statistical_date DESC; |
|
|
|
|
|
|
|
dgsd.statistical_date DESC |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="sectionTrafficRanking" resultMap="trafficPeriodAnalysisMap" resultType="map" > |
|
|
|
SELECT |
|
|
|
fa.facility_code AS gantry_code, |
|
|
|
COALESCE(SUM(dg.traffic_volume), 0) AS traffic_volume, |
|
|
|
fa.facility_name, |
|
|
|
dg.period_type, |
|
|
|
MAX(dg.statistical_date) AS statistical_date |
|
|
|
FROM |
|
|
|
dc_facility AS fa |
|
|
|
LEFT JOIN |
|
|
|
dc_gantry_statistics_data AS dg |
|
|
|
ON |
|
|
|
fa.facility_code = dg.gantry_code |
|
|
|
AND |
|
|
|
<if test="periodType == 1"> |
|
|
|
YEAR(dg.statistical_date) = #{startDate} |
|
|
|
</if> |
|
|
|
<if test="periodType == 3"> |
|
|
|
DATE_FORMAT(dg.statistical_date, '%Y-%m') = #{startDate} |
|
|
|
</if> |
|
|
|
<if test="periodType == 4 or periodType == 5"> |
|
|
|
DATE(dg.statistical_date) = DATE(#{startDate}) |
|
|
|
</if> |
|
|
|
AND |
|
|
|
|
|
|
|
dg.period_type = #{periodType} |
|
|
|
WHERE |
|
|
|
fa.direction = #{direction} |
|
|
|
and fa.facility_type=10 |
|
|
|
GROUP BY |
|
|
|
fa.facility_code, |
|
|
|
fa.facility_name, |
|
|
|
dg.period_type |
|
|
|
ORDER BY |
|
|
|
traffic_volume DESC; |
|
|
|
|
|
|
|
</select> |
|
|
|
</mapper> |
|
|
|