From 77df1b4d3b3735ce2a65f629babbd1ed0830538f Mon Sep 17 00:00:00 2001 From: wuleyan <1175424873@qq.com> Date: Mon, 8 Dec 2025 16:44:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E7=B1=BB=E8=A1=A8=E4=B8=89=E7=B1=BB?= =?UTF-8?q?=E8=A1=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/StatisticsController.java | 302 +++++++++++++++++- .../MapLyStatistic/Dto/T1sub2DTO.java | 1 - .../MapLyStatistic/Mapper/AttrMapper.java | 43 ++- .../MapLyStatistic/Service/AttrService.java | 164 +++++++++- .../resources/mapper/MapLyStatistic/Attr.xml | 120 +++++++ 5 files changed, 621 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/whu/edu/LyStatistic/MapLyStatistic/Controller/StatisticsController.java b/src/main/java/com/whu/edu/LyStatistic/MapLyStatistic/Controller/StatisticsController.java index c7b2a87..eec181e 100644 --- a/src/main/java/com/whu/edu/LyStatistic/MapLyStatistic/Controller/StatisticsController.java +++ b/src/main/java/com/whu/edu/LyStatistic/MapLyStatistic/Controller/StatisticsController.java @@ -56,7 +56,7 @@ public class StatisticsController { List data = attrService.getT1sub1(database, id); return ApiResponse.success(data); } catch (Exception e) { - return ApiResponse.error("查询小班属性失败:" + e.getMessage()); + return ApiResponse.error("查询样地属性失败:" + e.getMessage()); } } @@ -71,11 +71,309 @@ public class StatisticsController { List data = attrService.getT1sub2(database, id); return ApiResponse.success(data); } catch (Exception e) { - return ApiResponse.error("查询小班属性失败:" + e.getMessage()); + return ApiResponse.error("查询样木属性失败:" + e.getMessage()); } } + /** + * t1sub4 幼树样方 + * 入参:database_name+ID + * 出参:t1sub4内所有值 + */ + @GetMapping("/t1sub4") + public ApiResponse> getT1sub4(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub4(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询幼树样方失败:" + e.getMessage()); + } + } + /** + * t1sub6 下木样方 + * 入参:database_name+ID + * 出参:t1sub6内所有值 + */ + @GetMapping("/t1sub6") + public ApiResponse> getT1sub6(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub6(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询下木样方失败:" + e.getMessage()); + } + } + + /** + * t1sub8 未成林样方 + * 入参:database_name+ID + * 出参:t1sub8内所有值 + */ + @GetMapping("/t1sub8") + public ApiResponse> getT1sub8(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub8(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询未成林样方失败:" + e.getMessage()); + } + } + + /** + * t1sub12 经济林样方 + * 入参:database_name+ID + * 出参:t1sub12内所有值 + */ + @GetMapping("/t1sub12") + public ApiResponse> getT1sub12(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub12(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询经济林样方失败:" + e.getMessage()); + } + } + + /** + * t1sub201 灌木样方 + * 入参:database_name+ID + * 出参:t1sub201内所有值 + */ + @GetMapping("/t1sub201") + public ApiResponse> getT1sub201(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub201(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询灌木样方失败:" + e.getMessage()); + } + } + + /** + * t1sub202 藤本样方 + * 入参:database_name+ID + * 出参:t1sub202内所有值 + */ + @GetMapping("/t1sub202") + public ApiResponse> getT1sub202(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub202(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询藤本样方失败:" + e.getMessage()); + } + } + + /** + * t1sub203 草本样方 + * 入参:database_name+ID + * 出参:t1sub203内所有值 + */ + @GetMapping("/t1sub203") + public ApiResponse> getT1sub203(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub203(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询草本样方失败:" + e.getMessage()); + } + } + + /** + * t1sub204 地被样方 + * 入参:database_name+ID + * 出参:t1sub204内所有值 + */ + @GetMapping("/t1sub204") + public ApiResponse> getT1sub204(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub204(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询地被样方失败:" + e.getMessage()); + } + } + + /** + * t1sub25 目测项目表 + * 入参:database_name+ID + * 出参:t1sub25内所有值 + */ + @GetMapping("/t1sub25") + public ApiResponse> getT1sub25(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub25(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询目测项目表失败:" + e.getMessage()); + } + } + + /** + * t3sub 散生单木表 + * 入参:database_name+ID + * 出参:t3sub内所有值 + */ + @GetMapping("/t3sub") + public ApiResponse> getT3sub(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT3sub(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询散生单木表失败:" + e.getMessage()); + } + } + + /** + * t4sub 四旁树单木表 + * 入参:database_name+ID + * 出参:t4sub内所有值 + */ + @GetMapping("/t4sub") + public ApiResponse> getT4sub(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT4sub(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询四旁树单木表失败:" + e.getMessage()); + } + } + + /** + * t1sub5 幼树表 + * 入参:database_name+ID + * 出参:t1sub5内所有值 + */ + @GetMapping("/t1sub5") + public ApiResponse> getT1sub5(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub5(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询幼树表失败:" + e.getMessage()); + } + } + + /** + * t1sub7 下木表 + * 入参:database_name+ID + * 出参:t1sub7内所有值 + */ + @GetMapping("/t1sub7") + public ApiResponse> getT1sub7(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub7(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询下木表失败:" + e.getMessage()); + } + } + + /** + * t1sub9 未成林表 + * 入参:database_name+ID + * 出参:t1sub9内所有值 + */ + @GetMapping("/t1sub9") + public ApiResponse> getT1sub9(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub9(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询未成林表失败:" + e.getMessage()); + } + } + + /** + * t1sub13 经济树种表 + * 入参:database_name+ID + * 出参:t1sub13内所有值 + */ + @GetMapping("/t1sub13") + public ApiResponse> getT1sub13(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub13(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询经济树种表失败:" + e.getMessage()); + } + } + + /** + * t1sub21 灌木调查表 + * 入参:database_name+ID + * 出参:t1sub21内所有值 + */ + @GetMapping("/t1sub21") + public ApiResponse> getT1sub21(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub21(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询灌木调查表失败:" + e.getMessage()); + } + } + + /** + * t1sub22 藤本调查表 + * 入参:database_name+ID + * 出参:t1sub22内所有值 + */ + @GetMapping("/t1sub22") + public ApiResponse> getT1sub22(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub22(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询藤本调查表失败:" + e.getMessage()); + } + } + + /** + * t1sub23 草本调查表 + * 入参:database_name+ID + * 出参:t1sub23内所有值 + */ + @GetMapping("/t1sub23") + public ApiResponse> getT1sub23(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub23(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询草本调查表失败:" + e.getMessage()); + } + } + + /** + * t1sub24 地被调查表 + * 入参:database_name+ID + * 出参:t1sub24内所有值 + */ + @GetMapping("/t1sub24") + public ApiResponse> getT1sub24(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub24(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询地被调查表失败:" + e.getMessage()); + } + } + + /** + * t1sub251 目测单项表 + * 入参:database_name+ID + * 出参:t1sub251内所有值 + */ + @GetMapping("/t1sub251") + public ApiResponse> getT1sub251(@RequestParam String database, @RequestParam String id) { + try { + List data = attrService.getT1sub251(database, id); + return ApiResponse.success(data); + } catch (Exception e) { + return ApiResponse.error("查询目测单项表失败:" + e.getMessage()); + } + } /** * 按日期返回已完成的小班数和样地数 diff --git a/src/main/java/com/whu/edu/LyStatistic/MapLyStatistic/Dto/T1sub2DTO.java b/src/main/java/com/whu/edu/LyStatistic/MapLyStatistic/Dto/T1sub2DTO.java index 260e354..3befe3c 100644 --- a/src/main/java/com/whu/edu/LyStatistic/MapLyStatistic/Dto/T1sub2DTO.java +++ b/src/main/java/com/whu/edu/LyStatistic/MapLyStatistic/Dto/T1sub2DTO.java @@ -4,7 +4,6 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; -import java.util.List; @Data @NoArgsConstructor diff --git a/src/main/java/com/whu/edu/LyStatistic/MapLyStatistic/Mapper/AttrMapper.java b/src/main/java/com/whu/edu/LyStatistic/MapLyStatistic/Mapper/AttrMapper.java index f4647ef..e79b63c 100644 --- a/src/main/java/com/whu/edu/LyStatistic/MapLyStatistic/Mapper/AttrMapper.java +++ b/src/main/java/com/whu/edu/LyStatistic/MapLyStatistic/Mapper/AttrMapper.java @@ -1,7 +1,5 @@ package com.whu.edu.LyStatistic.MapLyStatistic.Mapper; -import com.whu.edu.LyStatistic.MapLyStatistic.Dto.PlotAttrDTO; -import com.whu.edu.LyStatistic.MapLyStatistic.Dto.T1sub1DTO; -import com.whu.edu.LyStatistic.MapLyStatistic.Dto.T1sub2DTO; +import com.whu.edu.LyStatistic.MapLyStatistic.Dto.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.springframework.web.bind.annotation.RequestParam; @@ -17,4 +15,43 @@ public interface AttrMapper { List findMediaPaths(@Param("id") String id, @Param("databaseName") String databaseName, @Param("table") String table); + List findT1sub4(@Param("database") String database, @Param("id") String id); + + List findT1sub6(@Param("database") String database, @Param("id") String id); + + List findT1sub8(@Param("database") String database, @Param("id") String id); + + List findT1sub12(@Param("database") String database, @Param("id") String id); + + List findT1sub201(@Param("database") String database, @Param("id") String id); + + List findT1sub202(@Param("database") String database, @Param("id") String id); + + List findT1sub203(@Param("database") String database, @Param("id") String id); + + List findT1sub204(@Param("database") String database, @Param("id") String id); + + List findT1sub25(@Param("database") String database, @Param("id") String id); + + List findT3sub(@Param("database") String database, @Param("id") String id); + + List findT4sub(@Param("database") String database, @Param("id") String id); + + List findT1sub5(@Param("database") String database, @Param("id") String id); + + List findT1sub7(@Param("database") String database, @Param("id") String id); + + List findT1sub9(@Param("database") String database, @Param("id") String id); + + List findT1sub13(@Param("database") String database, @Param("id") String id); + + List findT1sub21(@Param("database") String database, @Param("id") String id); + + List findT1sub22(@Param("database") String database, @Param("id") String id); + + List findT1sub23(@Param("database") String database, @Param("id") String id); + + List findT1sub24(@Param("database") String database, @Param("id") String id); + + List findT1sub251(@Param("database") String database, @Param("id") String id); } diff --git a/src/main/java/com/whu/edu/LyStatistic/MapLyStatistic/Service/AttrService.java b/src/main/java/com/whu/edu/LyStatistic/MapLyStatistic/Service/AttrService.java index f08edb6..0a13f6a 100644 --- a/src/main/java/com/whu/edu/LyStatistic/MapLyStatistic/Service/AttrService.java +++ b/src/main/java/com/whu/edu/LyStatistic/MapLyStatistic/Service/AttrService.java @@ -1,8 +1,6 @@ package com.whu.edu.LyStatistic.MapLyStatistic.Service; -import com.whu.edu.LyStatistic.MapLyStatistic.Dto.PlotAttrDTO; -import com.whu.edu.LyStatistic.MapLyStatistic.Dto.T1sub1DTO; -import com.whu.edu.LyStatistic.MapLyStatistic.Dto.T1sub2DTO; +import com.whu.edu.LyStatistic.MapLyStatistic.Dto.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.whu.edu.LyStatistic.MapLyStatistic.Mapper.AttrMapper; @@ -65,4 +63,164 @@ public class AttrService { } return schema; } + + public List getT1sub4(String database, String id){ + List schema = attrMapper.findT1sub4(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的幼树样方所在任务 schema"); + } + return schema; + } + + public List getT1sub6(String database, String id){ + List schema = attrMapper.findT1sub6(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的下木样方所在任务 schema"); + } + return schema; + } + + public List getT1sub8(String database, String id){ + List schema = attrMapper.findT1sub8(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的未成林样方所在任务 schema"); + } + return schema; + } + + public List getT1sub12(String database, String id){ + List schema = attrMapper.findT1sub12(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的经济林样方所在任务 schema"); + } + return schema; + } + + public List getT1sub201(String database, String id){ + List schema = attrMapper.findT1sub201(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的灌木样方所在任务 schema"); + } + return schema; + } + + public List getT1sub202(String database, String id){ + List schema = attrMapper.findT1sub202(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的藤本样方所在任务 schema"); + } + return schema; + } + + public List getT1sub203(String database, String id){ + List schema = attrMapper.findT1sub203(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的草本样方所在任务 schema"); + } + return schema; + } + + public List getT1sub204(String database, String id){ + List schema = attrMapper.findT1sub204(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的地被样方所在任务 schema"); + } + return schema; + } + + public List getT1sub25(String database, String id){ + List schema = attrMapper.findT1sub25(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的目测项目表所在任务 schema"); + } + return schema; + } + + public List getT3sub(String database, String id){ + List schema = attrMapper.findT3sub(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的散生单木表所在任务 schema"); + } + return schema; + } + + public List getT4sub(String database, String id){ + List schema = attrMapper.findT4sub(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的四旁树单木表所在任务 schema"); + } + return schema; + } + + public List getT1sub5(String database, String id){ + List schema = attrMapper.findT1sub5(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的幼树表所在任务 schema"); + } + return schema; + } + + public List getT1sub7(String database, String id){ + List schema = attrMapper.findT1sub7(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的下木表所在任务 schema"); + } + return schema; + } + + public List getT1sub9(String database, String id){ + List schema = attrMapper.findT1sub9(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的未成林表所在任务 schema"); + } + return schema; + } + + public List getT1sub13(String database, String id){ + List schema = attrMapper.findT1sub13(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的经济树种表所在任务 schema"); + } + return schema; + } + + public List getT1sub21(String database, String id){ + List schema = attrMapper.findT1sub21(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的灌木调查表所在任务 schema"); + } + return schema; + } + + public List getT1sub22(String database, String id){ + List schema = attrMapper.findT1sub22(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的藤本调查表所在任务 schema"); + } + return schema; + } + + public List getT1sub23(String database, String id){ + List schema = attrMapper.findT1sub23(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的草本调查表所在任务 schema"); + } + return schema; + } + + public List getT1sub24(String database, String id){ + List schema = attrMapper.findT1sub24(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的地被调查表所在任务 schema"); + } + return schema; + } + + public List getT1sub251(String database, String id){ + List schema = attrMapper.findT1sub251(database, id); + if (schema == null) { + throw new RuntimeException("未找到对应的目测单项表所在任务 schema"); + } + return schema; + } } diff --git a/src/main/resources/mapper/MapLyStatistic/Attr.xml b/src/main/resources/mapper/MapLyStatistic/Attr.xml index 388dc4f..a4d7780 100644 --- a/src/main/resources/mapper/MapLyStatistic/Attr.xml +++ b/src/main/resources/mapper/MapLyStatistic/Attr.xml @@ -31,4 +31,124 @@ WHERE database_name = #{database} AND "parentID" = #{id} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +