Explorar o código

房屋分析自然幢统计

chenendian hai 1 semana
pai
achega
6653695a13

+ 123 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/HouseAnalysisController.java

@@ -0,0 +1,123 @@
+package com.siwei.apply.controller.cadastre;
+
+import com.siwei.apply.domain.cadastre.*;
+import com.siwei.apply.service.cadastre.IHouselService;
+import com.siwei.common.core.domain.R;
+import com.siwei.common.core.web.controller.BaseController;
+import org.apache.poi.ss.usermodel.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 房屋分析模块
+ *
+ */
+@RestController
+@RequestMapping("/cadastre/house")
+public class HouseAnalysisController extends BaseController {
+
+    @Autowired
+    private IHouselService  houselService;
+
+
+    /**
+     *
+     * 地籍分析接口
+     * 通过地籍代码获取年度统计数据
+     *
+     */
+    @GetMapping("/zd/{djzqdm}")
+    public R<List<Zdjbxx>> getZDList(@PathVariable String djzqdm) {
+        try {
+            List<Zdjbxx> res =  null;
+            return R.ok(res);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(e.getMessage());
+        }
+    }
+
+
+
+    /**
+     *
+     * 地籍分析接口
+     * 通过地籍代码获取年度统计数据
+     *
+     */
+    @GetMapping("/statistics/{djzqdm}")
+    public R<HouseStatisticsRes> getStatistics(@PathVariable String djzqdm) {
+        try {
+            HouseStatisticsRes res =  houselService.statistics(djzqdm);
+            return R.ok(res);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(e.getMessage());
+        }
+    }
+
+
+
+
+
+
+
+
+
+    /**
+     * 宗地分析报表-宗地权利报表
+     * 按地籍子区统计各权利类型(已登记/未登记/合计)面积(单位:亩)
+     *
+     * @return ZdqlReportVO 含列头定义、各地籍子区数据行、合计行
+     */
+    @GetMapping("/report/zdql")
+    public R<ZdqlReportVO> getZdqlReport() {
+        try {
+            ZdqlReportVO res = null;
+            return R.ok(res);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(e.getMessage());
+        }
+    }
+
+
+    /**
+     * 导出宗地权利报表(Excel格式)
+     * 表格结构:
+     *   - 第1行:报表标题
+     *   - 第2行:列头(地籍子区代码、地籍子区名称、5种权利类型名称)
+     *   - 第3行:列头子行(合计面积、已登记面积、未登记面积)
+     *   - 数据行:各地籍子区数据
+     *   - 末行:合计行
+     */
+    @PostMapping("/zdql/export")
+    public void exportZdqlReport(HttpServletResponse response) {
+
+    }
+
+
+
+
+    /**
+     * 宗地用途报表
+     * @return
+     */
+    @GetMapping("/report/zdyt")
+    public R<ZdytReportVO> getZdytReport() {
+        try {
+            ZdytReportVO res = null;
+            return R.ok(res);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return R.fail(e.getMessage());
+        }
+    }
+
+
+
+
+}

+ 66 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/HouseStatisticsAreaRes.java

@@ -0,0 +1,66 @@
+package com.siwei.apply.domain.cadastre;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ *
+ * 地籍分析vo对象
+ */
+@Data
+public class HouseStatisticsAreaRes {
+
+    private List<HouseStatisticsRes.DetailDTO> landNumStatisticsList; // 数统计
+    private List<HouseStatisticsRes.FwytDTO> fwytStatisticsList; // 房屋用途统计
+    private List<HouseStatisticsRes.FwxzDTO> qlxzStatisticsList; // 房屋性质统计
+    private List<HouseStatisticsRes.FwjgDTO>  fwjgStatisticsList; // 房屋结构统计
+    private List<HouseStatisticsRes.FwjsnfDTO> jsnfStatisticsList; // 房屋建设年份
+
+
+    @Data
+    public static class DetailDTO {
+        private Integer zrzs; // 自然幢数(个)
+        private Double zdmj; //占地面积(亩)
+        private Double jzzmj; //建筑总面积(亩)
+        private String djzt; //登记状态 (0,全部,1-已登记。2-未登记)
+    }
+
+
+
+    @Data
+    public static class FwytDTO {
+        private String fwytmc; // 房屋用途名称
+        private String fwytmj; // 房屋用途建筑面积(亩)
+    }
+
+    @Data
+    public static class FwxzDTO {
+        private String fwxzmc; // 房屋性质名称
+        private String fwxzmj; // 房屋性质建筑面积(亩)
+    }
+
+    /**
+     * 房屋结构
+     */
+    @Data
+    public static class FwjgDTO {
+        private String fwjgmc; // 房屋结构名称
+        private String fwjgmj; // 房屋结构面积(亩)
+    }
+
+
+    /**
+     * 房屋建设年份
+     */
+    @Data
+    public static class FwjsnfDTO {
+        private String fwjsnfmc; // 年分名称
+        private String fwjsnfmj; // 房屋建设年份分类面积(亩)
+    }
+
+
+
+
+
+}

