From 086e9639f47c407e3a1e5b2f71ca816d397fe9fc Mon Sep 17 00:00:00 2001 From: whyclxw <810412026@qq.com> Date: 星期四, 29 五月 2025 13:46:44 +0800 Subject: [PATCH] 实时页面内阻测试 --- src/main/java/com/whyc/service/BattresdataInfService.java | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/whyc/service/BattresdataInfService.java b/src/main/java/com/whyc/service/BattresdataInfService.java index 9c61fc4..0e089fe 100644 --- a/src/main/java/com/whyc/service/BattresdataInfService.java +++ b/src/main/java/com/whyc/service/BattresdataInfService.java @@ -1,15 +1,28 @@ package com.whyc.service; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.whyc.dto.Real.QuarterDto; import com.whyc.mapper.BattresdataInfMapper; +import com.whyc.mapper.CommonMapper; +import com.whyc.pojo.db_batt_testdata.BattresdataId; import com.whyc.pojo.db_batt_testdata.BattresdataInf; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; @Service public class BattresdataInfService { @Autowired(required = false) private BattresdataInfMapper mapper; + + @Autowired(required = false) + private SubTablePageInfoService subTablePageInfoService; + + @Resource + private CommonMapper commonMapper; + //涓婁竴娆″唴闃绘祴璇曟暟鎹� public BattresdataInf getLastTestData(Integer battgroupId) { QueryWrapper wrapper = new QueryWrapper(); @@ -19,4 +32,21 @@ BattresdataInf rinf = mapper.selectOne(wrapper); return rinf; } + //鑾峰彇鍐呴樆鍒濆鏁版嵁锛堢涓�娆″唴闃绘祴璇曠殑绗竴绗旀暟鎹級 + public List<QuarterDto> getFirstResData(Integer battgroupId) { + QueryWrapper wrapper = new QueryWrapper(); + wrapper.eq("battgroup_id", battgroupId); + wrapper.last(" limit 1"); + wrapper.last(" ORDER BY test_record_count asc "); + BattresdataInf rinf = mapper.selectOne(wrapper); + if(rinf!=null){ + String tableName ="db_batt_testdata.tb_battresdata_"+battgroupId; + String existTableName = commonMapper.existTable("db_batt_testdata", "tb_battresdata_"+battgroupId); + if(existTableName != null){ + List<QuarterDto> list=subTablePageInfoService.getBattResInfData(battgroupId,rinf.getTestRecordCount()); + return list; + } + } + return null; + } } \ No newline at end of file -- Gitblit v1.9.1