|
@@ -1,9 +1,11 @@
|
|
|
package com.nokia.financeapi.dao.car;
|
|
|
|
|
|
+import com.nokia.financeapi.pojo.dto.GetCarCostStatDto;
|
|
|
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.GetCarCostStatVo;
|
|
|
import com.nokia.financeapi.pojo.vo.GetCarMapStatVo;
|
|
|
import com.nokia.financeapi.pojo.vo.GetCarNoticeVo;
|
|
|
import com.nokia.financeapi.pojo.vo.GetCarTypeStatVo;
|
|
@@ -259,5 +261,102 @@ select
|
|
|
from
|
|
|
t102
|
|
|
""")
|
|
|
- List<GetDriveStatVo> getDistrictDriveStat(GetDriveStatDto dto);
|
|
|
+ List<GetDriveStatVo> getDistrictDriveStat(@Param("dto") GetDriveStatDto dto);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取各个地市的费用统计
|
|
|
+ */
|
|
|
+ @Select("""
|
|
|
+with
|
|
|
+t101 as (
|
|
|
+select
|
|
|
+ city,
|
|
|
+ sum(zong_fei_yong) as cost_sum,
|
|
|
+ avg(zong_fei_yong) as cost_avg
|
|
|
+from
|
|
|
+ car.car_fei_yong_month
|
|
|
+where
|
|
|
+ year_no = (
|
|
|
+ select
|
|
|
+ max(year_no)
|
|
|
+ from
|
|
|
+ car.car_fei_yong_month)
|
|
|
+ and city is not null
|
|
|
+ and city != ''
|
|
|
+ and rui_xing = 1
|
|
|
+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(cost_sum,
|
|
|
+ 2) as cost_sum,
|
|
|
+ round(cost_avg,
|
|
|
+ 2) as cost_avg,
|
|
|
+ sort
|
|
|
+from
|
|
|
+ t102
|
|
|
+order by
|
|
|
+ sort desc
|
|
|
+)
|
|
|
+select
|
|
|
+ *
|
|
|
+from
|
|
|
+ t103
|
|
|
+""")
|
|
|
+ List<GetCarCostStatVo> getCityCostStat();
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取某个地市各个区县的费用统计
|
|
|
+ */
|
|
|
+ @Select("""
|
|
|
+with
|
|
|
+t101 as (
|
|
|
+select
|
|
|
+ district,
|
|
|
+ sum(zong_fei_yong) as cost_sum,
|
|
|
+ avg(zong_fei_yong) as cost_avg
|
|
|
+from
|
|
|
+ car.car_fei_yong_month
|
|
|
+where
|
|
|
+ year_no = (
|
|
|
+ select
|
|
|
+ max(year_no)
|
|
|
+ from
|
|
|
+ car.car_fei_yong_month)
|
|
|
+ and district is not null
|
|
|
+ and district != ''
|
|
|
+ and rui_xing = 1
|
|
|
+ and city = #{dto.city}
|
|
|
+group by
|
|
|
+ district
|
|
|
+),
|
|
|
+t102 as (
|
|
|
+select
|
|
|
+ district as area_name,
|
|
|
+ round(cost_sum,
|
|
|
+ 2) as cost_sum,
|
|
|
+ round(cost_avg,
|
|
|
+ 2) as cost_avg
|
|
|
+from
|
|
|
+ t101
|
|
|
+order by
|
|
|
+ district
|
|
|
+)
|
|
|
+select
|
|
|
+ *
|
|
|
+from
|
|
|
+ t102
|
|
|
+""")
|
|
|
+ List<GetCarCostStatVo> getDistrictCostStat(@Param("dto") GetCarCostStatDto dto);
|
|
|
}
|