|
@@ -197,7 +197,7 @@ where
|
|
and district = #{dto.district}
|
|
and district = #{dto.district}
|
|
order by
|
|
order by
|
|
building_area desc
|
|
building_area desc
|
|
-limit 1
|
|
|
|
|
|
+limit 10
|
|
),
|
|
),
|
|
t102 as (
|
|
t102 as (
|
|
select
|
|
select
|
|
@@ -237,12 +237,11 @@ from
|
|
t103
|
|
t103
|
|
order by
|
|
order by
|
|
building_area desc
|
|
building_area desc
|
|
-limit 150
|
|
|
|
""")
|
|
""")
|
|
List<GetBuildingMapVo> getBuildingByDistrict(@Param("dto") GetBuildingMapDto dto);
|
|
List<GetBuildingMapVo> getBuildingByDistrict(@Param("dto") GetBuildingMapDto dto);
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 获取坐标范围内的建筑,相同局址保留建筑面积最大的
|
|
|
|
|
|
+ * 获取坐标范围内的建筑,相同坐标保留建筑面积最大的
|
|
*/
|
|
*/
|
|
@Select("""
|
|
@Select("""
|
|
with
|
|
with
|
|
@@ -425,7 +424,7 @@ order by create_time desc
|
|
List<GetHouseNoticeVo> getNotice(@Param("dto") GetHouseNoticeDto dto);
|
|
List<GetHouseNoticeVo> getNotice(@Param("dto") GetHouseNoticeDto dto);
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 获取区县内的建筑,相同局址保留建筑面积最大的
|
|
|
|
|
|
+ * 获取区县内的建筑,相同坐标保留建筑面积最大的
|
|
*/
|
|
*/
|
|
@Select("""
|
|
@Select("""
|
|
with
|
|
with
|
|
@@ -486,4 +485,128 @@ order by
|
|
building_area desc
|
|
building_area desc
|
|
""")
|
|
""")
|
|
List<GetBuildingOptionsVo> getBuildingOptions(@Param("dto") GetBuildingOptionsDto dto);
|
|
List<GetBuildingOptionsVo> getBuildingOptions(@Param("dto") GetBuildingOptionsDto dto);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取省本部建筑选项,相同坐标保留建筑面积最大的
|
|
|
|
+ */
|
|
|
|
+ @Select("""
|
|
|
|
+with
|
|
|
|
+t101 as (
|
|
|
|
+select
|
|
|
|
+ distinct on
|
|
|
|
+ (lng_bd09, lat_bd09) *
|
|
|
|
+from
|
|
|
|
+ house.building_month
|
|
|
|
+where
|
|
|
|
+ lng_bd09 is not null
|
|
|
|
+ and lat_bd09 is not null
|
|
|
|
+ and year_month = #{dto.endDate}
|
|
|
|
+ and area_name = #{dto.city}
|
|
|
|
+order by
|
|
|
|
+ lng_bd09,
|
|
|
|
+ lat_bd09,
|
|
|
|
+ building_area desc
|
|
|
|
+),
|
|
|
|
+t102 as (
|
|
|
|
+select
|
|
|
|
+ building_id,
|
|
|
|
+ sum(amount) as maintenance_cost
|
|
|
|
+from
|
|
|
|
+ house.building_repair_main_month
|
|
|
|
+where
|
|
|
|
+ repair_type != '财务预提冲销'
|
|
|
|
+ and exists (select 1 from t101 where t101.building_id = house.building_repair_main_month.building_id)
|
|
|
|
+ and year_month >= #{dto.startDate}
|
|
|
|
+ and year_month <= #{dto.endDate}
|
|
|
|
+group by
|
|
|
|
+ building_id
|
|
|
|
+),
|
|
|
|
+t103 as (
|
|
|
|
+select
|
|
|
|
+t101.*,
|
|
|
|
+t102.maintenance_cost
|
|
|
|
+from t101 left join t102 on t101.building_id = t102.building_id
|
|
|
|
+)
|
|
|
|
+select
|
|
|
|
+ building_id,
|
|
|
|
+ address,
|
|
|
|
+ area_sector,
|
|
|
|
+ building_name,
|
|
|
|
+ acquisition_date,
|
|
|
|
+ building_use,
|
|
|
|
+ building_area,
|
|
|
|
+ building_area_idle,
|
|
|
|
+ building_area_rent,
|
|
|
|
+ round(maintenance_cost, 2) as maintenance_cost,
|
|
|
|
+ building_img,
|
|
|
|
+ lng_bd09 as lng,
|
|
|
|
+ lat_bd09 as lat
|
|
|
|
+from
|
|
|
|
+ t103
|
|
|
|
+order by
|
|
|
|
+ building_area desc
|
|
|
|
+""")
|
|
|
|
+ List<GetBuildingOptionsVo> getSbbBuildingOptions(@Param("dto") GetBuildingOptionsDto dto);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取省本部建筑,相同坐标保留建筑面积最大的
|
|
|
|
+ */
|
|
|
|
+ @Select("""
|
|
|
|
+with
|
|
|
|
+t101 as (
|
|
|
|
+select
|
|
|
|
+ distinct on
|
|
|
|
+ (lng_bd09, lat_bd09) *
|
|
|
|
+from
|
|
|
|
+ house.building_month
|
|
|
|
+where
|
|
|
|
+ lng_bd09 is not null
|
|
|
|
+ and lat_bd09 is not null
|
|
|
|
+ and year_month = #{dto.endDate}
|
|
|
|
+ and area_name = #{dto.city}
|
|
|
|
+order by
|
|
|
|
+ lng_bd09,
|
|
|
|
+ lat_bd09,
|
|
|
|
+ building_area desc
|
|
|
|
+),
|
|
|
|
+t102 as (
|
|
|
|
+select
|
|
|
|
+ building_id,
|
|
|
|
+ sum(amount) as maintenance_cost
|
|
|
|
+from
|
|
|
|
+ house.building_repair_main_month
|
|
|
|
+where
|
|
|
|
+ repair_type != '财务预提冲销'
|
|
|
|
+ and exists (select 1 from t101 where t101.building_id = house.building_repair_main_month.building_id)
|
|
|
|
+ and year_month >= #{dto.startDate}
|
|
|
|
+ and year_month <= #{dto.endDate}
|
|
|
|
+group by
|
|
|
|
+ building_id
|
|
|
|
+),
|
|
|
|
+t103 as (
|
|
|
|
+select
|
|
|
|
+t101.*,
|
|
|
|
+t102.maintenance_cost
|
|
|
|
+from t101 left join t102 on t101.building_id = t102.building_id
|
|
|
|
+)
|
|
|
|
+select
|
|
|
|
+ building_id,
|
|
|
|
+ address,
|
|
|
|
+ area_sector,
|
|
|
|
+ building_name,
|
|
|
|
+ acquisition_date,
|
|
|
|
+ building_use,
|
|
|
|
+ building_area,
|
|
|
|
+ building_area_idle,
|
|
|
|
+ building_area_rent,
|
|
|
|
+ round(maintenance_cost, 2) as maintenance_cost,
|
|
|
|
+ building_img,
|
|
|
|
+ lng_bd09 as lng,
|
|
|
|
+ lat_bd09 as lat
|
|
|
|
+from
|
|
|
|
+ t103
|
|
|
|
+order by
|
|
|
|
+ building_area desc
|
|
|
|
+""")
|
|
|
|
+ List<GetBuildingMapVo> getSbbBuildings(@Param("dto") GetBuildingMapDto dto);
|
|
}
|
|
}
|