From 5af8ff1fbdc7183bf611f1971edf1f6e8f68c961 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期二, 11 四月 2023 13:35:47 +0800
Subject: [PATCH] 1

---
 src/main/java/com/terra/coal/mapper/MainMapper.java         |   12 +++++-------
 src/main/java/com/terra/coal/controller/MainController.java |    6 +++---
 src/main/resources/application.yml                          |    2 +-
 3 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/main/java/com/terra/coal/controller/MainController.java b/src/main/java/com/terra/coal/controller/MainController.java
index 87329a1..695eddb 100644
--- a/src/main/java/com/terra/coal/controller/MainController.java
+++ b/src/main/java/com/terra/coal/controller/MainController.java
@@ -76,8 +76,8 @@
 
     @ApiOperation(value = "鏍规嵁鑼冨洿缁熻")
     @ApiImplicitParams({
-            @ApiImplicitParam(name = "z", value = "楂樺害", dataType = "double", paramType = "query", example = "640"),
-            @ApiImplicitParam(name = "deep", value = "娣卞害", dataType = "double", paramType = "query", example = "50"),
+            @ApiImplicitParam(name = "z", value = "楂樺害", dataType = "double", paramType = "query", example = "750"),
+            @ApiImplicitParam(name = "deep", value = "娣卞害", dataType = "double", paramType = "query", example = "150"),
             @ApiImplicitParam(name = "wkt", value = "WKT鏂囨湰", dataType = "String", paramType = "query", example = "POLYGON ((113.5807 45.4897,113.5898 45.4893,113.5857 45.4837,113.5807 45.4897))")
     })
     @GetMapping(value = "/countByRange")
@@ -93,7 +93,7 @@
                 return fail("寮�鎸栨繁搴﹁繃灏�", null);
             }
 
-            List<CountEntity> rs = mainService.countByRange(z, z + deep, wkt);
+            List<CountEntity> rs = mainService.countByRange(z, z - deep, wkt);
 
             return success("鎴愬姛", null == rs ? 0 : rs.size(), rs);
         } catch (Exception ex) {
diff --git a/src/main/java/com/terra/coal/mapper/MainMapper.java b/src/main/java/com/terra/coal/mapper/MainMapper.java
index 68e0ccb..e0f59f9 100644
--- a/src/main/java/com/terra/coal/mapper/MainMapper.java
+++ b/src/main/java/com/terra/coal/mapper/MainMapper.java
@@ -1,13 +1,11 @@
 package com.terra.coal.mapper;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.terra.coal.entity.CountEntity;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.springframework.stereotype.Repository;
 
-import java.math.BigDecimal;
 import java.util.List;
 
 /**
@@ -20,13 +18,13 @@
     /**
      * 鏍规嵁鑼冨洿缁熻
      *
-     * @param top
-     * @param bottom
-     * @param wkt
-     * @return
+     * @param top    椤堕珮
+     * @param bottom 搴曢珮
+     * @param wkt    WKT
+     * @return CountEntity闆嗗悎
      */
     @Select("select ctype, sum(volume) \"volume\", sum(coal_prod) \"coal_prod\", sum(gangue_prod) \"gangue_prod\", 0 \"soil_prod\" from public.coal2000 " +
-            "where (top between #{top} and #{bottom} or bottom between #{top} and #{bottom}) and ST_Intersects(geom, ST_PolygonFromText(#{wkt}, 4490))" +
+            "where (top between #{bottom} and #{top} or bottom between #{bottom} and #{top}) and ST_Intersects(geom, ST_PolygonFromText(#{wkt}, 4490)) " +
             "group by ctype order by ctype")
     public List<CountEntity> countByRange(@Param("top") Double top, @Param("bottom") Double bottom, @Param("wkt") String wkt);
 }
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 8137a60..86fc02b 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -15,7 +15,7 @@
     host: 127.0.0.1
     port: 6369
     password: rediS_5L#F4_Server
-    timeout: 30000  # 杩炴帴瓒呮椂鏃堕暱锛堟绉掞級
+    timeout: 90000  # 杩炴帴瓒呮椂鏃堕暱锛堟绉掞級
     pool:
       max-active: 1000  # 杩炴帴姹犳渶澶ц繛鎺ユ暟锛堜娇鐢ㄨ礋鍊艰〃绀烘病鏈夐檺鍒讹級
       max-wait: -1      # 杩炴帴姹犳渶澶ч樆濉炵瓑寰呮椂闂达紙浣跨敤璐熷�艰〃绀烘病鏈夐檺鍒讹級

--
Gitblit v1.9.3