+ 62 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/HouseStatisticsRes.java

@@ -0,0 +1,62 @@
+package com.siwei.apply.domain.cadastre;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ *
+ * 地籍分析vo对象
+ */
+@Data
+public class HouseStatisticsRes {
+
+    private List<DetailDTO> landNumStatisticsList; // 数统计
+    private List<FwytDTO> fwytStatisticsList; // 房屋用途统计
+    private List<FwxzDTO> fwxzStatisticsList; // 房屋性质统计
+    private List<FwjgDTO>  fwjgStatisticsList; // 房屋结构统计
+    private List<FwjsnfDTO> jsnfStatisticsList; // 房屋建设年份
+
+
+    @Data
+    public static class DetailDTO {
+        private Integer zrzs; // 自然幢数(个)
+        private Double zdmj; //占地面积(亩)
+        private Double jzzmj; //建筑总面积(亩)
+        private String djzt; //登记状态 (0,全部,1-已登记。2-未登记)
+    }
+
+    @Data
+    public static class FwytDTO {
+        private String fwytmc; // 房屋用途名称
+        private String fwytgs; // 房屋用途分类个数
+    }
+
+    @Data
+    public static class FwxzDTO {
+        private String fwxzmc; // 房屋性质名称
+        private String fwxzgs; // 房屋性质个数
+    }
+
+    /**
+     * 房屋结构
+     */
+    @Data
+    public static class FwjgDTO {
+        private String fwjgmc; // 房屋结构名称
+        private String fwjggs; // 房屋结构类型个数
+    }
+
+
+    /**
+     * 房屋建设年份
+     */
+    @Data
+    public static class FwjsnfDTO {
+        private String fwjsnfmc; // 年分名称
+        private String fwjsnfgs; // 个数
+    }
+
+
+
+}

+ 138 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/domain/cadastre/Zrz.java

@@ -0,0 +1,138 @@
+package com.siwei.apply.domain.cadastre;
+
+import lombok.Data;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 幢属性结构描述表 ZRZ
+ */
+@Data
+public class Zrz {
+    /** 标识码 */
+    private Integer bsm;
+    /** 要素代码 */
+    private String ysdm;
+    /** 不动产单元号 */
+    private String bdcdyh;
+    /** 宗地代码 */
+    private String zddm;
+    /** 项目编号 */
+    private String xmbh;
+    /** 调查类型特征码 */
+    private String dclxtzm;
+    /** 管理号 */
+    private String glh;
+    /** 电子监管号 */
+    private String dzjgh;
+    /** 幢号 */
+    private String zrzh;
+    /** 楼幢代码 */
+    private String lzdm;
+    /** 楼幢坐落 */
+    private String lzzl;
+    /** 项目名称 */
+    private String xmmc;
+    /** 建筑物名称 */
+    private String jzwmc;
+    /** 竣工日期 */
+    private Date jgrq;
+    /** 建筑物高度 */
+    private BigDecimal jzwgd;
+    /** 幢占地面积 */
+    private BigDecimal zzdmj;
+    /** 幢用地面积 */
+    private BigDecimal zydmj;
+    /** 预测建筑面积 */
+    private BigDecimal ycjzmj;
+    /** 实测建筑面积 */
+    private BigDecimal scjzmj;
+    /** 总层数 */
+    private Integer zcs;
+    /** 地上层数 */
+    private BigDecimal dscs;
+    /** 地下层数 */
+    private BigDecimal dxcs;
+    /** 地下深度 */
+    private BigDecimal dxsd;
+    /** 规划用途 */
+    private String ghyt;
+    /** 规划用途名称 */
+    private String ytmc;
+    /** 房屋批准用途 */
+    private String pzyt;
+    /** 房屋实际用途 */
+    private String sjyt;
+    /** 建筑结构 */
+    private String fwjg;
+    /** 总套数 */
+    private Integer zts;
+    /** 档案号 */
+    private String dah;
+    /** 备注 */
+    private String bz;
+    /** 状态 */
+    private String zt;
+    /** 登记状态 */
+    private String djzt;
+    /** 原不动产单元号 */
+    private String ybdcdyh;
+    /** 建设项目名称 */
+    private String jsxmmc;
+    /** 建设工程规划许可证号 */
+    private String jsgcghxkzh;
+    /** 建设工程规划许可证 */
+    private byte[] jsgcghxkz;
+    /** 乡村建设规划许可证号 */
+    private String xcjsghxkzh;
+    /** 乡村建设规划许可证 */
+    private byte[] xcjsghxkz;
+    /** 规划核实结果文件 */
+    private byte[] ghhsjgwj;
+    /** 权利人∣实际使用人类型码 */
+    private String qlrsjsyrlxm;
+    /** 房屋性质 */
+    private String fwxz;
+    /** 共有部分建筑面积 */
+    private BigDecimal gyjzmj;
+    /** 共有情况 */
+    private String gyqk;
+    /** 专有部分建筑面积 */
+    private BigDecimal zyjzmj;
+    /** 分摊建筑面积 */
+    private BigDecimal ftjzmj;
+    /** 房屋产权来源 */
+    private String fwcqly;
+    /** 产权来源证明材料 */
+    private byte[] cqlyzmcl;
+    /** 房屋权属界线示意图 */
+    private byte[] fwqsjxsyt;
+    /** 房产图 */
+    private byte[] fct;
+    /** 附加说明 */
+    private String fjsm;
+    /** 调查意见 */
+    private String dcyj;
+    /** 调查员 */
+    private String dcy;
+    /** 调查日期 */
+    private Date dcrq;
+    /** 审核意见 */
+    private String shyj;
+    /** 审核员 */
+    private String shy;
+    /** 审核日期 */
+    private Date shrq;
+    /** 房屋调查表 */
+    private byte[] fwdcb;
+    /** 房产草图 */
+    private byte[] fcct;
+    /** 幢不动产单元表 */
+    private byte[] bdcdyb;
+    /** 调查单位(机构) */
+    private String dcdw;
+    /** 空间 */
+    private String geom;
+    /** 有效标识:0-当前版本,1-历史版本 */
+    private Integer validFlag;
+}

