فهرست منبع

修改防疫检测bug

523096025 2 سال پیش
والد
کامیت
01de76d65f

+ 1 - 1
huimv-cattle/src/main/java/com/huimv/cattle/controller/PreventDetectionController.java

@@ -84,7 +84,7 @@ public class PreventDetectionController {
         //镇汇总
         //镇汇总
         List<PreventDetection> list = new ArrayList<>();
         List<PreventDetection> list = new ArrayList<>();
         if (dataSource.getDsStatus() == 1 && dataSource.getViewType() ==2) {
         if (dataSource.getDsStatus() == 1 && dataSource.getViewType() ==2) {
-            list = preventDetectionService.getPreventDetectionScreen();
+            list = preventDetectionService.getPreventDetectionScreen(farmCode);
         }else {
         }else {
             list = preventDetectionService.list(new QueryWrapper<PreventDetection>().eq("farm_code",farmCode).orderByDesc("year").orderByDesc("month"));
             list = preventDetectionService.list(new QueryWrapper<PreventDetection>().eq("farm_code",farmCode).orderByDesc("year").orderByDesc("month"));
             if (ObjectUtil.isEmpty(list)){
             if (ObjectUtil.isEmpty(list)){

+ 2 - 1
huimv-cattle/src/main/java/com/huimv/cattle/mapper/PreventDetectionMapper.java

@@ -2,6 +2,7 @@ package com.huimv.cattle.mapper;
 
 
 import com.huimv.cattle.pojo.PreventDetection;
 import com.huimv.cattle.pojo.PreventDetection;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -15,6 +16,6 @@ import java.util.List;
  */
  */
 public interface PreventDetectionMapper extends BaseMapper<PreventDetection> {
 public interface PreventDetectionMapper extends BaseMapper<PreventDetection> {
 
 
-    List<PreventDetection> getPreventDetectionScreen();
+    List<PreventDetection> getPreventDetectionScreen(@Param("farmCode")String farmCode);
 
 
 }
 }

+ 1 - 1
huimv-cattle/src/main/java/com/huimv/cattle/mapper/xml/PreventDetectionMapper.xml

@@ -18,7 +18,7 @@
     </sql>
     </sql>
     <select id="getPreventDetectionScreen" resultType="com.huimv.cattle.pojo.PreventDetection">
     <select id="getPreventDetectionScreen" resultType="com.huimv.cattle.pojo.PreventDetection">
         SELECT SUM(detection_num) detectionNum ,SUM(acceptance_num) acceptanceNum,`year`,month_name ,`month` , farm_code FROM `prevent_detection`
         SELECT SUM(detection_num) detectionNum ,SUM(acceptance_num) acceptanceNum,`year`,month_name ,`month` , farm_code FROM `prevent_detection`
-        WHERE farm_code != 0 GROUP BY `year` ,`month` order  by `year` DESC,`month` DESC
+        WHERE farm_code == #{farmCode} GROUP BY `year` ,`month` order  by `year` DESC,`month` DESC
     </select>
     </select>
 
 
 </mapper>
 </mapper>

+ 1 - 1
huimv-cattle/src/main/java/com/huimv/cattle/service/PreventDetectionService.java

@@ -15,5 +15,5 @@ import java.util.List;
  */
  */
 public interface PreventDetectionService extends IService<PreventDetection> {
 public interface PreventDetectionService extends IService<PreventDetection> {
 
 
-    List<PreventDetection> getPreventDetectionScreen();
+    List<PreventDetection> getPreventDetectionScreen(String farmCode);
 }
 }

+ 6 - 2
huimv-cattle/src/main/java/com/huimv/cattle/service/impl/PreventDetectionServiceImpl.java

@@ -1,5 +1,6 @@
 package com.huimv.cattle.service.impl;
 package com.huimv.cattle.service.impl;
 
 
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.huimv.cattle.pojo.PreventDetection;
 import com.huimv.cattle.pojo.PreventDetection;
 import com.huimv.cattle.mapper.PreventDetectionMapper;
 import com.huimv.cattle.mapper.PreventDetectionMapper;
 import com.huimv.cattle.service.PreventDetectionService;
 import com.huimv.cattle.service.PreventDetectionService;
@@ -24,7 +25,10 @@ public class PreventDetectionServiceImpl extends ServiceImpl<PreventDetectionMap
     private PreventDetectionMapper preventDetectionMapper;
     private PreventDetectionMapper preventDetectionMapper;
 
 
     @Override
     @Override
-    public List<PreventDetection> getPreventDetectionScreen() {
-        return preventDetectionMapper.getPreventDetectionScreen();
+    public List<PreventDetection> getPreventDetectionScreen(String farmCode) {
+        if (StringUtils.isBlank(farmCode)){
+            farmCode = "0";
+        }
+        return preventDetectionMapper.getPreventDetectionScreen(farmCode);
     }
     }
 }
 }