Browse Source

调整首页种植top统计接口

liuyaowen 10 months atrás
parent
commit
4e491add4a

+ 2 - 1
src/main/java/com/yunfeiyun/agmp/fms/controller/FmsConsoleController.java

@@ -142,7 +142,8 @@ public class FmsConsoleController extends BaseController {
             blockIds = null;
         }
         startPage();
-        List<FmsCropPlanAreaResVo> fmsCropPlanAreaResVos = fmsPlanService.selectCropPlanAreaTop(blockIds,SecurityUtils.getTid());
+        String planStatus = CommonEnums.PLAN_STATUS_START.getCode() + "," + CommonEnums.PLAN_STATUS_NOT_START.getCode();
+        List<FmsCropPlanAreaResVo> fmsCropPlanAreaResVos = fmsPlanService.selectCropPlanAreaTop(blockIds,SecurityUtils.getTid(),planStatus);
         List<String> cropIds = fmsCropPlanAreaResVos.stream().map(FmsCropPlanAreaResVo::getCropId).collect(Collectors.toList());
         List<FmsCrop> fmsCropList = fmsCropService.selectFmsCropListByCropIds(cropIds,SecurityUtils.getTid());
         Map<String,FmsCrop> cropMap = fmsCropList.stream().collect(Collectors.toMap(FmsCrop::getCropId,item->item));

+ 1 - 1
src/main/java/com/yunfeiyun/agmp/fms/mapper/FmsPlanMapper.java

@@ -114,7 +114,7 @@ public interface FmsPlanMapper
 
     List<String> selectBlockManagerByPlanId(@Param("planId") String planId, @Param("tid") String tid);
 
-    List<FmsCropPlanAreaResVo> selectCropPlanAreaTop(@Param("blockIds") List<String> blockIds, @Param("tid") String tid);
+    List<FmsCropPlanAreaResVo> selectCropPlanAreaTop(@Param("blockIds") List<String> blockIds, @Param("tid") String tid, @Param("planStatus")String planStatus);
 
     List<FmsPlanCropResVo> selectFmsPlanCropResVoList(FmsPlanReqVo fmsPlanQuery);
 }

+ 1 - 1
src/main/java/com/yunfeiyun/agmp/fms/service/IFmsPlanService.java

@@ -110,7 +110,7 @@ public interface IFmsPlanService
      */
     public List<FmsPlanByWarnSchedulerDto> selectPlanListByWarnScheduler(String planEnddate, String tid);
 
-    List<FmsCropPlanAreaResVo> selectCropPlanAreaTop(List<String> blockIds, String tid);
+    List<FmsCropPlanAreaResVo> selectCropPlanAreaTop(List<String> blockIds, String tid, String planStatus);
 
     List<FmsPlanCropResVo> selectFmsCropPlanResVoList(FmsPlanReqVo fmsPlanQuery);
 }

+ 2 - 2
src/main/java/com/yunfeiyun/agmp/fms/service/impl/FmsPlanServiceImpl.java

@@ -428,8 +428,8 @@ public class FmsPlanServiceImpl implements IFmsPlanService {
     }
 
     @Override
-    public List<FmsCropPlanAreaResVo> selectCropPlanAreaTop(List<String> blockIds,String tid) {
-        return fmsPlanMapper.selectCropPlanAreaTop(blockIds,tid);
+    public List<FmsCropPlanAreaResVo> selectCropPlanAreaTop(List<String> blockIds,String tid,String planStatus) {
+        return fmsPlanMapper.selectCropPlanAreaTop(blockIds,tid,planStatus);
     }
 
     @Override

+ 9 - 1
src/main/resources/mapper/FmsPlanMapper.xml

@@ -506,6 +506,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     #{item}
                 </foreach>
             </if>
+            <if test="planStatus != null  and planStatus != ''">
+                and planStatus in
+                <foreach collection="planStatus.split(',')" item="item" open="(" separator="," close=")">
+                    <if test="item != null  and item != ''">
+                        #{item}
+                    </if>
+                </foreach>
+            </if>
         </where>
         GROUP BY cropId
         ORDER BY sum( planArea ) DESC
@@ -519,7 +527,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         c.cropName,
         c.cropType,
         c.cropMaintype,
-        c.tid
+        c.tid,
         from
         FmsPlan p
         LEFT JOIN