+ 0 - 2
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/cadastre/ZdjbxxMapper.java

@@ -1,7 +1,5 @@
 package com.siwei.apply.mapper.cadastre;
 
-import com.siwei.apply.domain.cadastre.Djq;
-import com.siwei.apply.domain.cadastre.Djzq;
 import com.siwei.apply.domain.cadastre.Zdjbxx;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;

+ 58 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/cadastre/ZrzMapper.java

@@ -0,0 +1,58 @@
+package com.siwei.apply.mapper.cadastre;
+
+import com.siwei.apply.domain.cadastre.Zrz;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 土地供应实际用地情况表 数据层
+ */
+@Mapper
+public interface ZrzMapper {
+
+    /**
+     * 新增自然幢记录
+     */
+    void add(Zrz zrz);
+
+    /**
+     * 根据bsm获取自然幢记录
+     */
+    Zrz get(@Param("bsm") Integer bsm);
+
+    /**
+     * 根据地籍子区代码获取自然幢记录列表
+     */
+    List<Zrz> getListByDjzqdm(@Param("djzqdm") String djzqdm);
+
+    /**
+     * 获取自然幢记录列表
+     */
+    List<Zrz> getList();
+
+    /**
+     * 更新自然幢记录
+     */
+    void update(Zrz zrz);
+
+    /**
+     * 查询自然幢按规划用途统计
+     */
+    List<Map<String, Object>> getStatisticsByGhyt();
+
+    /**
+     * 按地籍子区 + 规划用途 + 登记状态统计自然幢建筑面积
+     * @param ghytCodes 要统计的规划用途代码列表
+     */
+    List<Map<String, Object>> getZrzqlReportData(@Param("ghytCodes") List<String> ghytCodes);
+
+    /**
+     * 根据类型获取字典数据
+     */
+    List<Map<String, Object>> getDictByType(@Param("type") String type, @Param("name") String name);
+
+}

+ 15 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/IHouselService.java

@@ -0,0 +1,15 @@
+package com.siwei.apply.service.cadastre;
+
+import com.siwei.apply.domain.cadastre.*;
+
+import java.util.List;
+import java.util.Map;
+
+public interface IHouselService {
+
+
+    HouseStatisticsRes statistics(String djzqdm);
+
+
+}
+

+ 218 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/HouseServiceImpl.java

