|
@@ -1,7 +1,9 @@
|
|
|
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.vo.GetCarMapStatVo;
|
|
|
import com.nokia.financeapi.pojo.vo.GetCarNoticeVo;
|
|
|
import com.nokia.financeapi.pojo.vo.GetCarTypeStatVo;
|
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
@@ -47,4 +49,115 @@ where
|
|
|
</script>
|
|
|
""")
|
|
|
GetCarTypeStatVo getCarTypeStat(@Param("dto") GetCarTypeStatDto dto);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取各个地市的车辆数量和低效数量统计
|
|
|
+ */
|
|
|
+ @Select("""
|
|
|
+with
|
|
|
+t101 as (
|
|
|
+select
|
|
|
+ city,
|
|
|
+ count(1) as total
|
|
|
+from
|
|
|
+ car.car_base_data_month
|
|
|
+where
|
|
|
+ nian_yue = (
|
|
|
+ select
|
|
|
+ max(nian_yue)
|
|
|
+ from
|
|
|
+ car.car_base_data_month)
|
|
|
+ and city is not null
|
|
|
+ and city != ''
|
|
|
+group by
|
|
|
+ city
|
|
|
+),
|
|
|
+t102 as (
|
|
|
+select
|
|
|
+ city,
|
|
|
+ count(1) as inefficiency_count
|
|
|
+from
|
|
|
+ car.car_di_xiao_month
|
|
|
+where
|
|
|
+ nian_yue = (
|
|
|
+ select
|
|
|
+ max(nian_yue)
|
|
|
+ from
|
|
|
+ car.car_di_xiao_month)
|
|
|
+ and city is not null
|
|
|
+ and city != ''
|
|
|
+group by
|
|
|
+ city
|
|
|
+),
|
|
|
+t103 as (
|
|
|
+select
|
|
|
+t101.*,
|
|
|
+t102.inefficiency_count
|
|
|
+from t101 left join t102 on t101.city = t102.city
|
|
|
+),
|
|
|
+t104 as (
|
|
|
+select
|
|
|
+city as area_name,
|
|
|
+total,
|
|
|
+coalesce(inefficiency_count, 0) as inefficiency_count
|
|
|
+from t103
|
|
|
+)
|
|
|
+select * from t104 order by area_name
|
|
|
+""")
|
|
|
+ List<GetCarMapStatVo> getCityCarMapStat();
|
|
|
+
|
|
|
+ @Select("""
|
|
|
+with
|
|
|
+t101 as (
|
|
|
+select
|
|
|
+ district,
|
|
|
+ count(1) as total
|
|
|
+from
|
|
|
+ car.car_base_data_month
|
|
|
+where
|
|
|
+ nian_yue = (
|
|
|
+ select
|
|
|
+ max(nian_yue)
|
|
|
+ from
|
|
|
+ car.car_base_data_month)
|
|
|
+ and district is not null
|
|
|
+ and district != ''
|
|
|
+ and city = #{dto.city}
|
|
|
+group by
|
|
|
+ district
|
|
|
+),
|
|
|
+t102 as (
|
|
|
+select
|
|
|
+ district,
|
|
|
+ count(1) as inefficiency_count
|
|
|
+from
|
|
|
+ car.car_di_xiao_month
|
|
|
+where
|
|
|
+ nian_yue = (
|
|
|
+ select
|
|
|
+ max(nian_yue)
|
|
|
+ from
|
|
|
+ car.car_di_xiao_month)
|
|
|
+ and district is not null
|
|
|
+ and district != ''
|
|
|
+ and city = #{dto.city}
|
|
|
+group by
|
|
|
+ district
|
|
|
+),
|
|
|
+t103 as (
|
|
|
+select
|
|
|
+t101.*,
|
|
|
+t102.inefficiency_count
|
|
|
+from t101 left join t102 on t101.district = t102.district
|
|
|
+),
|
|
|
+t104 as (
|
|
|
+select
|
|
|
+district as area_name,
|
|
|
+total,
|
|
|
+coalesce(inefficiency_count, 0) as inefficiency_count
|
|
|
+from t103
|
|
|
+)
|
|
|
+select * from t104 order by area_name
|
|
|
+""")
|
|
|
+ List<GetCarMapStatVo> getDistrictCarMapStat(@Param("dto") GetCarMapStatDto dto);
|
|
|
}
|