1
0
chenendian 1 неделя назад
Родитель
Сommit
329ab85a04

+ 1 - 1
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/cadastre/StorageController.java

@@ -327,7 +327,7 @@ public class StorageController extends BaseController {
      * @return
      */
     @GetMapping("/trendStatistics/getData2/{year}")
-    public R<List<TrendUseStatisticsData>> getData2(String year) {
+    public R<List<TrendUseStatisticsData>> getData2(@PathVariable String year) {
         try {
             //todo  这里参考 R<List<TrendStatisticsData>> getData1() 方法实现,调用service层方法获取数据并封装到res对象中
             //   FROM vector.gj_shiji_shouchu  表字段:  年份(scnd - 类似 2020) 用途(ytdyt)

+ 3 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/mapper/GjShijiShouchuMapper.java

@@ -1,6 +1,7 @@
 package com.siwei.apply.mapper;
 
 import com.siwei.apply.domain.GjShijiShouchu;
+import com.siwei.apply.domain.res.TdgyStatisticsRes;
 import com.siwei.apply.domain.vo.GjShijiShouchuFilterVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -28,4 +29,6 @@ public interface GjShijiShouchuMapper {
     void batchDelete(@Param("gids") List<Integer> gids);
 
     List<GjShijiShouchu> getByGeomIntersects(@Param("ewkt") String ewkt);
+
+    List<TdgyStatisticsRes> gjShijiShouchuListByYear(@Param("year") String year, @Param("landTypeCode") String landTypeCode, @Param("startTime") String startTime, @Param("endTime") String endTime);
 }

+ 3 - 12
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/StorageServiceImpl.java

@@ -98,13 +98,9 @@ public class StorageServiceImpl {
         }else if(supplyType == 2){
             //这里合并两部分数据
             List<TdgyStatisticsRes> completeList = new ArrayList<>();
-            List<TdgyStatisticsRes> completeBusinessStatusList = dgyMapper.getListByYear(null, null, null, null);
-            List<TdgyStatisticsRes> completeSjgdList = dgyMapper.getSjgdListByYear(null, null, null, null);
-            if(CollectionUtils.isNotEmpty(completeBusinessStatusList)){
-                completeList.addAll(completeBusinessStatusList);
-            }
-            if(CollectionUtils.isNotEmpty(completeSjgdList)){
-                completeList.addAll(completeSjgdList);
+            List<TdgyStatisticsRes> sjgdList = gjShijiShouchuMapper.gjShijiShouchuListByYear(null, null, null, null);
+            if (CollectionUtils.isNotEmpty(sjgdList)) {
+                completeList.addAll(sjgdList);
             }
 
             AtomicInteger i= new AtomicInteger();
@@ -113,11 +109,6 @@ public class StorageServiceImpl {
                 vo.setProjectPropertyId(item.getProjectId());
                 vo.setProjectName(item.getXmmc());
                 vo.setCompanyName(item.getCompany());
-                if(i.incrementAndGet()/5 == 0){
-                    vo.setSupplyMethod("收购");
-                }else {
-                    vo.setSupplyMethod("征地");
-                }
                 vo.setSupplyType(supplyType.toString());
                 vo.setDateType(supplyType.toString());
                 if(StringUtils.isBlank(item.getProjectId())){

+ 28 - 0
siwei-modules/siwei-apply/src/main/resources/mapper/GjShijiShouchuMapper.xml

@@ -153,4 +153,32 @@
         WHERE public.ST_Intersects(geom, public.ST_GeomFromEWKT(#{ewkt}))
     </select>
 
+    <select id="gjShijiShouchuListByYear" resultType="com.siwei.apply.domain.res.TdgyStatisticsRes" parameterType="String">
+        SELECT
+            '' AS projectId,
+            "项目名" AS xmmc,
+            yqsdw AS company,
+            CAST(gid AS VARCHAR) AS nodeId,
+            ytdyt AS tdyt,
+            scfs AS gyfs,
+            scsj AS gysj,
+            "面积_亩" AS mjMu,
+            bz,
+            ST_AsEWKT(geom) AS geom
+        FROM vector.gj_shiji_shouchu
+        WHERE 1=1
+        <if test="year != null and year != '' and year != '0'">
+            AND CAST(scnd AS VARCHAR) = #{year}
+        </if>
+        <if test="landTypeCode != null">
+            AND ytdyt LIKE CONCAT('%', #{landTypeCode}, '%')
+        </if>
+        <if test="startTime != null and startTime != ''">
+            AND scsj &gt;= #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND scsj &lt;= #{endTime}
+        </if>
+    </select>
+
 </mapper>