Browse Source

新增车牌识别统计

develop
王兴琳 1 day ago
parent
commit
30e915973d
  1. 4
      zc-business/src/main/java/com/zc/business/controller/DcTrafficStatisticsController.java
  2. 2
      zc-business/src/main/java/com/zc/business/mapper/DcGantryStatisticsDataMapper.java
  3. 2
      zc-business/src/main/java/com/zc/business/service/IDcGantryStatisticsDataService.java
  4. 16
      zc-business/src/main/java/com/zc/business/service/impl/DcGantryStatisticsDataImpl.java
  5. 21
      zc-business/src/main/resources/mapper/business/DcGantryStatisticsDataMapper.xml

4
zc-business/src/main/java/com/zc/business/controller/DcTrafficStatisticsController.java

@ -259,9 +259,9 @@ public class DcTrafficStatisticsController extends BaseController {
*/
@ApiOperation("交通流统计")
@GetMapping("/history/trafficFlowStatistics")
public TableDataInfo trafficFlowStatistics(String startDate, String endDate, String direction, String periodType) {
public TableDataInfo trafficFlowStatistics(String startDate, String endDate, String direction, String periodType, String facilityName) {
startPage();
List<Map<String, String>> mapList = dcGantryStatisticsDataService.trafficFlowStatistics(startDate, endDate, direction, periodType);
List<Map<String, String>> mapList = dcGantryStatisticsDataService.trafficFlowStatistics(startDate, endDate, direction, periodType,facilityName);
// 将查询结果封装为成功响应并返回
return getDataTable(mapList);
}

2
zc-business/src/main/java/com/zc/business/mapper/DcGantryStatisticsDataMapper.java

@ -57,7 +57,7 @@ public interface DcGantryStatisticsDataMapper extends BaseMapper<DcGantryStatist
* @param periodType
* @return
*/
List<Map<String, String>> trafficFlowStatistics(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("direction")String direction, @Param("periodType")String periodType);
List<Map<String, String>> trafficFlowStatistics(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("direction")String direction, @Param("periodType")String periodType, @Param("facilityName")String facilityName);
//桩号升序排列
List<TrafficFlowStatisticsMap> trafficFlowStatisticsAsc(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("direction")String direction, @Param("periodType")String periodType);

2
zc-business/src/main/java/com/zc/business/service/IDcGantryStatisticsDataService.java

@ -54,7 +54,7 @@ public interface IDcGantryStatisticsDataService extends IService<DcGantryStatist
List<Map<String, String>> trafficPeriodAnalysis(String startDate, String direction, String periodType);
List<Map<String, String>> trafficFlowStatistics(String startDate, String endDate, String direction, String periodType);
List<Map<String, String>> trafficFlowStatistics(String startDate, String endDate, String direction, String periodType,String facilityName);
//桩号升序排列
List<TrafficFlowStatisticsMap> trafficFlowStatisticsAsc(String startDate, String endDate, String direction, String periodType);

16
zc-business/src/main/java/com/zc/business/service/impl/DcGantryStatisticsDataImpl.java

@ -214,12 +214,12 @@ public class DcGantryStatisticsDataImpl extends ServiceImpl<DcGantryStatisticsDa
@Override
public List<Map<String, String>> realTimeTrafficFlow(String startDate, String direction, String periodType ) {
List<Map<String, String>> mapList = dcGantryStatisticsDataMapper.realTimeTrafficFlow(startDate, direction, periodType);
/*
// 过滤孝里虚-平阴北虚 和 平阴北虚-孝里虚的数据
List<Map<String, String>> filteredList = mapList.stream()
.filter(map -> !"孝里虚-平阴北虚".equals(map.get("name")) && !"平阴北虚-孝里虚".equals(map.get("name")))
.collect(Collectors.toList());
return filteredList;
.collect(Collectors.toList());*/
return mapList;
}
/**
* 车流量时段分析
@ -233,9 +233,9 @@ public class DcGantryStatisticsDataImpl extends ServiceImpl<DcGantryStatisticsDa
}
@Override
public List<Map<String, String>> trafficFlowStatistics(String startDate, String endDate, String direction, String periodType) {
public List<Map<String, String>> trafficFlowStatistics(String startDate, String endDate, String direction, String periodType,String facilityName) {
return dcGantryStatisticsDataMapper.trafficFlowStatistics(startDate,endDate,direction,periodType);
return dcGantryStatisticsDataMapper.trafficFlowStatistics(startDate,endDate,direction,periodType,facilityName);
}
//桩号升序排列
@Override
@ -247,12 +247,12 @@ public class DcGantryStatisticsDataImpl extends ServiceImpl<DcGantryStatisticsDa
@Override
public List<Map<String, String>> sectionTrafficRanking(String startDate, String direction, String periodType) {
List<Map<String, String>> mapList = dcGantryStatisticsDataMapper.sectionTrafficRanking(startDate, direction, periodType);
/*
// 孝里虚-平阴北虚 或 平阴北虚-孝里虚的数据
List<Map<String, String>> filteredList = mapList.stream()
.filter(map ->! "孝里虚-平阴北虚".equals(map.get("facilityName")) && !"平阴北虚-孝里虚".equals(map.get("facilityName")))
.collect(Collectors.toList());
return filteredList;
.collect(Collectors.toList());*/
return mapList;
}
public List<Map<String, String>> aggregateTrafficVolume(List<Map<String, Object>> dataList) {

21
zc-business/src/main/resources/mapper/business/DcGantryStatisticsDataMapper.xml

@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="statisticalDate" column="statistical_date"/>
<result property="facilityName" column="facility_name"/>
<result property="trafficVolume" column="traffic_volume"/>
<result property="traffiVolumePlate" column="traffic_volume_plate"/>
<result property="periodType" column="period_type"/>
</resultMap>
<resultMap type="com.zc.business.domain.TrafficFlowStatisticsMap" id="trafficFlowStatistics">
@ -280,7 +281,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="trafficFlowStatistics" resultMap="trafficFlowStatisticsMap" resultType="map" >
SELECT
i.interval_name,
i.stake_make,
@ -288,7 +288,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ps.facility_code,
ps.facility_name,
ps.direction,
dgsd.traffic_volume ,
dgsd.traffic_volume AS traffic_volume,
dvps.traffic_volume AS traffic_volume_plate,
dgsd.statistical_date,
dgsd.period_type
FROM
@ -310,21 +311,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT 'K182+987', 'K190+495', '信楼枢纽-嘉祥西立交' UNION ALL
SELECT 'K190+495', 'K202+979', '嘉祥西立交-王官屯枢纽'
) AS i
JOIN dc_facility AS ps
JOIN dc_facility ps
ON ps.stake_mark BETWEEN CONCAT(i.stake_make, '+0') AND CONCAT(i.end_make, '+0')
<if test="direction != null">
AND ps.direction = #{direction}
</if>
JOIN dc_gantry_statistics_data AS dgsd
<if test="facilityName != null">
AND ps.facility_name = #{facilityName}
</if>
JOIN dc_gantry_statistics_data dgsd
ON ps.facility_code = dgsd.gantry_code
LEFT JOIN dc_gantry_vehicle_plate_statistics dvps
ON dvps.gantryid = dgsd.gantry_code
AND dvps.statistical_date = dgsd.statistical_date
AND dvps.period_type = dgsd.period_type
<where>
<if test="startDate != null">
AND DATE(dgsd.statistical_date) BETWEEN #{startDate} AND #{endDate}
</if>
<if test="periodType != null">
AND dgsd.period_type = #{periodType}
</if>
ORDER BY
dgsd.statistical_date DESC
</where>
ORDER BY dgsd.statistical_date DESC, i.stake_make
</select>
<!-- 桩号升序排列-->
<select id="trafficFlowStatisticsAsc" resultMap="trafficFlowStatistics" resultType="com.zc.business.domain.TrafficFlowStatisticsMap" >

Loading…
Cancel
Save