package com.nokia.financeapi.dao.house; import com.nokia.financeapi.pojo.dto.GetBuildingAreaStatDto; import com.nokia.financeapi.pojo.dto.GetLandBuildingStatDto; import com.nokia.financeapi.pojo.vo.GetBuildingAreaStatVo; import com.nokia.financeapi.pojo.vo.GetLandBuildingStatVo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.List; @Mapper public interface HouseResourceMapMapper { /** * 获取全省或地市的建筑面积统计 */ @Select(""" """) GetBuildingAreaStatVo getBuildingAreaStat(@Param("dto") GetBuildingAreaStatDto dto); /** * 统计各个地市的建筑和土地数量 */ @Select(""" with t1 as ( select city as area_name, count(1) as building_count from house.building_month where year_month = ( select max(year_month) from house.building_month) group by city ), t2 as ( select city as area_name, count(1) as land_count from house.land_month where year_month = ( select max(year_month) from house.land_month) group by city ) select t1.area_name, t1.building_count, t2.land_count from t1 join t2 on t1.area_name = t2.area_name order by t1.area_name """) List getCityLandBuildingStat(); /** * 统计某地市各个区县的建筑和土地数量 */ @Select(""" """) List getDistrictLandBuildingStat(@Param("dto") GetLandBuildingStatDto dto); }