@@ -0,0 +1,218 @@
+package com.siwei.apply.service.cadastre.impl;
+
+import com.siwei.apply.domain.cadastre.*;
+import com.siwei.apply.mapper.cadastre.ZrzMapper;
+import com.siwei.apply.service.cadastre.IHouselService;
+import com.siwei.common.core.exception.ServiceException;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@Service
+public class HouseServiceImpl implements IHouselService {
+
+
+    @Autowired
+    private ZrzMapper zrzMapper;
+
+
+    @Override
+    public HouseStatisticsRes statistics(String djzqdm) {
+        if (StringUtils.isBlank(djzqdm) || djzqdm.matches("[0]+")) {
+            djzqdm = "";
+        }
+        if (StringUtils.isNotBlank(djzqdm) && djzqdm.length() != 12) {
+            throw new ServiceException("地籍代码长度必须为12位");
+        }
+
+        HouseStatisticsRes res = new HouseStatisticsRes();
+        List<Zrz> zrzList = zrzMapper.getListByDjzqdm(djzqdm);
+
+        if (CollectionUtils.isNotEmpty(zrzList)) {
+            // 第一部分:登记状态统计
+            List<HouseStatisticsRes.DetailDTO> detailList = new ArrayList<>();
+            List<Zrz> registeredList = new ArrayList<>();
+            List<Zrz> unregisteredList = new ArrayList<>();
+
+            for (Zrz zrz : zrzList) {
+                String djzt = zrz.getDjzt();
+                if ("1".equals(djzt)) {
+                    registeredList.add(zrz);
+                } else if ("2".equals(djzt) || "3".equals(djzt)) {
+                    unregisteredList.add(zrz);
+                }
+            }
+
+            detailList.add(buildDetailDTO(registeredList, "1")); // 已登记
+            detailList.add(buildDetailDTO(unregisteredList, "2")); // 未登记
+            detailList.add(buildDetailDTO(zrzList, "0")); // 全部
+            res.setLandNumStatisticsList(detailList);
+
+            // 第二部分:房屋用途统计 (A11)
+            res.setFwytStatisticsList(getDictStatistics(zrzList, "A11", "ghyt"));
+
+            // 第三部分:房屋性质统计 (A13)
+            res.setFwxzStatisticsList(getFwxzStatistics(zrzList, "A13", "fwxz"));
+
+            // 第四部分:房屋结构统计 (A16)
+            res.setFwjgStatisticsList(getFwjgStatistics(zrzList, "A16", "fwjg"));
+
+            // 第五部分:房屋建设年份统计
+            res.setJsnfStatisticsList(getJsnfStatistics(zrzList));
+        }
+
+        return res;
+    }
+
+    private HouseStatisticsRes.DetailDTO buildDetailDTO(List<Zrz> list, String djzt) {
+        HouseStatisticsRes.DetailDTO detail = new HouseStatisticsRes.DetailDTO();
+        detail.setDjzt(djzt);
+        int zrzs = list.size();
+        double totalZdmj = 0.0;
+        double totalScjzmj = 0.0;
+
+        for (Zrz zrz : list) {
+            totalZdmj += convertAreaToMu(zrz.getZzdmj());
+            totalScjzmj += convertAreaToMu(zrz.getScjzmj());
+        }
+
+        detail.setZrzs(zrzs);
+        detail.setZdmj(totalZdmj);
+        detail.setJzzmj(totalScjzmj);
+
+        return detail;
+    }
+
+    private double convertAreaToMu(BigDecimal area) {
+        if (area == null) {
+            return 0.0;
+        }
+        // 根据要求三,表中单位为平方米,需要转化为亩
+        return area.doubleValue() / 666.6666667;
+    }
+
+    private List<HouseStatisticsRes.FwytDTO> getDictStatistics(List<Zrz> zrzList, String dictType, String fieldName) {
+        List<HouseStatisticsRes.FwytDTO> result = new ArrayList<>();
+        List<Map<String, Object>> dictList = zrzMapper.getDictByType(dictType, null);
+
+        Map<String, Long> groupedData = zrzList.stream()
+                .filter(zrz -> getFieldValue(zrz, fieldName) != null)
+                .collect(Collectors.groupingBy(zrz -> getFieldValue(zrz, fieldName), Collectors.counting()));
+
+        for (Map<String, Object> dict : dictList) {
+            String name = MapUtils.getString(dict, "name");
+            String value = MapUtils.getString(dict, "value");
+            if (groupedData.containsKey(value)) {
+                HouseStatisticsRes.FwytDTO dto = new HouseStatisticsRes.FwytDTO();
+                dto.setFwytmc(name);
+                dto.setFwytgs(String.valueOf(groupedData.get(value)));
+                result.add(dto);
+            }
+        }
+        return result;
+    }
+
+    private List<HouseStatisticsRes.FwxzDTO> getFwxzStatistics(List<Zrz> zrzList, String dictType, String fieldName) {
+        List<HouseStatisticsRes.FwxzDTO> result = new ArrayList<>();
+        List<Map<String, Object>> dictList = zrzMapper.getDictByType(dictType, null);
+
+        Map<String, Long> groupedData = zrzList.stream()
+                .filter(zrz -> getFieldValue(zrz, fieldName) != null)
+                .collect(Collectors.groupingBy(zrz -> getFieldValue(zrz, fieldName), Collectors.counting()));
+
+        for (Map<String, Object> dict : dictList) {
+            String name = MapUtils.getString(dict, "name");
+            String value = MapUtils.getString(dict, "value");
+            if (groupedData.containsKey(value)) {
+                HouseStatisticsRes.FwxzDTO dto = new HouseStatisticsRes.FwxzDTO();
+                dto.setFwxzmc(name);
+                dto.setFwxzgs(String.valueOf(groupedData.get(value)));
+                result.add(dto);
+            }
+        }
+        return result;
+    }
+
+    private List<HouseStatisticsRes.FwjgDTO> getFwjgStatistics(List<Zrz> zrzList, String dictType, String fieldName) {
+        List<HouseStatisticsRes.FwjgDTO> result = new ArrayList<>();
+        List<Map<String, Object>> dictList = zrzMapper.getDictByType(dictType, null);
+
+        Map<String, Long> groupedData = zrzList.stream()
+                .filter(zrz -> getFieldValue(zrz, fieldName) != null)
+                .collect(Collectors.groupingBy(zrz -> getFieldValue(zrz, fieldName), Collectors.counting()));
+
+        for (Map<String, Object> dict : dictList) {
+            String name = MapUtils.getString(dict, "name");
+            String value = MapUtils.getString(dict, "value");
+            if (groupedData.containsKey(value)) {
+                HouseStatisticsRes.FwjgDTO dto = new HouseStatisticsRes.FwjgDTO();
+                dto.setFwjgmc(name);
+                dto.setFwjggs(String.valueOf(groupedData.get(value)));
+                result.add(dto);
+            }
+        }
+        return result;
+    }
+
+    private List<HouseStatisticsRes.FwjsnfDTO> getJsnfStatistics(List<Zrz> zrzList) {
+        List<HouseStatisticsRes.FwjsnfDTO> result = new ArrayList<>();
+        
+        // 定义年份区间
+        String[] labels = {"1960年之前", "1961年-1969年", "1970年-1979年", "1980年-1989年", "1990年-1999年", "2000年-2009年", "2010年-2019年", "2020年之后"};
+        int[] counts = new int[labels.length];
+
+        for (Zrz zrz : zrzList) {
+            if (zrz.getJgrq() != null) {
+                java.util.Calendar cal = java.util.Calendar.getInstance();
+                cal.setTime(zrz.getJgrq());
+                int year = cal.get(java.util.Calendar.YEAR);
+
+                if (year <= 1960) counts[0]++;
+                else if (year >= 1961 && year <= 1969) counts[1]++;
+                else if (year >= 1970 && year <= 1979) counts[2]++;
+                else if (year >= 1980 && year <= 1989) counts[3]++;
+                else if (year >= 1990 && year <= 1999) counts[4]++;
+                else if (year >= 2000 && year <= 2009) counts[5]++;
+                else if (year >= 2010 && year <= 2019) counts[6]++;
+                else if (year >= 2020) counts[7]++;
+            }
+        }
+
+        for (int i = 0; i < labels.length; i++) {
+            if (counts[i] > 0) {
+                HouseStatisticsRes.FwjsnfDTO dto = new HouseStatisticsRes.FwjsnfDTO();
+                dto.setFwjsnfmc(labels[i]);
+                dto.setFwjsnfgs(String.valueOf(counts[i]));
+                result.add(dto);
+            }
+        }
+        return result;
+    }
+
+    private String getFieldValue(Zrz zrz, String fieldName) {
+        if (zrz == null || fieldName == null) return null;
+        switch (fieldName) {
+            case "ghyt": return zrz.getGhyt();
+            case "fwxz": return zrz.getFwxz();
+            case "fwjg": return zrz.getFwjg();
+            default: return null;
+        }
+    }
+
+
+
+
+
+
+
+
+
+}

