Bladeren bron

增加热力图,修改部分bug

Peach 2 jaren geleden
bovenliggende
commit
04c86708d7

+ 5 - 0
guanshi-system/src/main/java/com/ruoyi/system/controller/RestZbGcController.java

@@ -42,4 +42,9 @@ public class RestZbGcController {
     public AjaxResult getCountByDepType(){
         return AjaxResult.success(zbGcService.getCountByDepType());
     }
+
+    @GetMapping("/getSumPriceByAddr")
+    public  AjaxResult getSumPriceByAddr(){
+        return AjaxResult.success(zbGcService.selectSumPriceByAddr());
+    }
 }

+ 4 - 0
guanshi-system/src/main/java/com/ruoyi/system/mapper/ZbGcMapper.java

@@ -5,6 +5,7 @@ import java.util.List;
 import java.util.Map;
 
 import com.ruoyi.system.domain.ZbGc;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 招标网工程类爬虫Mapper接口
@@ -76,6 +77,9 @@ public interface ZbGcMapper
 
     public List<Map<String,Integer>> selectAllZBCountByDepDateTwo();
 
+    public List<String> selectAddrBySearchKey();
+
+    public Map<String,BigDecimal> selectSumPriceByAddr(@Param("key")String key);
 
     /**
      * 按月份查询招标网工程类爬虫中标金额总数

+ 5 - 0
guanshi-system/src/main/java/com/ruoyi/system/service/IZbGcService.java

@@ -5,6 +5,7 @@ import java.util.List;
 import java.util.Map;
 
 import com.ruoyi.system.domain.ZbGc;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 招标网工程类爬虫Service接口
@@ -33,6 +34,10 @@ public interface IZbGcService
     public  Map<String,List<Map<String, Integer>>> getTypeByMon();
 
 
+
+
+    public List<Map<String,BigDecimal>> selectSumPriceByAddr();
+
     /**
      * 查询招标网工程类爬虫
      * 

+ 12 - 0
guanshi-system/src/main/java/com/ruoyi/system/service/impl/ZbGcServiceImpl.java

@@ -75,6 +75,18 @@ public class ZbGcServiceImpl implements IZbGcService
     }
 
 
+
+    @Override
+    public List<Map<String, BigDecimal>> selectSumPriceByAddr() {
+        List<String> list=zbGcMapper.selectAddrBySearchKey();
+        List<Map<String, BigDecimal>> mapList=new ArrayList<>();
+        for (String addr:list){
+            mapList.add(zbGcMapper.selectSumPriceByAddr(addr));
+        }
+        return mapList;
+    }
+
+
     /**
      * 查询招标网工程类爬虫
      * 

+ 7 - 0
guanshi-system/src/main/resources/mapper/system/ZbGcMapper.xml

@@ -84,6 +84,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectAllZBCountByDep" resultType="map">
         SELECT dep_type,count(id) as 'count' FROM zb_gc WHERE regex=1 and type='招标公告'  GROUP BY dep_type
     </select>
+    
+    <select id="selectAddrBySearchKey" resultType="String">
+        SELECT search_key FROM zb_gc GROUP BY search_key
+    </select>
+    <select id="selectSumPriceByAddr" resultType="map">
+        select  COALESCE(sum(price),0) as 'value',REPLACE(search_key,' 工程','') as 'name'  from zb_gc WHERE regex =1 and search_key=#{key}
+    </select>
 
     <select id="selectAllZBCountByDepDateOne" resultType="map">
         select DATE_FORMAT(time,'%Y-%m') as 'mon',count(id) as 'count' from zb_gc WHERE regex =1 and type='招标公告' and time>'2021-06' and dep_type=1   group by DATE_FORMAT(time,'%Y-%m')