王苗苗 5 сар өмнө
parent
commit
0bb2c8c07b

+ 2 - 0
src/main/java/com/xlht/xlhtproject/enums/MyConstants.java

@@ -9,6 +9,8 @@ public class MyConstants {
 
     public static final int INT_3 = 3;
 
+    public static final int INT_7 = 7;
+
 
     public static final int NUMBER_SCALE_4 = 4;
     public static final int NUMBER_SCALE_10 = 10;

+ 2 - 0
src/main/java/com/xlht/xlhtproject/mapper/TShuju1Mapper.java

@@ -63,4 +63,6 @@ public interface TShuju1Mapper
 
     //获取最新的一条数据,并且是按照之前的返回的对象处理【SQL 别名】
     SmartAdd getNewestData();
+
+    int selectCountDistinctAssayNo();
 }

+ 7 - 2
src/main/java/com/xlht/xlhtproject/service/impl/FrontServiceImpl.java

@@ -128,11 +128,16 @@ public class FrontServiceImpl implements IFrontService {
         if(!Objects.isNull(tTbXie))
             build.setStatus(tTbXie.getJqrZhuantai());
         //获取累计运行天数  定义:只要某天有化验,那么就算累计加一天
+        //2024年10月13日13:56:33 查询逻辑调整:不再查询化验记录,查询上报的数据 (T_SHUJU_1)表的数据
         build.setDays(this.zAssayMapper.selectDistinctDays());
-        //获取累计化验轮次
+        /*//获取累计化验轮次
         build.setCounts(this.zAssayMapper.selectCount());
         //获取累计化验次数
-        build.setTotals(this.zAssayResultMapper.selectCount());
+        build.setTotals(this.zAssayResultMapper.selectCount());*/
+        //2024年10月13日13:56:14  化验次数和化验轮次
+        int count = this.shuju1Mapper.selectCountDistinctAssayNo();
+        build.setCounts(count);
+        build.setTotals(count * INT_7);
         return build;
     }
 }

+ 4 - 0
src/main/resources/mapper/TShuju1Mapper.xml

@@ -265,4 +265,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         order by id desc
     </select>
+
+    <select id="selectCountDistinctAssayNo" resultType="int">
+        SELECT COUNT(DISTINCT jqr_ID) FROM T_SHUJU_1
+    </select>
 </mapper>

+ 3 - 2
src/main/resources/mapper/ZAssayMapper.xml

@@ -166,8 +166,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT COUNT(*) FROM z_assay
     </select>
 
-
+    <!-- 2024年10月13日13:54:16 查询逻辑调整:不再查询化验记录,查询上报的数据 -->
     <select id="selectDistinctDays" resultType="int">
-        SELECT COUNT(distinct SUBSTRING (create_time, 1, 10 )) FROM z_assay
+        <!-- SELECT COUNT(distinct SUBSTRING (create_time, 1, 10 )) FROM z_assay  -->
+        SELECT COUNT(distinct SUBSTRING (time, 1, 10 )) FROM T_SHUJU_1
     </select>
 </mapper>