From 464fe41610a39c3a06f070d5a01c930134ff0163 Mon Sep 17 00:00:00 2001
From: zf <1603559716@qq.com>
Date: 星期三, 30 八月 2023 09:05:05 +0800
Subject: [PATCH] 检查统计

---
 src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetySelfInspectionImpl.java |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetySelfInspectionImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetySelfInspectionImpl.java
index d37efdd..1a8b085 100644
--- a/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetySelfInspectionImpl.java
+++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetySelfInspectionImpl.java
@@ -5,6 +5,7 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.gk.hotwork.Domain.*;
+import com.gk.hotwork.Domain.Do.CompanyStatisticInspectionDO;
 import com.gk.hotwork.Domain.Do.SafetySelfInspectionItemQualifiedCountDO;
 import com.gk.hotwork.Domain.Exception.BusinessException;
 import com.gk.hotwork.Domain.Utils.BeanUtils;
@@ -754,6 +755,29 @@
         attachmentInfoService.updateBusinessIdBatch(attachmentList);
     }
 
+    @Override
+    public Date selectLastTimeByCompanyId(Long companyId,Date startTime,Date endTime) {
+        SafetySelfInspection inspection = safetySelfInspectionMapper.selectOne(new LambdaQueryWrapper<SafetySelfInspection>()
+                 .eq(SafetySelfInspection::getValidFlag,1)
+                .eq(SafetySelfInspection::getFlag, 2)
+                .eq(SafetySelfInspection::getCheckedCompanyId, companyId)
+                .ge(startTime != null,SafetySelfInspection::getInspectionTime,startTime)
+                .le(endTime != null,SafetySelfInspection::getInspectionTime,endTime)
+                .orderByDesc(SafetySelfInspection::getInspectionTime)
+                .last("limit 1"));
+        if(inspection != null){
+            return inspection.getInspectionTime();
+        }
+       return null;
+
+    }
+
+    @Override
+    public CompanyStatisticInspectionDO companyStatisticInspection(Map<String, Object> params) {
+
+        return safetySelfInspectionMapper.companyStatisticInspection(params);
+    }
+
     private void requiredAttachmentVerification(List<AttachmentInfo> attachmentList) {
         if(CollectionUtils.isEmpty(attachmentList)){
             throw new BusinessException("附件信息为空");

--
Gitblit v1.9.2