+ 225 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/cadastre/ZrzMapper.xml

@@ -0,0 +1,225 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.siwei.apply.mapper.cadastre.ZrzMapper">
+
+    <resultMap id="BaseResultMap" type="com.siwei.apply.domain.cadastre.Zrz">
+        <id column="bsm" property="bsm"/>
+        <result column="ysdm" property="ysdm"/>
+        <result column="bdcdyh" property="bdcdyh"/>
+        <result column="zddm" property="zddm"/>
+        <result column="xmbh" property="xmbh"/>
+        <result column="dclxtzm" property="dclxtzm"/>
+        <result column="glh" property="glh"/>
+        <result column="dzjgh" property="dzjgh"/>
+        <result column="zrzh" property="zrzh"/>
+        <result column="lzdm" property="lzdm"/>
+        <result column="lzzl" property="lzzl"/>
+        <result column="xmmc" property="xmmc"/>
+        <result column="jzwmc" property="jzwmc"/>
+        <result column="jgrq" property="jgrq"/>
+        <result column="jzwgd" property="jzwgd"/>
+        <result column="zzdmj" property="zzdmj"/>
+        <result column="zydmj" property="zydmj"/>
+        <result column="ycjzmj" property="ycjzmj"/>
+        <result column="scjzmj" property="scjzmj"/>
+        <result column="zcs" property="zcs"/>
+        <result column="dscs" property="dscs"/>
+        <result column="dxcs" property="dxcs"/>
+        <result column="dxsd" property="dxsd"/>
+        <result column="ghyt" property="ghyt"/>
+        <result column="ytmc" property="ytmc"/>
+        <result column="pzyt" property="pzyt"/>
+        <result column="sjyt" property="sjyt"/>
+        <result column="fwjg" property="fwjg"/>
+        <result column="zts" property="zts"/>
+        <result column="dah" property="dah"/>
+        <result column="bz" property="bz"/>
+        <result column="zt" property="zt"/>
+        <result column="djzt" property="djzt"/>
+        <result column="ybdcdyh" property="ybdcdyh"/>
+        <result column="jsxmmc" property="jsxmmc"/>
+        <result column="jsgcghxkzh" property="jsgcghxkzh"/>
+        <result column="jsgcghxkz" property="jsgcghxkz"/>
+        <result column="xcjsghxkzh" property="xcjsghxkzh"/>
+        <result column="xcjsghxkz" property="xcjsghxkz"/>
+        <result column="ghhsjgwj" property="ghhsjgwj"/>
+        <result column="qlrsjsyrlxm" property="qlrsjsyrlxm"/>
+        <result column="fwxz" property="fwxz"/>
+        <result column="gyjzmj" property="gyjzmj"/>
+        <result column="gyqk" property="gyqk"/>
+        <result column="zyjzmj" property="zyjzmj"/>
+        <result column="ftjzmj" property="ftjzmj"/>
+        <result column="fwcqly" property="fwcqly"/>
+        <result column="cqlyzmcl" property="cqlyzmcl"/>
+        <result column="fwqsjxsyt" property="fwqsjxsyt"/>
+        <result column="fct" property="fct"/>
+        <result column="fjsm" property="fjsm"/>
+        <result column="dcyj" property="dcyj"/>
+        <result column="dcy" property="dcy"/>
+        <result column="dcrq" property="dcrq"/>
+        <result column="shyj" property="shyj"/>
+        <result column="shy" property="shy"/>
+        <result column="shrq" property="shrq"/>
+        <result column="fwdcb" property="fwdcb"/>
+        <result column="fcct" property="fcct"/>
+        <result column="bdcdyb" property="bdcdyb"/>
+        <result column="dcdw" property="dcdw"/>
+        <result column="geom" property="geom"/>
+        <result column="valid_flag" property="validFlag"/>
+    </resultMap>
+
+    <insert id="add" parameterType="com.siwei.apply.domain.cadastre.Zrz">
+        INSERT INTO vector.zrz (
+            bsm, ysdm, bdcdyh, zddm, xmbh, dclxtzm, glh, dzjgh, zrzh, lzdm,
+            lzzl, xmmc, jzwmc, jgrq, jzwgd, zzdmj, zydmj, ycjzmj, scjzmj, zcs,
+            dscs, dxcs, dxsd, ghyt, ytmc, pzyt, sjyt, fwjg, zts, dah, bz,
+            zt, djzt, ybdcdyh, jsxmmc, jsgcghxkzh, jsgcghxkz, xcjsghxkzh,
+            xcjsghxkz, ghhsjgwj, qlrsjsyrlxm, fwxz, gyjzmj, gyqk, zyjzmj,
+            ftjzmj, fwcqly, cqlyzmcl, fwqsjxsyt, fct, fjsm, dcyj, dcy, dcrq,
+            shyj, shy, shrq, fwdcb, fcct, bdcdyb, dcdw, geom, valid_flag
+        ) VALUES (
+            #{bsm}, #{ysdm}, #{bdcdyh}, #{zddm}, #{xmbh}, #{dclxtzm}, #{glh}, #{dzjgh}, #{zrzh}, #{lzdm},
+            #{lzzl}, #{xmmc}, #{jzwmc}, #{jgrq}, #{jzwgd}, #{zzdmj}, #{zydmj}, #{ycjzmj}, #{scjzmj}, #{zcs},
+            #{dscs}, #{dxcs}, #{dxsd}, #{ghyt}, #{ytmc}, #{pzyt}, #{sjyt}, #{fwjg}, #{zts}, #{dah}, #{bz},
+            #{zt}, #{djzt}, #{ybdcdyh}, #{jsxmmc}, #{jsgcghxkzh}, #{jsgcghxkz}, #{xcjsghxkzh},
+            #{xcjsghxkz}, #{ghhsjgwj}, #{qlrsjsyrlxm}, #{fwxz}, #{gyjzmj}, #{gyqk}, #{zyjzmj},
+            #{ftjzmj}, #{fwcqly}, #{cqlyzmcl}, #{fwqsjxsyt}, #{fct}, #{fjsm}, #{dcyj}, #{dcy}, #{dcrq},
+            #{shyj}, #{shy}, #{shrq}, #{fwdcb}, #{fcct}, #{bdcdyb}, #{dcdw}, #{geom}, #{validFlag}
+        )
+    </insert>
+
+    <select id="get" resultMap="BaseResultMap">
+        SELECT *, ST_AsEWKT(geom) as geom
+        FROM vector.zrz
+        WHERE bsm = #{bsm}
+    </select>
+
+    <select id="getListByDjzqdm" resultMap="BaseResultMap">
+        SELECT *, ST_AsEWKT(geom) as geom
+        FROM vector.zrz
+        <where>
+            <if test="djzqdm != null and djzqdm != ''">
+                and LEFT(zddm, 12) = #{djzqdm}
+            </if>
+        </where>
+    </select>
+
+    <select id="getList" resultMap="BaseResultMap">
+        SELECT *, ST_AsEWKT(geom) as geom
+        FROM vector.zrz
+    </select>
+
+    <update id="update" parameterType="com.siwei.apply.domain.cadastre.Zrz">
+        UPDATE vector.zrz
+        <set>
+            <if test="ysdm != null">ysdm = #{ysdm},</if>
+            <if test="bdcdyh != null">bdcdyh = #{bdcdyh},</if>
+            <if test="zddm != null">zddm = #{zddm},</if>
+            <if test="xmbh != null">xmbh = #{xmbh},</if>
+            <if test="dclxtzm != null">dclxtzm = #{dclxtzm},</if>
+            <if test="glh != null">glh = #{glh},</if>
+            <if test="dzjgh != null">dzjgh = #{dzjgh},</if>
+            <if test="zrzh != null">zrzh = #{zrzh},</if>
+            <if test="lzdm != null">lzdm = #{lzdm},</if>
+            <if test="lzzl != null">lzzl = #{lzzl},</if>
+            <if test="xmmc != null">xmmc = #{xmmc},</if>
+            <if test="jzwmc != null">jzwmc = #{jzwmc},</if>
+            <if test="jgrq != null">jgrq = #{jgrq},</if>
+            <if test="jzwgd != null">jzwgd = #{jzwgd},</if>
+            <if test="zzdmj != null">zzdmj = #{zzdmj},</if>
+            <if test="zydmj != null">zydmj = #{zydmj},</if>
+            <if test="ycjzmj != null">ycjzmj = #{ycjzmj},</if>
+            <if test="scjzmj != null">scjzmj = #{scjzmj},</if>
+            <if test="zcs != null">zcs = #{zcs},</if>
+            <if test="dscs != null">dscs = #{dscs},</if>
+            <if test="dxcs != null">dxcs = #{dxcs},</if>
+            <if test="dxsd != null">dxsd = #{dxsd},</if>
+            <if test="ghyt != null">ghyt = #{ghyt},</if>
+            <if test="ytmc != null">ytmc = #{ytmc},</if>
+            <if test="pzyt != null">pzyt = #{pzyt},</if>
+            <if test="sjyt != null">sjyt = #{sjyt},</if>
+            <if test="fwjg != null">fwjg = #{fwjg},</if>
+            <if test="zts != null">zts = #{zts},</if>
+            <if test="dah != null">dah = #{dah},</if>
+            <if test="bz != null">bz = #{bz},</if>
+            <if test="zt != null">zt = #{zt},</if>
+            <if test="djzt != null">djzt = #{djzt},</if>
+            <if test="ybdcdyh != null">ybdcdyh = #{ybdcdyh},</if>
+            <if test="jsxmmc != null">jsxmmc = #{jsxmmc},</if>
+            <if test="jsgcghxkzh != null">jsgcghxkzh = #{jsgcghxkzh},</if>
+            <if test="jsgcghxkz != null">jsgcghxkz = #{jsgcghxkz},</if>
+            <if test="xcjsghxkzh != null">xcjsghxkzh = #{xcjsghxkzh},</if>
+            <if test="xcjsghxkz != null">xcjsghxkz = #{xcjsghxkz},</if>
+            <if test="ghhsjgwj != null">ghhsjgwj = #{ghhsjgwj},</if>
+            <if test="qlrsjsyrlxm != null">qlrsjsyrlxm = #{qlrsjsyrlxm},</if>
+            <if test="fwxz != null">fwxz = #{fwxz},</if>
+            <if test="gyjzmj != null">gyjzmj = #{gyjzmj},</if>
+            <if test="gyqk != null">gyqk = #{gyqk},</if>
+            <if test="zyjzmj != null">zyjzmj = #{zyjzmj},</if>
+            <if test="ftjzmj != null">ftjzmj = #{ftjzmj},</if>
+            <if test="fwcqly != null">fwcqly = #{fwcqly},</if>
+            <if test="cqlyzmcl != null">cqlyzmcl = #{cqlyzmcl},</if>
+            <if test="fwqsjxsyt != null">fwqsjxsyt = #{fwqsjxsyt},</if>
+            <if test="fct != null">fct = #{fct},</if>
+            <if test="fjsm != null">fjsm = #{fjsm},</if>
+            <if test="dcyj != null">dcyj = #{dcyj},</if>
+            <if test="dcy != null">dcy = #{dcy},</if>
+            <if test="dcrq != null">dcrq = #{dcrq},</if>
+            <if test="shyj != null">shyj = #{shyj},</if>
+            <if test="shy != null">shy = #{shy},</if>
+            <if test="shrq != null">shrq = #{shrq},</if>
+            <if test="fwdcb != null">fwdcb = #{fwdcb},</if>
+            <if test="fcct != null">fcct = #{fcct},</if>
+            <if test="bdcdyb != null">bdcdyb = #{bdcdyb},</if>
+            <if test="dcdw != null">dcdw = #{dcdw},</if>
+            <if test="geom != null">geom = #{geom},</if>
+            <if test="validFlag != null">valid_flag = #{validFlag},</if>
+        </set>
+        WHERE bsm = #{bsm}
+    </update>
+
+    <select id="getStatisticsByGhyt" resultType="java.util.Map">
+        SELECT
+            ghyt,
+            ytmc,
+            djzt,
+            COUNT(*) as count,
+            SUM(scjzmj) as total_scjzmj
+        FROM vector.zrz
+        GROUP BY ghyt, ytmc, djzt
+    </select>
+
+    <select id="getZrzqlReportData" resultType="java.util.Map">
+        SELECT
+            LEFT(zddm, 12) as djzqdm,
+            ghyt,
+            ytmc,
+            djzt,
+            SUM(scjzmj) as total_area
+        FROM vector.zrz
+        <where>
+            <if test="ghytCodes != null and ghytCodes.size() > 0">
+                AND ghyt IN
+                <foreach item="code" collection="ghytCodes" open="(" separator="," close=")">
+                    #{code}
+                </foreach>
+            </if>
+        </where>
+        GROUP BY LEFT(zddm, 12), ghyt, ytmc, djzt
+    </select>
+
+    <select id="getDictByType" resultType="java.util.Map">
+        SELECT * FROM "vector"."public_dict"
+        <where>
+            <if test="type != null and type != ''">
+                AND type = #{type}
+            </if>
+            <if test="name != null and name != ''">
+                AND name LIKE CONCAT('%', #{name}, '%')
+            </if>
+        </where>
+    </select>
+
+</mapper>