Prechádzať zdrojové kódy

fix: 修复不动产土地管理相关接口错误

weijianghai 10 mesiacov pred
rodič
commit
62b3980d5e

+ 215 - 215
src/main/java/com/example/controller/WzLandManageDetailsController.java

@@ -38,203 +38,203 @@ public class WzLandManageDetailsController {
     @Autowired
     private WzOtnAreaService otnAreaService;
 
-    @RequestMapping("/list")
-    @IgnoreAuth
-    public R list(@RequestBody PageMap pageMap) {
-        //查询列表数据
-        Query query = new Query(pageMap);
-
-        int repeatNum=0;
-        //全省节点
-        FloorNoUserVo province=new FloorNoUserVo();
-        province.setCity("全省");
-        province.setCounty("全省");
-
-        List<FloorNoUserVo> leaveUseVoList = wzLandManageDetailsService.queryLeaveUseList(pageMap.getMap());
-        Map<String,List<FloorNoUserVo>> map=new HashMap<>();
-        for (FloorNoUserVo leaveUseVo : leaveUseVoList) {
-            double avera=0l;
-            if(leaveUseVo.getBuildingAreaIdelArea()+leaveUseVo.getBuildingAreaRentArea()==0){
-                avera=0;
-            }else{
-                avera=leaveUseVo.getBuildingAreaIdelArea()/(leaveUseVo.getBuildingAreaIdelArea()+leaveUseVo.getBuildingAreaRentArea());
-                avera=formatDouble(avera)*100;
-            }
-            leaveUseVo.setAverage(avera);
-            List<FloorNoUserVo> list;
-            if(map.get(leaveUseVo.getCity())!=null){
-                list=map.get(leaveUseVo.getCity());
-                list.add(leaveUseVo);
-            }else{
-                list=new ArrayList<>();
-                list.add(leaveUseVo);
-            }
-            map.put(leaveUseVo.getCity(),list);
-        }
-        List<FloorNoUserVo> resultList=new ArrayList<>();
-        List<FloorNoUserVo> cityList=new ArrayList<>();
-        double abuildingAreaIdelArea=0l;
-        double abuildingAreaRentArea=0l;
-        double abuildArea=0l;
-        double abuildingAreaUnavailable=0l;
-        double abuildingAreaUseArea=0l;
-
-        for(Map.Entry<String,List<FloorNoUserVo>> entry:map.entrySet()) {
-
-            List<FloorNoUserVo> list = entry.getValue();
-            //对该list相同的县进行统计
-            Map<String, List<FloorNoUserVo>> countyMap = new HashMap<>();
-            for (FloorNoUserVo leaveUseVo : list) {
-                if (countyMap.get(leaveUseVo.getCounty()) != null) {
-                    list = countyMap.get(leaveUseVo.getCounty());
-                    list.add(leaveUseVo);
-                } else {
-                    list = new ArrayList<>();
-                    list.add(leaveUseVo);
-                }
-                countyMap.put(leaveUseVo.getCounty(), list);
-            }
-
-            List<FloorNoUserVo> countyList = new ArrayList<>();
-            double citybuildingAreaIdelArea = 0l;
-            double citybuildingAreaRentArea = 0l;
-            double citybuildArea = 0l;
-            double citybuildingAreaUnavailable = 0l;
-            double citybuildingAreaUseArea = 0l;
-            for (Map.Entry<String, List<FloorNoUserVo>> countyEntry : countyMap.entrySet()) {
-                double buildingAreaIdelArea = 0l;
-                double buildingAreaRentArea = 0l;
-                double buildArea = 0l;
-                double buildingAreaUnavailable = 0l;
-                double buildingAreaUseArea = 0l;
-
-                String reapStr="";
-                if (countyEntry.getKey().equals("市本部")){
-                    reapStr="市本部"+repeatNum;
-                    repeatNum++;
-                }
-
-                FloorNoUserVo county = new FloorNoUserVo();
-                for (FloorNoUserVo leaveUseVo : countyEntry.getValue()) {
-                    county.setCity(leaveUseVo.getCounty());
-                    county.setCounty(leaveUseVo.getCounty());
-                    if(!reapStr.equals("")){
-                        county.setCity(reapStr);
-                        county.setCounty(reapStr);
-                        county.setCountyName(reapStr);
-                    }
-
-                    buildingAreaIdelArea += leaveUseVo.getBuildingAreaIdelArea();
-                    buildingAreaRentArea += leaveUseVo.getBuildingAreaRentArea();
-                    buildArea += leaveUseVo.getBuildingArea();
-                    buildingAreaUnavailable += leaveUseVo.getBuildingAreaUnavailable();
-                    buildingAreaUseArea += leaveUseVo.getBuildingAreaUseArea();
-
-                    citybuildingAreaIdelArea += leaveUseVo.getBuildingAreaIdelArea();
-                    citybuildingAreaRentArea += leaveUseVo.getBuildingAreaRentArea();
-                    citybuildArea += leaveUseVo.getBuildingArea();
-                    citybuildingAreaUnavailable += leaveUseVo.getBuildingAreaUnavailable();
-                    citybuildingAreaUseArea += leaveUseVo.getBuildingAreaUseArea();
-
-                    abuildingAreaIdelArea += leaveUseVo.getBuildingAreaIdelArea();
-                    abuildingAreaRentArea += leaveUseVo.getBuildingAreaRentArea();
-                    abuildArea += leaveUseVo.getBuildingArea();
-                    abuildingAreaUnavailable += leaveUseVo.getBuildingAreaUnavailable();
-                    abuildingAreaUseArea += leaveUseVo.getBuildingAreaUseArea();
-                }
-                double avera=0;
-                if(buildingAreaIdelArea+buildingAreaRentArea==0){
-                    avera=0;
-                }else{
-                    try{
-                        avera=formatDouble(buildingAreaIdelArea/(buildingAreaRentArea+buildingAreaIdelArea))*100;
-                    }catch (Exception e){
-                        e.printStackTrace();
-                    }
-
-                }
-                county.setBuildingArea(formatDouble(buildArea));
-                county.setBuildingAreaIdelArea(formatDouble(buildingAreaIdelArea));
-                county.setBuildingAreaUnavailable(formatDouble(buildingAreaUnavailable));
-                county.setBuildingAreaUseArea(formatDouble(buildingAreaUseArea));
-                county.setBuildingAreaRentArea(formatDouble(buildingAreaRentArea));
-                county.setAverage(formatDouble(avera));
-                countyList.add(county);
-            }
-            List<FloorNoUserVo> orderCountyList=new ArrayList<>();
-            try{
-                //对countList 进行排序
-                OtnAreaEntity area=otnAreaService.queryObject(list.get(0).getCity());
-                List<OtnAreaEntity> countyAreaList=otnAreaService.getCityOption(area.getId());
-                int i=0;
-                for (OtnAreaEntity otnAreaEntity : countyAreaList) {
-                    for (FloorNoUserVo wzCity : countyList) {
-                        if(wzCity.getCity().contains(otnAreaEntity.getName())){
-                            i++;
-                            wzCity.setFlag(i%2==0);
-                            orderCountyList.add(wzCity);
-                        }
-                    }
-                }
-            }catch (Exception e){
-                orderCountyList=countyList;
-                e.printStackTrace();
-            }
-
-
-            double avera;
-            if(citybuildingAreaRentArea+citybuildingAreaIdelArea==0){
-                avera=0;
-            }else{
-                avera=formatDouble(citybuildingAreaIdelArea/(citybuildingAreaRentArea+citybuildingAreaIdelArea))*100;
-            }
-
-            FloorNoUserVo parent = new FloorNoUserVo();
-            parent.setBuildingArea(formatDouble(citybuildArea));
-            parent.setBuildingAreaIdelArea(formatDouble(citybuildingAreaIdelArea));
-            parent.setBuildingAreaUnavailable(formatDouble(citybuildingAreaUnavailable));
-            parent.setBuildingAreaUseArea(formatDouble(citybuildingAreaUseArea));
-            parent.setBuildingAreaRentArea(formatDouble(citybuildingAreaRentArea));
-            parent.setCity(list.get(0).getCity());
-            parent.setCountyName(list.get(0).getCityName());
-            parent.setAverage(formatDouble(avera));
-            parent.setChildren(orderCountyList);
-            cityList.add(parent);
-        }
-
-        //对cityList 进行排序
-        List<OtnAreaEntity> areaList=otnAreaService.getCityOption("018");
-        List<FloorNoUserVo> orderList=new ArrayList<>();
-        int i=0;
-        for (OtnAreaEntity otnAreaEntity : areaList) {
-            for (FloorNoUserVo wzCity : cityList) {
-                if(wzCity.getCity().contains(otnAreaEntity.getName())){
-                    wzCity.setFlag(i%2==0);
-                    orderList.add(wzCity);
-                    i++;
-                }
-            }
-        }
-
-        double aavera;
-        if(abuildingAreaRentArea+abuildingAreaIdelArea==0){
-            aavera=0;
-        }else{
-            aavera=formatDouble(abuildingAreaIdelArea/(abuildingAreaRentArea+abuildingAreaIdelArea))*100;
-        }
-        province.setBuildingArea(formatDouble(abuildArea));
-        province.setBuildingAreaIdelArea(formatDouble(abuildingAreaIdelArea));
-        province.setBuildingAreaUnavailable(formatDouble(abuildingAreaUnavailable));
-        province.setBuildingAreaUseArea(formatDouble(abuildingAreaUseArea));
-        province.setBuildingAreaRentArea(formatDouble(abuildingAreaRentArea));
-        province.setAverage(formatDouble(aavera));
-        province.setChildren(orderList);
-        resultList.add(province);
-
-        int total = wzLandManageDetailsService.queryTotal(query);
-        PageUtils pageUtil = new PageUtils(resultList, total, query.getLimit(), query.getPage());
-        return R.ok().put("page", pageUtil);
-    }
+//    @RequestMapping("/list")
+//    @IgnoreAuth
+//    public R list(@RequestBody PageMap pageMap) {
+//        //查询列表数据
+//        Query query = new Query(pageMap);
+//
+//        int repeatNum=0;
+//        //全省节点
+//        FloorNoUserVo province=new FloorNoUserVo();
+//        province.setCity("全省");
+//        province.setCounty("全省");
+//
+//        List<FloorNoUserVo> leaveUseVoList = wzLandManageDetailsService.queryLeaveUseList(pageMap.getMap());
+//        Map<String,List<FloorNoUserVo>> map=new HashMap<>();
+//        for (FloorNoUserVo leaveUseVo : leaveUseVoList) {
+//            double avera=0l;
+//            if(leaveUseVo.getBuildingAreaIdelArea()+leaveUseVo.getBuildingAreaRentArea()==0){
+//                avera=0;
+//            }else{
+//                avera=leaveUseVo.getBuildingAreaIdelArea()/(leaveUseVo.getBuildingAreaIdelArea()+leaveUseVo.getBuildingAreaRentArea());
+//                avera=formatDouble(avera)*100;
+//            }
+//            leaveUseVo.setAverage(avera);
+//            List<FloorNoUserVo> list;
+//            if(map.get(leaveUseVo.getCity())!=null){
+//                list=map.get(leaveUseVo.getCity());
+//                list.add(leaveUseVo);
+//            }else{
+//                list=new ArrayList<>();
+//                list.add(leaveUseVo);
+//            }
+//            map.put(leaveUseVo.getCity(),list);
+//        }
+//        List<FloorNoUserVo> resultList=new ArrayList<>();
+//        List<FloorNoUserVo> cityList=new ArrayList<>();
+//        double abuildingAreaIdelArea=0l;
+//        double abuildingAreaRentArea=0l;
+//        double abuildArea=0l;
+//        double abuildingAreaUnavailable=0l;
+//        double abuildingAreaUseArea=0l;
+//
+//        for(Map.Entry<String,List<FloorNoUserVo>> entry:map.entrySet()) {
+//
+//            List<FloorNoUserVo> list = entry.getValue();
+//            //对该list相同的县进行统计
+//            Map<String, List<FloorNoUserVo>> countyMap = new HashMap<>();
+//            for (FloorNoUserVo leaveUseVo : list) {
+//                if (countyMap.get(leaveUseVo.getCounty()) != null) {
+//                    list = countyMap.get(leaveUseVo.getCounty());
+//                    list.add(leaveUseVo);
+//                } else {
+//                    list = new ArrayList<>();
+//                    list.add(leaveUseVo);
+//                }
+//                countyMap.put(leaveUseVo.getCounty(), list);
+//            }
+//
+//            List<FloorNoUserVo> countyList = new ArrayList<>();
+//            double citybuildingAreaIdelArea = 0l;
+//            double citybuildingAreaRentArea = 0l;
+//            double citybuildArea = 0l;
+//            double citybuildingAreaUnavailable = 0l;
+//            double citybuildingAreaUseArea = 0l;
+//            for (Map.Entry<String, List<FloorNoUserVo>> countyEntry : countyMap.entrySet()) {
+//                double buildingAreaIdelArea = 0l;
+//                double buildingAreaRentArea = 0l;
+//                double buildArea = 0l;
+//                double buildingAreaUnavailable = 0l;
+//                double buildingAreaUseArea = 0l;
+//
+//                String reapStr="";
+//                if (countyEntry.getKey().equals("市本部")){
+//                    reapStr="市本部"+repeatNum;
+//                    repeatNum++;
+//                }
+//
+//                FloorNoUserVo county = new FloorNoUserVo();
+//                for (FloorNoUserVo leaveUseVo : countyEntry.getValue()) {
+//                    county.setCity(leaveUseVo.getCounty());
+//                    county.setCounty(leaveUseVo.getCounty());
+//                    if(!reapStr.equals("")){
+//                        county.setCity(reapStr);
+//                        county.setCounty(reapStr);
+//                        county.setCountyName(reapStr);
+//                    }
+//
+//                    buildingAreaIdelArea += leaveUseVo.getBuildingAreaIdelArea();
+//                    buildingAreaRentArea += leaveUseVo.getBuildingAreaRentArea();
+//                    buildArea += leaveUseVo.getBuildingArea();
+//                    buildingAreaUnavailable += leaveUseVo.getBuildingAreaUnavailable();
+//                    buildingAreaUseArea += leaveUseVo.getBuildingAreaUseArea();
+//
+//                    citybuildingAreaIdelArea += leaveUseVo.getBuildingAreaIdelArea();
+//                    citybuildingAreaRentArea += leaveUseVo.getBuildingAreaRentArea();
+//                    citybuildArea += leaveUseVo.getBuildingArea();
+//                    citybuildingAreaUnavailable += leaveUseVo.getBuildingAreaUnavailable();
+//                    citybuildingAreaUseArea += leaveUseVo.getBuildingAreaUseArea();
+//
+//                    abuildingAreaIdelArea += leaveUseVo.getBuildingAreaIdelArea();
+//                    abuildingAreaRentArea += leaveUseVo.getBuildingAreaRentArea();
+//                    abuildArea += leaveUseVo.getBuildingArea();
+//                    abuildingAreaUnavailable += leaveUseVo.getBuildingAreaUnavailable();
+//                    abuildingAreaUseArea += leaveUseVo.getBuildingAreaUseArea();
+//                }
+//                double avera=0;
+//                if(buildingAreaIdelArea+buildingAreaRentArea==0){
+//                    avera=0;
+//                }else{
+//                    try{
+//                        avera=formatDouble(buildingAreaIdelArea/(buildingAreaRentArea+buildingAreaIdelArea))*100;
+//                    }catch (Exception e){
+//                        e.printStackTrace();
+//                    }
+//
+//                }
+//                county.setBuildingArea(formatDouble(buildArea));
+//                county.setBuildingAreaIdelArea(formatDouble(buildingAreaIdelArea));
+//                county.setBuildingAreaUnavailable(formatDouble(buildingAreaUnavailable));
+//                county.setBuildingAreaUseArea(formatDouble(buildingAreaUseArea));
+//                county.setBuildingAreaRentArea(formatDouble(buildingAreaRentArea));
+//                county.setAverage(formatDouble(avera));
+//                countyList.add(county);
+//            }
+//            List<FloorNoUserVo> orderCountyList=new ArrayList<>();
+//            try{
+//                //对countList 进行排序
+//                OtnAreaEntity area=otnAreaService.queryObject(list.get(0).getCity());
+//                List<OtnAreaEntity> countyAreaList=otnAreaService.getCityOption(area.getId());
+//                int i=0;
+//                for (OtnAreaEntity otnAreaEntity : countyAreaList) {
+//                    for (FloorNoUserVo wzCity : countyList) {
+//                        if(wzCity.getCity().contains(otnAreaEntity.getName())){
+//                            i++;
+//                            wzCity.setFlag(i%2==0);
+//                            orderCountyList.add(wzCity);
+//                        }
+//                    }
+//                }
+//            }catch (Exception e){
+//                orderCountyList=countyList;
+//                e.printStackTrace();
+//            }
+//
+//
+//            double avera;
+//            if(citybuildingAreaRentArea+citybuildingAreaIdelArea==0){
+//                avera=0;
+//            }else{
+//                avera=formatDouble(citybuildingAreaIdelArea/(citybuildingAreaRentArea+citybuildingAreaIdelArea))*100;
+//            }
+//
+//            FloorNoUserVo parent = new FloorNoUserVo();
+//            parent.setBuildingArea(formatDouble(citybuildArea));
+//            parent.setBuildingAreaIdelArea(formatDouble(citybuildingAreaIdelArea));
+//            parent.setBuildingAreaUnavailable(formatDouble(citybuildingAreaUnavailable));
+//            parent.setBuildingAreaUseArea(formatDouble(citybuildingAreaUseArea));
+//            parent.setBuildingAreaRentArea(formatDouble(citybuildingAreaRentArea));
+//            parent.setCity(list.get(0).getCity());
+//            parent.setCountyName(list.get(0).getCityName());
+//            parent.setAverage(formatDouble(avera));
+//            parent.setChildren(orderCountyList);
+//            cityList.add(parent);
+//        }
+//
+//        //对cityList 进行排序
+//        List<OtnAreaEntity> areaList=otnAreaService.getCityOption("018");
+//        List<FloorNoUserVo> orderList=new ArrayList<>();
+//        int i=0;
+//        for (OtnAreaEntity otnAreaEntity : areaList) {
+//            for (FloorNoUserVo wzCity : cityList) {
+//                if(wzCity.getCity().contains(otnAreaEntity.getName())){
+//                    wzCity.setFlag(i%2==0);
+//                    orderList.add(wzCity);
+//                    i++;
+//                }
+//            }
+//        }
+//
+//        double aavera;
+//        if(abuildingAreaRentArea+abuildingAreaIdelArea==0){
+//            aavera=0;
+//        }else{
+//            aavera=formatDouble(abuildingAreaIdelArea/(abuildingAreaRentArea+abuildingAreaIdelArea))*100;
+//        }
+//        province.setBuildingArea(formatDouble(abuildArea));
+//        province.setBuildingAreaIdelArea(formatDouble(abuildingAreaIdelArea));
+//        province.setBuildingAreaUnavailable(formatDouble(abuildingAreaUnavailable));
+//        province.setBuildingAreaUseArea(formatDouble(abuildingAreaUseArea));
+//        province.setBuildingAreaRentArea(formatDouble(abuildingAreaRentArea));
+//        province.setAverage(formatDouble(aavera));
+//        province.setChildren(orderList);
+//        resultList.add(province);
+//
+//        int total = wzLandManageDetailsService.queryTotal(query);
+//        PageUtils pageUtil = new PageUtils(resultList, total, query.getLimit(), query.getPage());
+//        return R.ok().put("page", pageUtil);
+//    }
 
     @RequestMapping("/queryHouseYear")
     @IgnoreAuth
@@ -309,24 +309,24 @@ public class WzLandManageDetailsController {
         return R.ok().put("page", pageUtil);
     }
 
-    /**
-     * 土地详情
-     */
-    @RequestMapping("/queryLandDetail")
-    @IgnoreAuth
-    public R queryHouseDetail(@RequestBody PageMap pageMap) {
-        //查询列表数据
-        Query query = new Query(pageMap);
-        List<WzLandManageDetailsEntity> list = wzLandManageDetailsService.queryList(query);
-        Query query1 = new Query(pageMap);
-        int total = wzLandManageDetailsService.queryTotal(query1);
-        PageUtils pageUtil = new PageUtils(list, total, query.getLimit(), query.getPage());
-        return R.ok().put("page", pageUtil);
-    }
+//    /**
+//     * 土地记录
+//     */
+//    @RequestMapping("/queryLandDetail")
+//    @IgnoreAuth
+//    public R queryHouseDetail(@RequestBody PageMap pageMap) {
+//        //查询列表数据
+//        Query query = new Query(pageMap);
+//        List<WzLandManageDetailsEntity> list = wzLandManageDetailsService.queryList(query);
+//        Query query1 = new Query(pageMap);
+//        int total = wzLandManageDetailsService.queryTotal(query1);
+//        PageUtils pageUtil = new PageUtils(list, total, query.getLimit(), query.getPage());
+//        return R.ok().put("page", pageUtil);
+//    }
 
 
     /**
-     * 土地详情
+     * 土地记录
      */
     @RequestMapping("/queryLandDetailByCode")
     @IgnoreAuth
@@ -364,9 +364,9 @@ public class WzLandManageDetailsController {
         if(county!=null){
             map.put("county",county);
         }
-        //判定是闲置管理还是详情
-        if(name.contains("详单")){
-            ee1 = new ExcelExport("土地管理_土地详单" + df.format(new Date()));
+        //判定是闲置管理还是记录
+        if(name.contains("记录")){
+            ee1 = new ExcelExport("土地管理_土地记录" + df.format(new Date()));
             responseLandDetail(df,ee1,map);
             ee1.export(response);
         }else{

+ 33 - 0
src/main/java/com/example/controller/house/HouseWzLandManageDetailsController.java

@@ -2,15 +2,24 @@ package com.example.controller.house;
 
 import com.example.common.PageVo;
 import com.example.common.Rsp;
+import com.example.pojo.dto.LandIdleStatDto;
+import com.example.pojo.dto.ListLandDto;
 import com.example.pojo.dto.ListSiteNameDto;
 import com.example.pojo.dto.ListSiteNumDto;
+import com.example.pojo.vo.LandIdleStatVo;
+import com.example.pojo.vo.ListLandVo;
 import com.example.service.house.HouseWzLandManageDetailsService;
 import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.validation.Valid;
+
+@Tag(name = "不动产土地")
 @RestController
 @RequestMapping("/house-car/house/dist/api/WzLandManageDetails")
 public class HouseWzLandManageDetailsController {
@@ -31,4 +40,28 @@ public class HouseWzLandManageDetailsController {
     public Rsp<PageVo<String>> listSiteNum(@RequestBody ListSiteNumDto dto) {
         return houseWzLandManageDetailsService.listSiteNum(dto);
     }
+
+    @Operation(summary = "查询闲置管理")
+    @PostMapping("/list")
+    public Rsp<PageVo<LandIdleStatVo>> buildingIdleStat(@Valid @RequestBody LandIdleStatDto dto) {
+        return houseWzLandManageDetailsService.landIdleStat(dto);
+    }
+
+    @Operation(summary = "闲置管理导出")
+    @GetMapping("/landIdleStatExport")
+    public void landIdleStatExport(@Valid LandIdleStatDto.LandIdleStatMapDTO dto) {
+        houseWzLandManageDetailsService.landIdleStatExport(dto);
+    }
+
+    @Operation(summary = "查询土地记录")
+    @PostMapping("/queryLandDetail")
+    public Rsp<PageVo<ListLandVo>> queryLandDetail(@Valid @RequestBody ListLandDto dto) {
+        return houseWzLandManageDetailsService.queryLandDetail(dto);
+    }
+
+    @Operation(summary = "土地记录导出")
+    @GetMapping("/queryLandDetailExport")
+    public void queryLandDetailExport(@Valid ListLandDto.ListLandMapDTO dto) {
+        houseWzLandManageDetailsService.queryLandDetailExport(dto);
+    }
 }

+ 124 - 0
src/main/java/com/example/dao/house/HouseLandDao.java

@@ -0,0 +1,124 @@
+package com.example.dao.house;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.example.entity.house.HouseLandPo;
+import com.example.entity.house.LandIdleStatPo;
+import com.example.pojo.bo.LandIdleStatBo;
+import com.example.pojo.bo.ListLandBo;
+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 HouseLandDao {
+    /**
+     * 不动产土地闲置统计
+     */
+    @Select("""
+<script>
+with
+t101 as (
+select
+    area_no,
+    city_no,
+    count(land_area_idle <![CDATA[ > ]]> 0 or null) as idle_count,
+    sum(total_land_area) as total_land_area_sum,
+    sum(land_area_self_use) as land_area_self_use_sum,
+    sum(land_area_unusable) as land_area_unusable_sum,
+    sum(land_area_rent) as land_area_rent_sum,
+    sum(land_area_idle) as land_area_idle_sum,
+    case
+        when (sum(land_area_idle) + sum(land_area_rent)) = 0 then null
+        else round(sum(land_area_idle) / (sum(land_area_idle) + sum(land_area_rent)),
+        4)
+    end as idle_percent
+from
+    house.land_month
+<choose>
+  <when test="dto.yearMonth != null">
+    where year_month = #{dto.yearMonth}
+  </when>
+  <otherwise>
+    where year_month = (select max(year_month) from house.land_month)
+  </otherwise>
+</choose>
+<if test="dto.areaNo != null and dto.areaNo != ''">
+  and area_no = #{dto.areaNo}
+</if>
+<if test="dto.cityNo != null and dto.cityNo != ''">
+  and city_no = #{dto.cityNo}
+</if>
+group by
+    area_no,
+    city_no
+),
+t102 as (
+select
+    b.id as area_no,
+    b."name" as area_name,
+    a.id as city_no,
+    a."name" as city_name,
+    coalesce(c.idle_count, 0) as idle_count,
+    coalesce(c.total_land_area_sum, 0) as total_land_area_sum,
+    coalesce(c.land_area_self_use_sum, 0) as land_area_self_use_sum,
+    coalesce(c.land_area_unusable_sum, 0) as land_area_unusable_sum,
+    coalesce(c.land_area_rent_sum, 0) as land_area_rent_sum,
+    coalesce(c.land_area_idle_sum, 0) as land_area_idle_sum,
+    c.idle_percent as idle_percent
+from
+    common.organization a
+left join common.organization b on
+    a.parent_id = b.id
+left join t101 c on
+    a.id = c.city_no
+where
+    a.grade = 2
+    and a.unhide = 1
+<if test="dto.areaNo != null and dto.areaNo != ''">
+  and a.parent_id = #{dto.areaNo}
+</if>
+<if test="dto.cityNo != null and dto.cityNo != ''">
+  and a.id = #{dto.cityNo}
+</if>
+order by
+    b.order_num, a.order_num
+)
+select * from t102
+</script>
+""")
+    List<LandIdleStatPo> landIdleStat(@Param("dto") LandIdleStatBo dto);
+
+    /**
+     * 查询不动产土地
+     */
+    @Select("""
+<script>
+select
+*
+from house.land_month
+<choose>
+  <when test="dto.yearMonth != null">
+    where year_month = #{dto.yearMonth}
+  </when>
+  <otherwise>
+    where year_month = (select max(year_month) from house.land_month)
+  </otherwise>
+</choose>
+<if test="dto.areaNo != null and dto.areaNo != ''">
+  and area_no = #{dto.areaNo}
+</if>
+<if test="dto.cityNo != null and dto.cityNo != ''">
+  and city_no = #{dto.cityNo}
+</if>
+<if test="dto.siteName != null and dto.siteName != ''">
+  and site_name = #{dto.siteName}
+</if>
+<if test="dto.siteNum != null and dto.siteNum != ''">
+  and site_num = #{dto.siteNum}
+</if>
+</script>
+""")
+    List<HouseLandPo> listLand(Page<HouseLandPo> page, @Param("dto") ListLandBo dto);
+}

+ 240 - 0
src/main/java/com/example/entity/house/HouseLandPo.java

@@ -0,0 +1,240 @@
+package com.example.entity.house;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+
+@NoArgsConstructor
+@Data
+public class HouseLandPo {
+    /**
+     * 数据年月
+     */
+    private Integer yearMonth;
+
+    /**
+     * 资产所属单位(一级)
+     */
+    private String firstUnit;
+
+    /**
+     * 资产所属单位(二级)
+     */
+    private String secondUnit;
+
+    /**
+     * 资产所属单位(三级)
+     */
+    private String thirdUnit;
+
+    /**
+     * 土地别名
+     */
+    private String landName;
+
+    /**
+     * 土地ID
+     */
+    private String landId;
+
+    /**
+     * 土地性质
+     */
+    private String landOwnership;
+
+    /**
+     * 使用权类型
+     */
+    private String useRightType;
+
+    /**
+     * 地类用途
+     */
+    private String landUse;
+
+    /**
+     * 取得日期
+     */
+    private String acquisitionDate;
+
+    /**
+     * 闲置开始时间
+     */
+    private String idleStartDate;
+
+    /**
+     * 局址编号
+     */
+    private String siteNum;
+
+    /**
+     * 局址别名
+     */
+    private String siteName;
+
+    /**
+     * 局址ID
+     */
+    private String siteId;
+
+    /**
+     * 标准地址
+     */
+    private String address;
+
+    /**
+     * 投资主体
+     */
+    private String investor;
+
+    /**
+     * 管理层级
+     */
+    private String managementLevel;
+
+    /**
+     * 权属状态
+     */
+    private String ownershipStatus;
+
+    /**
+     * 使用状态
+     */
+    private String usageStatus;
+
+    /**
+     * 土地总面积(㎡)
+     */
+    private BigDecimal totalLandArea;
+
+    /**
+     * 土地自用面积(㎡)
+     */
+    private BigDecimal landAreaSelfUse;
+
+    /**
+     * 土地闲置面积(㎡)
+     */
+    private BigDecimal landAreaIdle;
+
+    /**
+     * 土地出租面积(㎡)
+     */
+    private BigDecimal landAreaRent;
+
+    /**
+     * 土地不可使用面积(㎡)
+     */
+    private BigDecimal landAreaUnusable;
+
+    /**
+     * 是否有土地证
+     */
+    private String hasLandDeed;
+
+    /**
+     * 无土地证原因
+     */
+    private String noLandDeedReason;
+
+    /**
+     * 是否有保地风险
+     */
+    private String landPreservationRisk;
+
+    /**
+     * 是否空地
+     */
+    private String openSpace;
+
+    /**
+     * 是否有院落
+     */
+    private String courtyard;
+
+    /**
+     * 未关联资产
+     */
+    private String unrelatedAssets;
+
+    /**
+     * 资产编号
+     */
+    private String assetsNum;
+
+    /**
+     * 资产标签号
+     */
+    private String assetsTagNum;
+
+    /**
+     * 责任部门
+     */
+    private String responsibleDepartment;
+
+    /**
+     * 责任人
+     */
+    private String personInCharge;
+
+    /**
+     * 经度集团
+     */
+    private BigDecimal lngJt;
+
+    /**
+     * 纬度集团
+     */
+    private BigDecimal latJt;
+
+    /**
+     * 实际产权人
+     */
+    private String propertyOwner;
+
+    /**
+     * 特殊说明
+     */
+    private String specialSpecification;
+
+    /**
+     * 二级组织机构编码
+     */
+    private String areaNo;
+
+    /**
+     * 二级组织机构名称
+     */
+    private String areaName;
+
+    /**
+     * 三级组织机构编码
+     */
+    private String cityNo;
+
+    /**
+     * 三级组织机构名称
+     */
+    private String cityName;
+
+    /**
+     * 地市id
+     */
+    private String cityId;
+
+    /**
+     * 地市
+     */
+    private String city;
+
+    /**
+     * 区县id
+     */
+    private String districtId;
+
+    /**
+     * 区县
+     */
+    private String district;
+}

+ 107 - 0
src/main/java/com/example/entity/house/LandIdleStatPo.java

@@ -0,0 +1,107 @@
+package com.example.entity.house;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class LandIdleStatPo {
+    /**
+     * 二级组织机构编码
+     */
+    private String areaNo;
+    /**
+     * 二级组织机构名称
+     */
+    private String areaName;
+    /**
+     * 三级组织机构编码
+     */
+    private String cityNo;
+    /**
+     * 三级组织机构名称
+     */
+    private String cityName;
+    /**
+     * 闲置建筑数量
+     */
+    private Integer idleCount;
+    /**
+     * 土地总面积
+     */
+    private BigDecimal totalLandAreaSum;
+    /**
+     * 土地自用面积
+     */
+    private BigDecimal landAreaSelfUseSum;
+    /**
+     * 土地不可使用面积
+     */
+    private BigDecimal landAreaUnusableSum;
+    /**
+     * 土地出租面积
+     */
+    private BigDecimal landAreaRentSum;
+    /**
+     * 土地闲置面积
+     */
+    private BigDecimal landAreaIdleSum;
+    /**
+     * 闲置率
+     */
+    private BigDecimal idlePercent;
+    /**
+     * 子列表
+     */
+    private List<LandIdleStatPo> children;
+
+    public LandIdleStatPo() {
+        this.areaNo = "";
+        this.areaName = "";
+        this.cityNo = "";
+        this.cityName = "";
+        this.idleCount = 0;
+        this.totalLandAreaSum = BigDecimal.ZERO;
+        this.landAreaSelfUseSum = BigDecimal.ZERO;
+        this.landAreaUnusableSum = BigDecimal.ZERO;
+        this.landAreaRentSum = BigDecimal.ZERO;
+        this.landAreaIdleSum = BigDecimal.ZERO;
+        this.idlePercent = BigDecimal.ZERO;
+        this.children = new ArrayList<>();
+    }
+
+    public LandIdleStatPo(String areaNo, String areaName) {
+        this.areaNo = areaNo;
+        this.areaName = areaName;
+        this.cityNo = areaNo;
+        this.cityName = areaName;
+        this.idleCount = 0;
+        this.totalLandAreaSum = BigDecimal.ZERO;
+        this.landAreaSelfUseSum = BigDecimal.ZERO;
+        this.landAreaUnusableSum = BigDecimal.ZERO;
+        this.landAreaRentSum = BigDecimal.ZERO;
+        this.landAreaIdleSum = BigDecimal.ZERO;
+        this.idlePercent = BigDecimal.ZERO;
+        this.children = new ArrayList<>();
+    }
+
+    public void update(LandIdleStatPo po) {
+        this.idleCount = this.idleCount + po.idleCount;
+        this.totalLandAreaSum = this.totalLandAreaSum.add(po.totalLandAreaSum);
+        this.landAreaSelfUseSum = this.landAreaSelfUseSum.add(po.landAreaSelfUseSum);
+        this.landAreaUnusableSum = this.landAreaUnusableSum.add(po.landAreaUnusableSum);
+        this.landAreaRentSum = this.landAreaRentSum.add(po.landAreaRentSum);
+        this.landAreaIdleSum = this.landAreaIdleSum.add(po.landAreaIdleSum);
+        if (BigDecimal.ZERO.compareTo(this.landAreaRentSum.add(this.landAreaIdleSum)) != 0) {
+            this.idlePercent = this.landAreaIdleSum
+                    .divide(this.landAreaRentSum.add(this.landAreaIdleSum), 4, RoundingMode.HALF_DOWN);
+        } else {
+//            this.idlePercent = null;
+            this.idlePercent = BigDecimal.ZERO;
+        }
+        this.children.add(po);
+    }
+}

+ 155 - 0
src/main/java/com/example/enums/ListLandOrderEnum.java

@@ -0,0 +1,155 @@
+package com.example.enums;
+
+public enum ListLandOrderEnum {
+    /**
+     * 一级单位
+     */
+    province("first_unit"),
+    /**
+     * 二级单位
+     */
+    city("area_name"),
+    /**
+     * 三级单位
+     */
+    county("city_name"),
+    /**
+     * 局址别名
+     */
+    buildingNameAlias("site_name"),
+    /**
+     * 局址编号
+     */
+    buildingAddressNumber("site_num"),
+    /**
+     * 土地别名
+     */
+    landAlias("land_name"),
+    /**
+     * 土地性质
+     */
+    landNature("land_ownership"),
+    /**
+     * 使用权类型
+     */
+    usageRightsType("use_right_type"),
+    /**
+     * 地类用途
+     */
+    landUse("land_use"),
+    /**
+     * 取得日期
+     */
+    getDate("acquisition_date"),
+    /**
+     * 闲置开始时间
+     */
+    idelLandBegindate("idle_start_date"),
+    /**
+     * 标准地址
+     */
+    standardAddress("address"),
+    /**
+     * 投资主体
+     */
+    investmentEntity("investor"),
+    /**
+     * 管理层级
+     */
+    managementHierarchy("management_level"),
+    /**
+     * 权属状态
+     */
+    ownershipStatus("ownership_status"),
+    /**
+     * 使用状态
+     */
+    useState("usage_status"),
+    /**
+     * 土地总面积
+     */
+    totalLandArea("total_land_area"),
+    /**
+     * 土地自用面积
+     */
+    landSelfUseArea("land_area_self_use"),
+    /**
+     * 土地闲置面积
+     */
+    landIdelUseArea("land_area_idle"),
+    /**
+     * 土地出租面积
+     */
+    landRentUseArea("land_area_rent"),
+    /**
+     * 土地不可使用面积
+     */
+    lanNoUnavailableArea("land_area_unusable"),
+    /**
+     * 是否有土地证
+     */
+    landCertificate("has_land_deed"),
+    /**
+     * 无土地证原因
+     */
+    noLandCertificateReason("no_land_deed_reason"),
+    /**
+     * 是否有保地风险
+     */
+    protectLandRisk("land_preservation_risk"),
+    /**
+     * 是否空地
+     */
+    clearingLand("open_space"),
+    /**
+     * 是否有院落
+     */
+    courtyard("courtyard"),
+    /**
+     * 未关联资产
+     */
+    unrelatedAssets("unrelated_assets"),
+    /**
+     * 资产编号
+     */
+    assetCode("assets_num"),
+    /**
+     * 资产标签号
+     */
+    astsLabe("assets_tag_num"),
+    /**
+     * 责任部门
+     */
+    responsibleDepartment("responsible_department"),
+    /**
+     * 责任人
+     */
+    responsiblePerson("person_in_charge"),
+    /**
+     * 经度集团
+     */
+    buildingLongitude("lng_jt"),
+    /**
+     * 纬度集团
+     */
+    buildingDimension("lat_jt"),
+    /**
+     * 实际产权人
+     */
+    buildingActualPropertyOwner("property_owner"),
+    /**
+     * 特殊说明
+     */
+    specialInstructions("special_specification"),
+    ;
+
+    private final String columnName;
+
+    ListLandOrderEnum(String columnName) {
+        this.columnName = columnName;
+    }
+
+    public String getColumnName() {
+        return columnName;
+    }
+}

+ 19 - 0
src/main/java/com/example/pojo/bo/LandIdleStatBo.java

@@ -0,0 +1,19 @@
+package com.example.pojo.bo;
+
+import lombok.Data;
+
+@Data
+public class LandIdleStatBo {
+    /**
+     * 账期
+     */
+    private Integer yearMonth;
+    /**
+     * 二级组织机构编码
+     */
+    private String areaNo;
+    /**
+     * 三级组织机构编码
+     */
+    private String cityNo;
+}

+ 27 - 0
src/main/java/com/example/pojo/bo/ListLandBo.java

@@ -0,0 +1,27 @@
+package com.example.pojo.bo;
+
+import lombok.Data;
+
+@Data
+public class ListLandBo {
+    /**
+     * 账期
+     */
+    private Integer yearMonth;
+    /**
+     * 二级组织机构编码
+     */
+    private String areaNo;
+    /**
+     * 三级组织机构编码
+     */
+    private String cityNo;
+    /**
+     * 局址编号
+     */
+    private String siteNum;
+    /**
+     * 局址别名
+     */
+    private String siteName;
+}

+ 38 - 0
src/main/java/com/example/pojo/dto/LandIdleStatDto.java

@@ -0,0 +1,38 @@
+package com.example.pojo.dto;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.util.StringUtils;
+
+import javax.validation.Valid;
+import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
+
+@NoArgsConstructor
+@Data
+public class LandIdleStatDto {
+    @Valid
+    private LandIdleStatDto.LandIdleStatMapDTO map;
+
+    @NoArgsConstructor
+    @Data
+    public static class LandIdleStatMapDTO {
+        @Schema(description = "账期", example = "202312")
+        private Integer statisticalMonth;
+        @Schema(description = "二级组织机构id")
+        private String city;
+        @Schema(description = "三级级组织机构id")
+        private String county;
+    }
+
+    public LandIdleStatDto(LandIdleStatMapDTO map) {
+        if (StringUtils.hasText(map.city)) {
+            map.city = URLDecoder.decode(map.city, StandardCharsets.UTF_8);
+        }
+        if (StringUtils.hasText(map.county)) {
+            map.county = URLDecoder.decode(map.county, StandardCharsets.UTF_8);
+        }
+        this.map = map;
+    }
+}

+ 56 - 0
src/main/java/com/example/pojo/dto/ListLandDto.java

@@ -0,0 +1,56 @@
+package com.example.pojo.dto;
+
+import com.example.enums.ListLandOrderEnum;
+import com.example.enums.OrderEnum;
+import com.example.utils.Page;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.util.StringUtils;
+
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
+
+@NoArgsConstructor
+@Data
+public class ListLandDto {
+    @Valid
+    @NotNull
+    private Page page;
+    @Valid
+    private ListLandMapDTO map;
+
+    @NoArgsConstructor
+    @Data
+    public static class ListLandMapDTO {
+        @Schema(description = "账期", example = "202312")
+        private Integer statisticalMonth;
+        @Schema(description = "二级组织机构id")
+        private String city;
+        @Schema(description = "三级级组织机构id")
+        private String county;
+        @Schema(description = "排序字段")
+        private ListLandOrderEnum sidx;
+        @Schema(description = "排序方式")
+        private OrderEnum order;
+        @Schema(description = "局址别名")
+        private String buildingNameAlias;
+        @Schema(description = "局址编号")
+        private String code;
+    }
+
+    public ListLandDto(ListLandMapDTO map) {
+        if (StringUtils.hasText(map.city)) {
+            map.city = URLDecoder.decode(map.city, StandardCharsets.UTF_8);
+        }
+        if (StringUtils.hasText(map.county)) {
+            map.county = URLDecoder.decode(map.county, StandardCharsets.UTF_8);
+        }
+        if (StringUtils.hasText(map.buildingNameAlias)) {
+            map.buildingNameAlias = URLDecoder.decode(map.buildingNameAlias, StandardCharsets.UTF_8);
+        }
+        this.map = map;
+    }
+}

+ 54 - 0
src/main/java/com/example/pojo/vo/LandIdleStatVo.java

@@ -0,0 +1,54 @@
+package com.example.pojo.vo;
+
+import com.example.entity.house.LandIdleStatPo;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+
+@Data
+public class LandIdleStatVo {
+    @Schema(description = "单位名称")
+    private String city;
+    @Schema(description = "闲置数量")
+    private Integer idleNum;
+    @Schema(description = "土地总面积")
+    private BigDecimal buildingArea;
+    @Schema(description = "土地自用面积")
+    private BigDecimal buildingAreaUseArea;
+    @Schema(description = "土地不可使用面积")
+    private BigDecimal buildingAreaUnavailable;
+    @Schema(description = "土地出租面积")
+    private BigDecimal buildingAreaRentArea;
+    @Schema(description = "土地闲置面积")
+    private BigDecimal buildingAreaIdelArea;
+    @Schema(description = "闲置率")
+    private BigDecimal average;
+    @Schema(description = "子列表")
+    private List<LandIdleStatVo> children;
+    @Schema(description = "是否变色")
+    private Boolean flag;
+
+    public LandIdleStatVo(LandIdleStatPo po, Boolean flag) {
+        this.city = po.getCityName();
+        this.idleNum = po.getIdleCount();
+        this.buildingArea = po.getTotalLandAreaSum();
+        this.buildingAreaUseArea = po.getLandAreaSelfUseSum();
+        this.buildingAreaUnavailable = po.getLandAreaUnusableSum();
+        this.buildingAreaRentArea = po.getLandAreaRentSum();
+        this.buildingAreaIdelArea = po.getLandAreaIdleSum();
+        if (po.getIdlePercent() != null) {
+            this.average = po.getIdlePercent().multiply(new BigDecimal("100"));
+        }
+        this.flag = flag;
+        this.children = new ArrayList<>();
+        List<LandIdleStatPo> list = po.getChildren();
+        int size = list.size();
+        for (int i = 0; i < size; i++) {
+            LandIdleStatPo t = list.get(i);
+            this.children.add(new LandIdleStatVo(t, flag == (i % 2 != 0)));
+        }
+    }
+}

+ 135 - 0
src/main/java/com/example/pojo/vo/ListLandVo.java

@@ -0,0 +1,135 @@
+package com.example.pojo.vo;
+
+import com.example.entity.house.HouseLandPo;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+
+@Data
+@NoArgsConstructor
+public class ListLandVo {
+    @Schema(description = "资产所属单位(一级)")
+    private String province;
+    @Schema(description = "资产所属单位(二级)")
+    private String city;
+    @Schema(description = "资产所属单位(三级)")
+    private String county;
+    @Schema(description = "土地别名")
+    private String landAlias;
+    @Schema(description = "土地性质")
+    private String landNature;
+    @Schema(description = "使用权类型")
+    private String usageRightsType;
+    @Schema(description = "地类用途")
+    private String landUse;
+    @Schema(description = "取得日期")
+    private String getDate;
+    @Schema(description = "闲置开始时间")
+    private String idelLandBegindate;
+    @Schema(description = "局址别名")
+    private String buildingNameAlias;
+    @Schema(description = "标准地址")
+    private String standardAddress;
+    @Schema(description = "投资主体")
+    private String investmentEntity;
+    @Schema(description = "管理层级")
+    private String managementHierarchy;
+    @Schema(description = "权属状态")
+    private String ownershipStatus;
+    @Schema(description = "使用状态")
+    private String useState;
+    @Schema(description = "土地总面积(㎡)")
+    private BigDecimal totalLandArea;
+    @Schema(description = "土地自用面积(㎡)")
+    private BigDecimal landSelfUseArea;
+    @Schema(description = "土地闲置面积(㎡)")
+    private BigDecimal landIdelUseArea;
+    @Schema(description = "土地出租面积(㎡)")
+    private BigDecimal landRentUseArea;
+    @Schema(description = "土地不可使用面积(㎡)")
+    private BigDecimal lanNoUnavailableArea;
+    @Schema(description = "是否有土地证")
+    private String landCertificate;
+    @Schema(description = "无土地证原因")
+    private String noLandCertificateReason;
+    @Schema(description = "是否有保地风险")
+    private String protectLandRisk;
+    @Schema(description = "是否空地")
+    private String clearingLand;
+    @Schema(description = "是否有院落")
+    private String courtyard;
+    @Schema(description = "未关联资产")
+    private String unrelatedAssets;
+    @Schema(description = "资产编号")
+    private String assetCode;
+    @Schema(description = "资产标签号")
+    private String astsLabe;
+    @Schema(description = "责任部门")
+    private String responsibleDepartment;
+    @Schema(description = "部门人")
+    private String responsiblePerson;
+    @Schema(description = "房屋经度")
+    private BigDecimal buildingLongitude;
+    @Schema(description = "房屋纬度")
+    private BigDecimal buildingDimension;
+    @Schema(description = "实际产权人")
+    private String buildingActualPropertyOwner;
+    @Schema(description = "特殊说明")
+    private String specialInstructions;
+//    @Schema(description = "使用面积-闲置(㎡)")
+//    private String useAreaIdelArea;
+//    @Schema(description = "使用面积-不可使用(㎡)")
+//    private String useAreaUnavailableArea;
+//    @Schema(description = "楼长姓名")
+//    private String landManageName;
+//    @Schema(description = "楼长所在单位")
+//    private String landManageCompany;
+//    @Schema(description = "土地经度")
+//    private BigDecimal landLongitude;
+//    @Schema(description = "土地纬度")
+//    private BigDecimal landDimension;
+//    @Schema(description = "土地实际产权人")
+//    private String landActualPropertyOwner;
+    @Schema(description = "局址编码")
+    private String buildingAddressNumber;
+
+    public ListLandVo(HouseLandPo po) {
+        this.province = po.getFirstUnit();
+        this.city = po.getAreaName();
+        this.county = po.getCityName();
+        this.landAlias = po.getLandName();
+        this.landNature = po.getLandOwnership();
+        this.usageRightsType = po.getUseRightType();
+        this.landUse = po.getLandUse();
+        this.getDate = po.getAcquisitionDate();
+        this.idelLandBegindate = po.getIdleStartDate();
+        this.buildingNameAlias = po.getSiteName();
+        this.standardAddress = po.getAddress();
+        this.investmentEntity = po.getInvestor();
+        this.managementHierarchy = po.getManagementLevel();
+        this.ownershipStatus = po.getOwnershipStatus();
+        this.useState = po.getUsageStatus();
+        this.totalLandArea = po.getTotalLandArea();
+        this.landSelfUseArea = po.getLandAreaSelfUse();
+        this.landIdelUseArea = po.getLandAreaIdle();
+        this.landRentUseArea = po.getLandAreaRent();
+        this.lanNoUnavailableArea = po.getLandAreaUnusable();
+        this.landCertificate = po.getHasLandDeed();
+        this.noLandCertificateReason = po.getNoLandDeedReason();
+        this.protectLandRisk = po.getLandPreservationRisk();
+        this.clearingLand = po.getOpenSpace();
+        this.courtyard = po.getCourtyard();
+        this.unrelatedAssets = po.getUnrelatedAssets();
+        this.assetCode = po.getAssetsNum();
+        this.astsLabe = po.getAssetsTagNum();
+        this.responsibleDepartment = po.getResponsibleDepartment();
+        this.responsiblePerson = po.getPersonInCharge();
+        this.buildingActualPropertyOwner = po.getPropertyOwner();
+        this.specialInstructions = po.getSpecialSpecification();
+        this.buildingLongitude = po.getLngJt();
+        this.buildingDimension = po.getLatJt();
+        this.buildingAddressNumber = po.getSiteNum();
+    }
+}

+ 586 - 1
src/main/java/com/example/service/house/HouseWzLandManageDetailsService.java

@@ -1,25 +1,60 @@
 package com.example.service.house;
 
+import cn.hutool.core.net.URLEncodeUtil;
+import com.baomidou.mybatisplus.core.metadata.OrderItem;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.example.common.PageVo;
 import com.example.common.Rsp;
 import com.example.dao.WzOtnAreaDao;
+import com.example.dao.house.HouseLandDao;
+import com.example.entity.house.HouseLandPo;
 import com.example.entity.house.HouseSitePo;
+import com.example.entity.house.LandIdleStatPo;
+import com.example.enums.ListLandOrderEnum;
+import com.example.enums.OrderEnum;
+import com.example.pojo.bo.LandIdleStatBo;
 import com.example.pojo.bo.ListHouseSiteBo;
+import com.example.pojo.bo.ListLandBo;
+import com.example.pojo.dto.LandIdleStatDto;
+import com.example.pojo.dto.ListLandDto;
 import com.example.pojo.dto.ListSiteNameDto;
 import com.example.pojo.dto.ListSiteNumDto;
+import com.example.pojo.vo.LandIdleStatVo;
+import com.example.pojo.vo.ListLandVo;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.CellStyle;
+import org.apache.poi.ss.usermodel.DataFormat;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
+import org.apache.poi.xssf.streaming.SXSSFSheet;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
 
+import javax.servlet.http.HttpServletResponse;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Stream;
 
 @Slf4j
 @Service
 public class HouseWzLandManageDetailsService {
     private final WzOtnAreaDao wzOtnAreaDao;
+    private final HouseLandDao houseLandDao;
 
-    public HouseWzLandManageDetailsService(WzOtnAreaDao wzOtnAreaDao) {
+    public HouseWzLandManageDetailsService(WzOtnAreaDao wzOtnAreaDao, HouseLandDao houseLandDao) {
         this.wzOtnAreaDao = wzOtnAreaDao;
+        this.houseLandDao = houseLandDao;
     }
 
     public Rsp<PageVo<String>> listSiteName(ListSiteNameDto dto) {
@@ -53,4 +88,554 @@ public class HouseWzLandManageDetailsService {
         PageVo<String> pageVo = new PageVo<>(vos, page);
         return Rsp.ok(pageVo);
     }
+
+    public Rsp<PageVo<LandIdleStatVo>> landIdleStat(LandIdleStatDto dto) {
+        LandIdleStatPo pos = getLandIdleStatPos(dto);
+        if (pos == null) {
+            return Rsp.ok();
+        }
+        LandIdleStatVo vo = new LandIdleStatVo(pos, false);
+        PageVo<LandIdleStatVo> pageVo = new PageVo<>(Collections.singletonList(vo));
+        return Rsp.ok(pageVo);
+    }
+
+    private LandIdleStatPo getLandIdleStatPos(LandIdleStatDto dto) {
+        LandIdleStatBo bo = new LandIdleStatBo();
+        if (dto.getMap() != null && dto.getMap().getStatisticalMonth() != null) {
+            bo.setYearMonth(dto.getMap().getStatisticalMonth());
+        }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getCity()) && !"全省".equals(dto.getMap().getCity())) {
+            bo.setAreaNo(dto.getMap().getCity());
+        }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getCounty())) {
+            bo.setCityNo(dto.getMap().getCounty());
+        }
+        // 查询三级单位统计
+        List<LandIdleStatPo> landIdleStatPos = houseLandDao.landIdleStat(bo);
+        if (CollectionUtils.isEmpty(landIdleStatPos)) {
+            return null;
+        }
+        // 一级单位统计
+        LandIdleStatPo firstUnitPo = new LandIdleStatPo();
+        firstUnitPo.setAreaName("全省");
+        firstUnitPo.setCityName("全省");
+        LinkedHashMap<String, LandIdleStatPo> secondUnitPoMap = new LinkedHashMap<>();
+        // 二级单位统计
+        for (LandIdleStatPo houseAgeStatPo : landIdleStatPos) {
+            secondUnitPoMap.putIfAbsent(houseAgeStatPo.getAreaNo(),
+                    new LandIdleStatPo(houseAgeStatPo.getAreaNo(), houseAgeStatPo.getAreaName()));
+            LandIdleStatPo secondUnitPo = secondUnitPoMap.get(houseAgeStatPo.getAreaNo());
+            secondUnitPo.update(houseAgeStatPo);
+        }
+        for (LandIdleStatPo value : secondUnitPoMap.values()) {
+            firstUnitPo.update(value);
+        }
+        return firstUnitPo;
+    }
+
+    public void landIdleStatExport(LandIdleStatDto.LandIdleStatMapDTO dto) {
+        ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder
+                .getRequestAttributes();
+        if (servletRequestAttributes == null) {
+            return;
+        }
+        HttpServletResponse response = servletRequestAttributes.getResponse();
+        if (response == null) {
+            return;
+        }
+        String filename = "土地管理_闲置管理"
+                + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + ".xlsx";
+        response.setHeader("Content-Disposition", "attachment;filename=" + URLEncodeUtil.encode(filename));
+        response.setContentType("application/octet-stream");
+        try (SXSSFWorkbook wb = new SXSSFWorkbook()) {
+            writeLandIdleStat(new LandIdleStatDto(dto), wb);
+            wb.write(response.getOutputStream());
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+    }
+
+    private void writeLandIdleStat(LandIdleStatDto dto, SXSSFWorkbook wb) {
+        LandIdleStatPo firstPo = getLandIdleStatPos(dto);
+        DataFormat dataFormat = wb.createDataFormat();
+        // 数字样式
+        CellStyle numberCellStyle = wb.createCellStyle();
+        numberCellStyle.setDataFormat(dataFormat.getFormat("#,##0.00"));
+        numberCellStyle.setAlignment(HorizontalAlignment.RIGHT);
+        // 默认样式
+        CellStyle baseCellStyle = wb.createCellStyle();
+        baseCellStyle.setAlignment(HorizontalAlignment.CENTER);
+        baseCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+        // 百分比样式
+        CellStyle percentCellStyle = wb.createCellStyle();
+        percentCellStyle.setDataFormat(dataFormat.getFormat("0.00%"));
+        percentCellStyle.setAlignment(HorizontalAlignment.RIGHT);
+        SXSSFSheet sheet = wb.createSheet();
+        AtomicInteger rowIndex = new AtomicInteger(0);
+        // 表头
+        Row headerRow = sheet.createRow(rowIndex.getAndIncrement());
+        List<String> headers = Stream.of("资产所属单位(一级)", "资产所属单位(二级)", "资产所属单位(三级)",
+                "土地总面积(㎡)", "土地自用面积(㎡)", "土地不可使用面积(㎡)","土地出租面积(㎡)", "土地闲置面积(㎡)", "闲置率(%)")
+                .toList();
+        int headerLength = headers.size();
+        for (int i = 0; i < headerLength; i++) {
+            Cell cell = headerRow.createCell(i);
+            cell.setCellValue(headers.get(i));
+            cell.setCellStyle(baseCellStyle);
+            // 根据内容长度设置列宽
+            int columnWidth = headers.get(i).length() * 256 * 2 + 256;
+            sheet.setColumnWidth(i, columnWidth);
+        }
+        if (firstPo == null) {
+            return;
+        }
+        // 数据
+        AtomicInteger columnIndex1 = new AtomicInteger(0);
+        // 一级单位统计
+        Row row1 = sheet.createRow(rowIndex.getAndIncrement());
+        // 资产所属单位(一级)
+        Cell firstUnitCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getAreaName() != null) {
+            firstUnitCell1.setCellValue(firstPo.getAreaName());
+        }
+        // 二级单位
+        Cell areaNameCell1 = row1.createCell(columnIndex1.getAndIncrement());
+//        if (firstPo.getAreaName() != null) {
+//            areaNameCell1.setCellValue(firstPo.getAreaName());
+//        }
+        // 三级单位
+        Cell cityNameCell1 = row1.createCell(columnIndex1.getAndIncrement());
+//        if (firstPo.getCityName() != null) {
+//            cityNameCell1.setCellValue(firstPo.getCityName());
+//        }
+        // 土地总面积(㎡)
+        Cell totalLandAreaSumCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getTotalLandAreaSum() != null) {
+            totalLandAreaSumCell1.setCellValue(firstPo.getTotalLandAreaSum().doubleValue());
+        }
+        totalLandAreaSumCell1.setCellStyle(numberCellStyle);
+        // 土地自用面积(㎡)
+        Cell landAreaSelfUseSumCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getLandAreaSelfUseSum() != null) {
+            landAreaSelfUseSumCell1.setCellValue(firstPo.getLandAreaSelfUseSum().doubleValue());
+        }
+        landAreaSelfUseSumCell1.setCellStyle(numberCellStyle);
+        // 土地不可使用面积(㎡)
+        Cell landAreaUnusableSumCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getLandAreaUnusableSum() != null) {
+            landAreaUnusableSumCell1.setCellValue(firstPo.getLandAreaUnusableSum().doubleValue());
+        }
+        landAreaUnusableSumCell1.setCellStyle(numberCellStyle);
+        // 土地出租面积(㎡)
+        Cell landAreaRentSumCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getLandAreaRentSum() != null) {
+            landAreaRentSumCell1.setCellValue(firstPo.getLandAreaRentSum().doubleValue());
+        }
+        landAreaRentSumCell1.setCellStyle(numberCellStyle);
+        // 土地闲置面积(㎡)
+        Cell landAreaIdleSumCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getLandAreaIdleSum() != null) {
+            landAreaIdleSumCell1.setCellValue(firstPo.getLandAreaIdleSum().doubleValue());
+        }
+        landAreaIdleSumCell1.setCellStyle(numberCellStyle);
+        // 闲置率
+        Cell idlePercentCell1 = row1.createCell(columnIndex1.getAndIncrement());
+        if (firstPo.getIdlePercent() != null) {
+            idlePercentCell1.setCellValue(firstPo.getIdlePercent().doubleValue());
+        }
+        idlePercentCell1.setCellStyle(percentCellStyle);
+        // 二级单位统计
+        for (LandIdleStatPo secondPo : firstPo.getChildren()) {
+            AtomicInteger columnIndex2 = new AtomicInteger(0);
+            // 一级单位统计
+            Row row2 = sheet.createRow(rowIndex.getAndIncrement());
+            // 资产所属单位(一级)
+            Cell firstUnitCell2 = row2.createCell(columnIndex2.getAndIncrement());
+//            if (secondPo.getAreaName() != null) {
+//                firstUnitCell2.setCellValue(secondPo.getAreaName());
+//            }
+            // 二级单位
+            Cell areaNameCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getAreaName() != null) {
+                areaNameCell2.setCellValue(secondPo.getAreaName());
+            }
+            // 三级单位
+            Cell cityNameCell2 = row2.createCell(columnIndex2.getAndIncrement());
+//            if (secondPo.getCityName() != null) {
+//                cityNameCell2.setCellValue(secondPo.getCityName());
+//            }
+            // 土地总面积(㎡)
+            Cell totalLandAreaSumCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getTotalLandAreaSum() != null) {
+                totalLandAreaSumCell2.setCellValue(secondPo.getTotalLandAreaSum().doubleValue());
+            }
+            totalLandAreaSumCell2.setCellStyle(numberCellStyle);
+            // 土地自用面积(㎡)
+            Cell landAreaSelfUseSumCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getLandAreaSelfUseSum() != null) {
+                landAreaSelfUseSumCell2.setCellValue(secondPo.getLandAreaSelfUseSum().doubleValue());
+            }
+            landAreaSelfUseSumCell2.setCellStyle(numberCellStyle);
+            // 土地不可使用面积(㎡)
+            Cell landAreaUnusableSumCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getLandAreaUnusableSum() != null) {
+                landAreaUnusableSumCell2.setCellValue(secondPo.getLandAreaUnusableSum().doubleValue());
+            }
+            landAreaUnusableSumCell2.setCellStyle(numberCellStyle);
+            // 土地出租面积(㎡)
+            Cell landAreaRentSumCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getLandAreaRentSum() != null) {
+                landAreaRentSumCell2.setCellValue(secondPo.getLandAreaRentSum().doubleValue());
+            }
+            landAreaRentSumCell2.setCellStyle(numberCellStyle);
+            // 土地闲置面积(㎡)
+            Cell landAreaIdleSumCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getLandAreaIdleSum() != null) {
+                landAreaIdleSumCell2.setCellValue(secondPo.getLandAreaIdleSum().doubleValue());
+            }
+            landAreaIdleSumCell2.setCellStyle(numberCellStyle);
+            // 闲置率
+            Cell idlePercentCell2 = row2.createCell(columnIndex2.getAndIncrement());
+            if (secondPo.getIdlePercent() != null) {
+                idlePercentCell2.setCellValue(secondPo.getIdlePercent().doubleValue());
+            }
+            idlePercentCell2.setCellStyle(percentCellStyle);
+            // 三级单位统计
+            for (LandIdleStatPo thirdPo : secondPo.getChildren()) {
+                AtomicInteger columnIndex3 = new AtomicInteger(0);
+                Row row3 = sheet.createRow(rowIndex.getAndIncrement());
+                // 资产所属单位(一级)
+                Cell firstUnitCell3 = row3.createCell(columnIndex3.getAndIncrement());
+//                if (thirdPo.getAreaName() != null) {
+//                    firstUnitCell3.setCellValue(thirdPo.getAreaName());
+//                }
+                // 二级单位
+                Cell areaNameCell3 = row3.createCell(columnIndex3.getAndIncrement());
+//                if (thirdPo.getAreaName() != null) {
+//                    areaNameCell3.setCellValue(thirdPo.getAreaName());
+//                }
+                // 三级单位
+                Cell cityNameCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getCityName() != null) {
+                    cityNameCell3.setCellValue(thirdPo.getCityName());
+                }
+                // 土地总面积(㎡)
+                Cell totalLandAreaSumCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getTotalLandAreaSum() != null) {
+                    totalLandAreaSumCell3.setCellValue(thirdPo.getTotalLandAreaSum().doubleValue());
+                }
+                totalLandAreaSumCell3.setCellStyle(numberCellStyle);
+                // 土地自用面积(㎡)
+                Cell landAreaSelfUseSumCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getLandAreaSelfUseSum() != null) {
+                    landAreaSelfUseSumCell3.setCellValue(thirdPo.getLandAreaSelfUseSum().doubleValue());
+                }
+                landAreaSelfUseSumCell3.setCellStyle(numberCellStyle);
+                // 土地不可使用面积(㎡)
+                Cell landAreaUnusableSumCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getLandAreaUnusableSum() != null) {
+                    landAreaUnusableSumCell3.setCellValue(thirdPo.getLandAreaUnusableSum().doubleValue());
+                }
+                landAreaUnusableSumCell3.setCellStyle(numberCellStyle);
+                // 土地出租面积(㎡)
+                Cell landAreaRentSumCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getLandAreaRentSum() != null) {
+                    landAreaRentSumCell3.setCellValue(thirdPo.getLandAreaRentSum().doubleValue());
+                }
+                landAreaRentSumCell3.setCellStyle(numberCellStyle);
+                // 土地闲置面积(㎡)
+                Cell landAreaIdleSumCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getLandAreaIdleSum() != null) {
+                    landAreaIdleSumCell3.setCellValue(thirdPo.getLandAreaIdleSum().doubleValue());
+                }
+                landAreaIdleSumCell3.setCellStyle(numberCellStyle);
+                // 闲置率
+                Cell idlePercentCell3 = row3.createCell(columnIndex3.getAndIncrement());
+                if (thirdPo.getIdlePercent() != null) {
+                    idlePercentCell3.setCellValue(thirdPo.getIdlePercent().doubleValue());
+                }
+                idlePercentCell3.setCellStyle(percentCellStyle);
+            }
+        }
+    }
+
+    public Rsp<PageVo<ListLandVo>> queryLandDetail(ListLandDto dto) {
+        Page<HouseLandPo> page = new Page<>(dto.getPage().getPageNum(), dto.getPage().getPageSize());
+        List<HouseLandPo> list = getLandList(dto, page);
+        List<ListLandVo> vos = new ArrayList<>();
+        for (HouseLandPo po : list) {
+            vos.add(new ListLandVo(po));
+        }
+        PageVo<ListLandVo> pageVo = new PageVo<>(vos, page);
+        return Rsp.ok(pageVo);
+    }
+
+    private List<HouseLandPo> getLandList(ListLandDto dto, Page<HouseLandPo> page) {
+        ListLandBo bo = new ListLandBo();
+        if (dto.getMap() != null && dto.getMap().getStatisticalMonth() != null) {
+            bo.setYearMonth(dto.getMap().getStatisticalMonth());
+        }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getCity()) && !"全省".equals(dto.getMap().getCity())) {
+            bo.setAreaNo(dto.getMap().getCity());
+        }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getCounty())) {
+            bo.setCityNo(dto.getMap().getCounty());
+        }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getCode())) {
+            bo.setSiteNum(dto.getMap().getCode());
+        }
+        if (dto.getMap() != null && StringUtils.hasText(dto.getMap().getBuildingNameAlias())) {
+            bo.setSiteName(dto.getMap().getBuildingNameAlias());
+        }
+        if (dto.getMap() != null && dto.getMap().getOrder() != null && dto.getMap().getSidx() != null) {
+            if (OrderEnum.asc.equals(dto.getMap().getOrder())) {
+                page.addOrder(OrderItem.asc(dto.getMap().getSidx().getColumnName()));
+            } else {
+                page.addOrder(OrderItem.desc(dto.getMap().getSidx().getColumnName()));
+            }
+        } else {
+            page.addOrder(OrderItem.desc(ListLandOrderEnum.totalLandArea.getColumnName()));
+        }
+        return houseLandDao.listLand(page, bo);
+    }
+
+    public void queryLandDetailExport(ListLandDto.ListLandMapDTO dto) {
+        ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder
+                .getRequestAttributes();
+        if (servletRequestAttributes == null) {
+            return;
+        }
+        HttpServletResponse response = servletRequestAttributes.getResponse();
+        if (response == null) {
+            return;
+        }
+        String filename = "土地管理_土地记录"
+                + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")) + ".xlsx";
+        response.setHeader("Content-Disposition", "attachment;filename=" + URLEncodeUtil.encode(filename));
+        response.setContentType("application/octet-stream");
+        try (SXSSFWorkbook wb = new SXSSFWorkbook()) {
+            writeListLand(new ListLandDto(dto), wb);
+            wb.write(response.getOutputStream());
+        } catch (Exception e) {
+            log.error(e.getMessage(), e);
+        }
+    }
+
+    private void writeListLand(ListLandDto dto, SXSSFWorkbook wb) {
+        Page<HouseLandPo> page = new Page<>(1, Long.MAX_VALUE);
+        List<HouseLandPo> list = getLandList(dto, page);
+        DataFormat dataFormat = wb.createDataFormat();
+        // 数字样式
+        CellStyle numberCellStyle = wb.createCellStyle();
+        numberCellStyle.setDataFormat(dataFormat.getFormat("#,##0.00"));
+        numberCellStyle.setAlignment(HorizontalAlignment.RIGHT);
+        // 默认样式
+        CellStyle baseCellStyle = wb.createCellStyle();
+        baseCellStyle.setAlignment(HorizontalAlignment.CENTER);
+        baseCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+        SXSSFSheet sheet = wb.createSheet();
+        AtomicInteger rowIndex = new AtomicInteger(0);
+        // 表头
+        Row headerRow = sheet.createRow(rowIndex.getAndIncrement());
+        List<String> headers = Stream.of("资产所属单位(一级)", "资产所属单位(二级)", "资产所属单位(三级)", "局址编号",
+                "局址别名", "土地别名", "土地性质", "使用权类型", "地类用途", "取得日期", "闲置开始时间", "标准地址",
+                "投资主体", "管理层级", "权属状态", "使用状态", "土地总面积(㎡)","土地自用面积(㎡)", "土地闲置面积(㎡)",
+                "土地出租面积(㎡)", "土地不可使用面积(㎡)", "是否有土地证", "无土地证原因", "是否有保地风险", "是否空地",
+                "是否有院落", "未关联资产", "资产编号", "资产标签号", "责任部门", "责任人", "经度", "纬度", "实际产权人",
+                "特殊说明").toList();
+        int headerLength = headers.size();
+        for (int i = 0; i < headerLength; i++) {
+            Cell cell = headerRow.createCell(i);
+            cell.setCellValue(headers.get(i));
+            cell.setCellStyle(baseCellStyle);
+            // 根据内容长度设置列宽
+            int columnWidth = headers.get(i).length() * 256 * 2 + 256;
+            sheet.setColumnWidth(i, columnWidth);
+        }
+        // 数据
+        for (HouseLandPo po : list) {
+            AtomicInteger columnIndex = new AtomicInteger(0);
+            Row row = sheet.createRow(rowIndex.getAndIncrement());
+            // 资产所属单位(一级)
+            Cell firstUnitCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getFirstUnit() != null) {
+                firstUnitCell.setCellValue(po.getFirstUnit());
+            }
+            // 二级单位
+            Cell areaNameCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getAreaName() != null) {
+                areaNameCell.setCellValue(po.getAreaName());
+            }
+            // 三级单位
+            Cell cityNameCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getCityName() != null) {
+                cityNameCell.setCellValue(po.getCityName());
+            }
+            // 局址编号
+            Cell siteNumCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getSiteName() != null) {
+                siteNumCell.setCellValue(po.getSiteNum());
+            }
+            // 局址别名
+            Cell siteNameCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getSiteName() != null) {
+                siteNameCell.setCellValue(po.getSiteName());
+            }
+            // 土地别名
+            Cell landNameCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getLandName() != null) {
+                landNameCell.setCellValue(po.getLandName());
+            }
+            // 土地性质
+            Cell landOwnershipCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getLandOwnership() != null) {
+                landOwnershipCell.setCellValue(po.getLandOwnership());
+            }
+            // 使用权类型
+            Cell useRightTypeCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getUseRightType() != null) {
+                useRightTypeCell.setCellValue(po.getUseRightType());
+            }
+            // 地类用途
+            Cell landUseCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getLandUse() != null) {
+                landUseCell.setCellValue(po.getLandUse());
+            }
+            // 取得日期
+            Cell acquisitionDateCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getAcquisitionDate() != null) {
+                acquisitionDateCell.setCellValue(po.getAcquisitionDate());
+            }
+            // 闲置开始时间
+            Cell idleStartDateCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getIdleStartDate() != null) {
+                idleStartDateCell.setCellValue(po.getIdleStartDate());
+            }
+            // 标准地址
+            Cell addressCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getAddress() != null) {
+                addressCell.setCellValue(po.getAddress());
+            }
+            // 投资主体
+            Cell investorCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getInvestor() != null) {
+                investorCell.setCellValue(po.getInvestor());
+            }
+            // 管理层级
+            Cell managementLevelCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getManagementLevel() != null) {
+                managementLevelCell.setCellValue(po.getManagementLevel());
+            }
+            // 权属状态
+            Cell ownershipStatusCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getOwnershipStatus() != null) {
+                ownershipStatusCell.setCellValue(po.getOwnershipStatus());
+            }
+            // 使用状态
+            Cell usageStatusCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getUsageStatus() != null) {
+                usageStatusCell.setCellValue(po.getUsageStatus());
+            }
+            // 土地总面积(㎡)
+            Cell totalLandAreaCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getTotalLandArea() != null) {
+                totalLandAreaCell.setCellValue(po.getTotalLandArea().doubleValue());
+            }
+            totalLandAreaCell.setCellStyle(numberCellStyle);
+            // 土地自用面积(㎡)
+            Cell landAreaSelfUseCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getLandAreaSelfUse() != null) {
+                landAreaSelfUseCell.setCellValue(po.getLandAreaSelfUse().doubleValue());
+            }
+            landAreaSelfUseCell.setCellStyle(numberCellStyle);
+            // 土地闲置面积(㎡)
+            Cell landAreaIdleCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getLandAreaIdle() != null) {
+                landAreaIdleCell.setCellValue(po.getLandAreaIdle().doubleValue());
+            }
+            landAreaIdleCell.setCellStyle(numberCellStyle);
+            // 土地出租面积(㎡)
+            Cell landAreaRentCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getLandAreaRent() != null) {
+                landAreaRentCell.setCellValue(po.getLandAreaRent().doubleValue());
+            }
+            landAreaRentCell.setCellStyle(numberCellStyle);
+            // 土地不可使用面积(㎡)
+            Cell landAreaUnusableCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getLandAreaUnusable() != null) {
+                landAreaUnusableCell.setCellValue(po.getLandAreaUnusable().doubleValue());
+            }
+            landAreaUnusableCell.setCellStyle(numberCellStyle);
+            // 是否有土地证
+            Cell hasLandDeedCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getHasLandDeed() != null) {
+                hasLandDeedCell.setCellValue(po.getHasLandDeed());
+            }
+            // 无土地证原因
+            Cell noLandDeedReasonCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getNoLandDeedReason() != null) {
+                noLandDeedReasonCell.setCellValue(po.getNoLandDeedReason());
+            }
+            // 是否有保地风险
+            Cell landPreservationRiskCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getLandPreservationRisk() != null) {
+                landPreservationRiskCell.setCellValue(po.getLandPreservationRisk());
+            }
+            // 是否空地
+            Cell openSpaceCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getOpenSpace() != null) {
+                openSpaceCell.setCellValue(po.getOpenSpace());
+            }
+            // 是否有院落
+            Cell courtyardCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getCourtyard() != null) {
+                courtyardCell.setCellValue(po.getCourtyard());
+            }
+            // 未关联资产
+            Cell unrelatedAssetsCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getUnrelatedAssets() != null) {
+                unrelatedAssetsCell.setCellValue(po.getUnrelatedAssets());
+            }
+            // 资产编号
+            Cell assetsNumCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getAssetsNum() != null) {
+                assetsNumCell.setCellValue(po.getAssetsNum());
+            }
+            // 资产标签号
+            Cell assetsTagNumCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getAssetsTagNum() != null) {
+                assetsTagNumCell.setCellValue(po.getAssetsTagNum());
+            }
+            // 责任部门
+            Cell responsibleDepartmentCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getResponsibleDepartment() != null) {
+                responsibleDepartmentCell.setCellValue(po.getResponsibleDepartment());
+            }
+            // 责任人
+            Cell personInChargeCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getPersonInCharge() != null) {
+                personInChargeCell.setCellValue(po.getPersonInCharge());
+            }
+            // 经度
+            Cell lngJtCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getLngJt() != null) {
+                lngJtCell.setCellValue(po.getLngJt().toString());
+            }
+            // 纬度
+            Cell latJtCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getLatJt() != null) {
+                latJtCell.setCellValue(po.getLatJt().toString());
+            }
+            // 实际产权人
+            Cell propertyOwnerCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getPropertyOwner() != null) {
+                propertyOwnerCell.setCellValue(po.getPropertyOwner());
+            }
+            // 特殊说明
+            Cell specialSpecificationCell = row.createCell(columnIndex.getAndIncrement());
+            if (po.getSpecialSpecification() != null) {
+                specialSpecificationCell.setCellValue(po.getSpecialSpecification());
+            }
+        }
+    }
 }