|
@@ -3,9 +3,11 @@ package com.nokia.financeapi.dao.car;
|
|
|
import com.nokia.financeapi.pojo.dto.GetCarMapStatDto;
|
|
|
import com.nokia.financeapi.pojo.dto.GetCarNoticeDto;
|
|
|
import com.nokia.financeapi.pojo.dto.GetCarTypeStatDto;
|
|
|
+import com.nokia.financeapi.pojo.dto.GetDriveStatDto;
|
|
|
import com.nokia.financeapi.pojo.vo.GetCarMapStatVo;
|
|
|
import com.nokia.financeapi.pojo.vo.GetCarNoticeVo;
|
|
|
import com.nokia.financeapi.pojo.vo.GetCarTypeStatVo;
|
|
|
+import com.nokia.financeapi.pojo.vo.GetDriveStatVo;
|
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
@@ -106,6 +108,9 @@ select * from t104 order by area_name
|
|
|
""")
|
|
|
List<GetCarMapStatVo> getCityCarMapStat();
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取某个地市各区县的车辆数量和低效数量统计
|
|
|
+ */
|
|
|
@Select("""
|
|
|
with
|
|
|
t101 as (
|
|
@@ -160,4 +165,99 @@ from t103
|
|
|
select * from t104 order by area_name
|
|
|
""")
|
|
|
List<GetCarMapStatVo> getDistrictCarMapStat(@Param("dto") GetCarMapStatDto dto);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取各个地市的行驶统计
|
|
|
+ */
|
|
|
+ @Select("""
|
|
|
+with
|
|
|
+t101 as (
|
|
|
+select
|
|
|
+ city,
|
|
|
+ avg(zong_li_cheng) as mileage,
|
|
|
+ avg(chu_qin_lv) as attendanceRate
|
|
|
+from
|
|
|
+ car.car_li_cheng_month
|
|
|
+where
|
|
|
+ year_no = (
|
|
|
+ select
|
|
|
+ max(year_no)
|
|
|
+ from
|
|
|
+ car.car_li_cheng_month)
|
|
|
+ and city is not null
|
|
|
+ and city != ''
|
|
|
+group by
|
|
|
+ city
|
|
|
+),
|
|
|
+t102 as (
|
|
|
+select
|
|
|
+ t101.*,
|
|
|
+ car.car_second_unit_sort.sort
|
|
|
+from
|
|
|
+ t101
|
|
|
+left join car.car_second_unit_sort on
|
|
|
+ t101.city = car.car_second_unit_sort.second_unit
|
|
|
+),
|
|
|
+t103 as (
|
|
|
+select
|
|
|
+ city as area_name,
|
|
|
+ round(mileage,
|
|
|
+ 2) as mileage,
|
|
|
+ round(attendanceRate * 100,
|
|
|
+ 2) as attendanceRate,
|
|
|
+ sort
|
|
|
+from
|
|
|
+ t102
|
|
|
+order by
|
|
|
+ sort desc
|
|
|
+)
|
|
|
+select
|
|
|
+ *
|
|
|
+from
|
|
|
+ t103
|
|
|
+""")
|
|
|
+ List<GetDriveStatVo> getCityDriveStat();
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取某个地市各个区县的行驶统计
|
|
|
+ */
|
|
|
+ @Select("""
|
|
|
+with
|
|
|
+t101 as (
|
|
|
+select
|
|
|
+ district,
|
|
|
+ avg(zong_li_cheng) as mileage,
|
|
|
+ avg(chu_qin_lv) as attendanceRate
|
|
|
+from
|
|
|
+ car.car_li_cheng_month
|
|
|
+where
|
|
|
+ year_no = (
|
|
|
+ select
|
|
|
+ max(year_no)
|
|
|
+ from
|
|
|
+ car.car_li_cheng_month)
|
|
|
+ and district is not null
|
|
|
+ and district != ''
|
|
|
+ and city = #{dto.city}
|
|
|
+group by
|
|
|
+ district
|
|
|
+),
|
|
|
+t102 as (
|
|
|
+select
|
|
|
+ district as area_name,
|
|
|
+ round(mileage,
|
|
|
+ 2) as mileage,
|
|
|
+ round(attendanceRate * 100,
|
|
|
+ 2) as attendanceRate
|
|
|
+from
|
|
|
+ t101
|
|
|
+order by
|
|
|
+ district
|
|
|
+)
|
|
|
+select
|
|
|
+ *
|
|
|
+from
|
|
|
+ t102
|
|
|
+""")
|
|
|
+ List<GetDriveStatVo> getDistrictDriveStat(GetDriveStatDto dto);
|
|
|
}
|