Просмотр исходного кода

Merge branch 'dbdx' of http://192.168.1.43:3000/v2/zd-parents into dbdx

chaiyunlong лет назад: 2
Родитель
Сommit
fa69a90c25

+ 10 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/controller/bigview/BigViewController.java

@@ -99,6 +99,9 @@ public class BigViewController extends BaseController {
     @Autowired
     @Autowired
     private WarningNoticeLogService warningNoticeLogService;
     private WarningNoticeLogService warningNoticeLogService;
 
 
+    @Autowired
+    private ILabHazardSubjectRelationService hazardSubjectRelationService;
+
     /**
     /**
      * echarts-条形图:设备概览
      * echarts-条形图:设备概览
      *
      *
@@ -145,6 +148,13 @@ public class BigViewController extends BaseController {
     @ApiOperation("查询重点实验室")
     @ApiOperation("查询重点实验室")
     @GetMapping("/my/sub")
     @GetMapping("/my/sub")
     public  List<LabSubjectControllerVO> mySubview(com.zd.laboratory.domain.LabSubject labSubject) {
     public  List<LabSubjectControllerVO> mySubview(com.zd.laboratory.domain.LabSubject labSubject) {
+
+        //查询配置硬件的实验室
+        List<LabHazardSubjectRelation> relationsList = hazardSubjectRelationService.relationSubjectGroupByCount();
+        if(relationsList!=null && relationsList.size()>0){
+            List<Long> ids =  relationsList.stream().map(a->a.getSubjectId()).collect(Collectors.toList());
+            labSubject.setIds(ids);
+        }
         return bigViewService.queryMySubview(labSubject);
         return bigViewService.queryMySubview(labSubject);
     }
     }
 
 

+ 6 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/mapper/LabHazardSubjectRelationMapper.java

@@ -97,4 +97,10 @@ public interface LabHazardSubjectRelationMapper {
      * @return
      * @return
      */
      */
     List<LabHazardSubjectRelation> relationBigViewCount(LabHazardSubjectRelation relation);
     List<LabHazardSubjectRelation> relationBigViewCount(LabHazardSubjectRelation relation);
+
+    /***
+     * 根据实验id分组
+     * @return
+     */
+    List<LabHazardSubjectRelation> relationSubjectGroupByCount();
 }
 }

+ 6 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/ILabHazardSubjectRelationService.java

@@ -120,4 +120,10 @@ public interface ILabHazardSubjectRelationService {
      * @return
      * @return
      */
      */
     List<LabHazardSubjectRelation> relationBigViewCount(LabHazardSubjectRelation relation);
     List<LabHazardSubjectRelation> relationBigViewCount(LabHazardSubjectRelation relation);
+
+    /***
+     * 根据实验id分组
+     * @return
+     */
+    List<LabHazardSubjectRelation> relationSubjectGroupByCount();
 }
 }

+ 9 - 0
zd-modules/zd-modules-laboratory/src/main/java/com/zd/laboratory/service/impl/LabHazardSubjectRelationServiceImpl.java

@@ -306,4 +306,13 @@ public class LabHazardSubjectRelationServiceImpl implements ILabHazardSubjectRel
     public List<LabHazardSubjectRelation> relationBigViewCount(LabHazardSubjectRelation relation) {
     public List<LabHazardSubjectRelation> relationBigViewCount(LabHazardSubjectRelation relation) {
         return labHazardSubjectRelationMapper.relationBigViewCount(relation);
         return labHazardSubjectRelationMapper.relationBigViewCount(relation);
     }
     }
+
+    /***
+     * 根据实验id分组
+     * @return
+     */
+    @Override
+    public List<LabHazardSubjectRelation> relationSubjectGroupByCount() {
+        return labHazardSubjectRelationMapper.relationSubjectGroupByCount();
+    }
 }
 }

+ 5 - 0
zd-modules/zd-modules-laboratory/src/main/resources/mapper/laboratory/LabHazardSubjectRelationMapper.xml

@@ -191,4 +191,9 @@
              ) t
              ) t
         GROUP BY dept_id, hazard_type_mode
         GROUP BY dept_id, hazard_type_mode
     </select>
     </select>
+
+    <select id="relationSubjectGroupByCount" parameterType="com.zd.laboratory.domain.LabHazardSubjectRelation"
+            resultType="com.zd.laboratory.domain.LabHazardSubjectRelation">
+        select r.subject_id,count(1) a  from lab_hazard_subject_relation r where r.subject_id is not null GROUP BY r.subject_id
+    </select>
 </mapper>
 </mapper>