Selaa lähdekoodia

根据sharding修改代码

lvzhikai 3 vuotta sitten
vanhempi
commit
20622db743

+ 1 - 0
src/main/java/com/chinaitop/depot/intelligent/fumigation/mapper/TFumigationAfterMapper.java

@@ -34,4 +34,5 @@ public interface TFumigationAfterMapper {
34 34
 
35 35
     //获取作业列表
36 36
     List<Map<String,Object>> selectHomeWorkQueryList(Map<String, Object> map);
37
+    List<Map<String,Object>> selectAfterQueryList(Map<String, Object> map);
37 38
 }

+ 3 - 1
src/main/java/com/chinaitop/depot/intelligent/fumigation/mapper/TFumigationAfterMapper.xml

@@ -615,7 +615,9 @@
615 615
       AND plan.house_id = #{houseId,jdbcType=INTEGER}
616 616
     </if>
617 617
     GROUP BY process.id
618
-    UNION ALL
618
+    ORDER BY createTime DESC
619
+  </select>
620
+  <select id="selectAfterQueryList" parameterType="java.util.Map" resultType="java.util.HashMap">
619 621
     SELECT
620 622
     2 AS planType,
621 623
     af.id,

+ 1 - 0
src/main/java/com/chinaitop/depot/intelligent/fumigation/mapper/TFumigationPlanMapper.java

@@ -32,6 +32,7 @@ public interface TFumigationPlanMapper {
32 32
 
33 33
     //获取方案列表
34 34
     List<Map<String,Object>> selectPlanQueryList(Map<String, Object> map);
35
+    List<Map<String,Object>> selectPlanQuerySYList(Map<String, Object> map);
35 36
 
36 37
     //作业全部信息--省级平台用
37 38
     List<Map<String,Object>> getAllQueryList(Map<String, Object> map);

+ 4 - 1
src/main/java/com/chinaitop/depot/intelligent/fumigation/mapper/TFumigationPlanMapper.xml

@@ -699,7 +699,10 @@
699 699
     <if test="houseId != null" >
700 700
       AND plan.house_id = #{houseId,jdbcType=INTEGER}
701 701
     </if>
702
-    UNION ALL
702
+  </select>
703
+
704
+
705
+  <select id="selectPlanQuerySYList" parameterType="java.util.Map" resultType="java.util.HashMap">
703 706
     SELECT
704 707
     2 AS planType,
705 708
     pesticide.id,

+ 6 - 1
src/main/java/com/chinaitop/depot/intelligent/fumigation/service/impl/FumigationAfterServiceImpl.java

@@ -7,8 +7,11 @@ import com.chinaitop.depot.intelligent.fumigation.service.FumigationAfterService
7 7
 import org.springframework.stereotype.Service;
8 8
 
9 9
 import javax.annotation.Resource;
10
+import java.util.Collection;
10 11
 import java.util.List;
11 12
 import java.util.Map;
13
+import java.util.stream.Collectors;
14
+import java.util.stream.Stream;
12 15
 
13 16
 /**
14 17
  * @author lvzhikai
@@ -53,6 +56,8 @@ public class FumigationAfterServiceImpl implements FumigationAfterService {
53 56
      */
54 57
     @Override
55 58
     public List<Map<String,Object>> selectHomeWorkQueryList(Map<String, Object> map) {
56
-        return tFumigationAfterMapper.selectHomeWorkQueryList(map);
59
+        List<Map<String,Object>> processData = tFumigationAfterMapper.selectHomeWorkQueryList(map);
60
+        List<Map<String,Object>> afterData = tFumigationAfterMapper.selectAfterQueryList(map);
61
+        return Stream.of(processData,afterData).flatMap(Collection::stream).distinct().collect(Collectors.toList());
57 62
     }
58 63
 }

+ 6 - 1
src/main/java/com/chinaitop/depot/intelligent/fumigation/service/impl/FumigationPlanServiceImpl.java

@@ -14,9 +14,12 @@ import org.springframework.stereotype.Service;
14 14
 import org.springframework.transaction.annotation.Transactional;
15 15
 
16 16
 import javax.annotation.Resource;
17
+import java.util.Collection;
17 18
 import java.util.Date;
18 19
 import java.util.List;
19 20
 import java.util.Map;
21
+import java.util.stream.Collectors;
22
+import java.util.stream.Stream;
20 23
 
21 24
 /**
22 25
  * @author lvzhikai
@@ -76,7 +79,9 @@ public class FumigationPlanServiceImpl implements FumigationPlanService {
76 79
      */
77 80
     @Override
78 81
     public List<Map<String,Object>> selectPlanQueryList(Map<String, Object> map) {
79
-        return tFumigationPlanMapper.selectPlanQueryList(map);
82
+        List<Map<String,Object>> planData = tFumigationPlanMapper.selectPlanQueryList(map);
83
+        List<Map<String,Object>> pesticideData = tFumigationPlanMapper.selectPlanQuerySYList(map);
84
+        return Stream.of(planData,pesticideData).flatMap(Collection::stream).distinct().collect(Collectors.toList());
80 85
     }
81 86
 
82 87
     /**