yuliang 5 năm trước cách đây
mục cha
commit
1d7096fa2b

+ 6 - 6
whepi-web/src/main/java/com/bofeng/dao/MsReportMapper.java

@@ -26,19 +26,19 @@ public interface MsReportMapper extends BaseMapper<MsReport> {
     List<Long> selectHouseIdsByUserId(@Param("userId") Long userId);
 
     //确诊
-    @Select("select count(*) from ms_suspected where report_id=#{reportId} and  medical=#{medical}")
-    Integer selectSuspectedNum(@Param("reportId") Long reportId, @Param("medical") Integer medical);
+    @Select("select count(suspected_id) from ms_suspected where report_id=#{reportId} and  medical=1")
+    Integer selectSuspectedNum(@Param("reportId") Long reportId);
 
     //隔离
-    @Select("select count(*) from ms_suspected where report_id=#{reportId} and  single_room=#{singleRoom}")
-    Integer selectSingleRoomNum(@Param("reportId") Long reportId, @Param("singleRoom") Integer singleRoom);
+    @Select("select count(suspected_id) from ms_suspected where report_id=#{reportId} and  single_room=1")
+    Integer selectSingleRoomNum(@Param("reportId") Long reportId);
 
     //正常
-    @Select("select count(*) from ms_suspected where report_id=#{reportId} and  suspected_status=0")
+    @Select("select count(suspected_id) from ms_suspected where report_id=#{reportId} and  suspected_status=0")
     Integer selectisSuspectedNum(@Param("reportId") Long reportId);
 
     //疑似
-    @Select("select count(*) from ms_suspected where report_id=#{reportId} and suspected_status=1")
+    @Select("select count(suspected_id) from ms_suspected where report_id=#{reportId} and suspected_status=1")
     Integer selectisNoSuspectedNum(@Param("reportId") Long reportId);
 
 }

+ 8 - 1
whepi-web/src/main/java/com/bofeng/dao/RbMapper.java

@@ -43,6 +43,13 @@ public interface RbMapper extends BaseMapper<sysUptownUnit> {
     List<MsSuspected> selectYcXq(@Param("houseId") Long houseId, @Param("dateStr") String dateStr);
 
     @Select(
+            "select count(a.house_id) as houseCount\n" +
+                    "from sys_uptown_house a \n" +
+                    "INNER JOIN sys_uptown_unit b ON b.unit_id = a.unit_id and b.uptown_id = #{uptownId}"
+    )
+    Map<String, Integer> selecthuiz1(@Param("uptownId") Long uptownId);
+
+    @Select(
             "select count(a.report_id) as yichangCount\n" +
                     "from ms_report a \n" +
                     "INNER JOIN sys_uptown_house b ON a.house_id = b.house_id\n" +
@@ -53,7 +60,7 @@ public interface RbMapper extends BaseMapper<sysUptownUnit> {
 
     @Select(
             "select sum(a.safety_num) AS safetyNum, sum(suspected_num) as suspectedNum\n" +
-                    ", count(b.house_id) as houseCount, count(a.report_id) as reportCount\n" +
+                    ", count(a.report_id) as reportCount\n" +
                     "from ms_report a \n" +
                     "INNER JOIN sys_uptown_house b ON a.house_id = b.house_id\n" +
                     "INNER JOIN sys_uptown_unit c ON c.unit_id = b.unit_id and c.uptown_id = #{uptownId}\n" +

+ 8 - 7
whepi-web/src/main/java/com/bofeng/service/MsSuspectedService.java

@@ -170,13 +170,14 @@ public class MsSuspectedService {
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public void updateReport(Long reportId, Integer medical, Integer singleRoom, BigDecimal temperature) {
         //更新今日日报
+        Integer trueNum = 0, singleNum = 0, isSuspected = 0, isNoSuspected = 0, isFamliy = 0;
+
         //确诊
-        Integer isTrue = 0, isSingle = 0, isSuspected = 0, isNoSuspected = 0, isFamliy = 0;
-        if (medical == 1)
-            isTrue = msReportMapper.selectSuspectedNum(reportId, medical);
+        trueNum = msReportMapper.selectSuspectedNum(reportId);
+
         //居家隔离
-        if (singleRoom == 1)
-            isSingle = msReportMapper.selectSingleRoomNum(reportId, singleRoom);
+        singleNum = msReportMapper.selectSingleRoomNum(reportId);
+
         //正常
         isSuspected = msReportMapper.selectisSuspectedNum(reportId);
 
@@ -189,8 +190,8 @@ public class MsSuspectedService {
             isFamliy = list.size();
         MsReport msReport = msReportMapper.selectById(reportId);
         if (msReport != null) {
-            msReport.setSureNum(isTrue);
-            msReport.setSingleNum(isSingle);
+            msReport.setSureNum(trueNum);
+            msReport.setSingleNum(singleNum);
             msReport.setSuspectedNum(isNoSuspected);
             msReport.setNormalNum(isSuspected);
             msReport.setSafetyNum(isFamliy);

+ 2 - 1
whepi-web/src/main/java/com/bofeng/wx/controller/YeWeiHuiController.java

@@ -192,11 +192,12 @@ public class YeWeiHuiController {
             Long upId = uptowns.get(0).getUptownId();
             Map<String, Integer> map1 = rbMapper.selecthuiz(upId,reportDate);
             Map<String, Integer> map2 = rbMapper.selectyicahng(upId,reportDate);
+            Map<String, Integer> map3 = rbMapper.selecthuiz1(upId);
 
             Map<String, Object> reMap = Maps.newHashMap();
             reMap.put("uptownName", uptowns.get(0).getUptownName());
             List<Integer> nums = Lists.newArrayList();
-            nums.add(Conv.NI(map1.get("houseCount")));
+            nums.add(Conv.NI(map3.get("houseCount")));
             nums.add(Conv.NI(map1.get("reportCount")));
             nums.add(Conv.NI(map2.get("yichangCount")));
             nums.add(Conv.NI(map1.get("safetyNum")));