Kaynağa Gözat

pms 非生产时效 跳转

zhangcl 22 saat önce
ebeveyn
işleme
3f4e57d366

+ 3 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/iotrydailyreport/vo/IotRyDailyReportPageReqVO.java

@@ -158,4 +158,7 @@ public class IotRyDailyReportPageReqVO extends PageParam {
 
     @Schema(description = "施工状态集合", example = "[dt,zx]")
     private Collection<String> statuses;
+
+    @Schema(description = "非生产时效查询标识", example = "Y")
+    private String nonProductFlag;
 }

+ 25 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/dal/mysql/iotrydailyreport/IotRyDailyReportMapper.java

@@ -149,14 +149,37 @@ public interface IotRyDailyReportMapper extends BaseMapperX<IotRyDailyReportDO>
 
         // 单独处理 projectClassification 条件
         if ("1".equals(projectClassification)) {
-            // 当值为 "1" 时,查询 project_classification 为 "1" 或空字符串的记录
+            // 当值为 "1" 时,查询 project_classification 为 "1" 或空字符串的记录 钻井
             queryWrapper.and(wrapper -> wrapper
                     .eq(IotRyDailyReportDO::getProjectClassification, "1")
                     .or().eq(IotRyDailyReportDO::getProjectClassification, "")
             );
+            // 查询非生产时效
+            if ("Y".equals(reqVO.getNonProductFlag())) {
+                queryWrapper.and(wrapper -> wrapper
+                        .gt(IotRyDailyReportDO::getAccidentTime, BigDecimal.ZERO)
+                        .or()
+                        .gt(IotRyDailyReportDO::getRepairTime, BigDecimal.ZERO)
+                        .or()
+                        .gt(IotRyDailyReportDO::getSelfStopTime, BigDecimal.ZERO)
+                        .or()
+                        .gt(IotRyDailyReportDO::getComplexityTime, BigDecimal.ZERO)
+                        .or()
+                        .gt(IotRyDailyReportDO::getRelocationTime, BigDecimal.ZERO)
+                        .or()
+                        .gt(IotRyDailyReportDO::getRectificationTime, BigDecimal.ZERO)
+                        .or()
+                        .gt(IotRyDailyReportDO::getWaitingStopTime, BigDecimal.ZERO)
+                        .or()
+                        .gt(IotRyDailyReportDO::getWinterBreakTime, BigDecimal.ZERO)
+                );
+            }
         } else {
-            // 其他情况:有值则精确匹配,无值则不添加条件(保持原逻辑)
+            // 其他情况:有值则精确匹配,无值则不添加条件(保持原逻辑) 修井
             queryWrapper.eqIfPresent(IotRyDailyReportDO::getProjectClassification, projectClassification);
+            if ("Y".equals(reqVO.getNonProductFlag())) {
+                queryWrapper.and(wrapper -> wrapper.gt(IotRyDailyReportDO::getNonProductionTime, BigDecimal.ZERO));
+            }
         }
 
         return selectPage(reqVO, queryWrapper);

+ 2 - 2
yudao-module-pms/yudao-module-pms-biz/src/main/resources/mapper/static/iotprojecttask/IotRhDailyReportMapper.xml

@@ -180,8 +180,8 @@
                 #{key}
             </foreach>
         </if>
-        <if test="reqVO.nonProductFlag != null and reqVO.nonProductFlag != ''">
-            AND rdr.non_production_time > 0
+        <if test='reqVO.nonProductFlag != null and reqVO.nonProductFlag == "Y"'>
+            AND rdr.non_production_time &gt; 0
         </if>
         <if test="reqVO.createTime != null and reqVO.createTime.length > 0">
             <!-- 处理“开始时间”(数组第1位,如 createTime[0] = 2024-01-01 00:00:00) -->