From 0541c0791acea41b584f71fc59e22d4d21ba0883 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期三, 15 四月 2026 11:10:46 +0800
Subject: [PATCH] ``` refactor(energy): 优化实时能耗数据服务实现

---
 src/main/java/com/ruoyi/projectManagement/service/impl/handle/ContractInfoHandleService.java |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/ruoyi/projectManagement/service/impl/handle/ContractInfoHandleService.java b/src/main/java/com/ruoyi/projectManagement/service/impl/handle/ContractInfoHandleService.java
index 18bdc96..59cbb9f 100644
--- a/src/main/java/com/ruoyi/projectManagement/service/impl/handle/ContractInfoHandleService.java
+++ b/src/main/java/com/ruoyi/projectManagement/service/impl/handle/ContractInfoHandleService.java
@@ -1,6 +1,7 @@
 package com.ruoyi.projectManagement.service.impl.handle;
 
 import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ruoyi.projectManagement.dto.ContractInfoDto;
 import com.ruoyi.projectManagement.mapper.ContractInfoMapper;
 import com.ruoyi.projectManagement.pojo.ContractInfo;
@@ -34,4 +35,14 @@
             contractInfoMapper.updateById(contractInfo);
         }
     }
+
+    public ContractInfoDto getByInfoId(@NotNull Long id) {
+        LambdaQueryWrapper<ContractInfo> queryWrapper = new LambdaQueryWrapper<ContractInfo>();
+        queryWrapper.eq(ContractInfo::getProjectManagementInfoId, id);
+        queryWrapper.eq(ContractInfo::getIsDelete, 0);
+        queryWrapper.last("limit 1");
+        ContractInfo contractInfo = contractInfoMapper.selectOne(queryWrapper);
+        return BeanUtil.copyProperties(contractInfo, ContractInfoDto.class);
+    }
+
 }

--
Gitblit v1.9.3