From 29fccde6ffb6b51689b26da02a62b9401e04075a Mon Sep 17 00:00:00 2001 From: whyclxw <810412026@qq.com> Date: 星期四, 27 六月 2024 16:07:05 +0800 Subject: [PATCH] 电源ACDC --- src/main/java/com/whyc/service/SinfBinfService.java | 39 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/whyc/service/SinfBinfService.java b/src/main/java/com/whyc/service/SinfBinfService.java index 1a5b1c4..288b3c9 100644 --- a/src/main/java/com/whyc/service/SinfBinfService.java +++ b/src/main/java/com/whyc/service/SinfBinfService.java @@ -1,11 +1,18 @@ package com.whyc.service; +import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.whyc.dto.Response; import com.whyc.mapper.SinfBinfMapper; +import com.whyc.mapper.StationInfMapper; +import com.whyc.pojo.BattInf; +import com.whyc.pojo.PowerInf; +import com.whyc.pojo.SinfBinf; import com.whyc.pojo.StationInf; +import com.whyc.util.ActionUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.swing.*; import java.util.List; @Service @@ -13,6 +20,9 @@ @Autowired(required = false) private SinfBinfMapper mapper; + + @Autowired(required = false) + private StationInfMapper sinfMapper; /*鏌ヨ宸︿晶鐢垫睜鏈烘埧淇℃伅鍒楄〃 * @param null 鍏ュ弬 @@ -35,4 +45,33 @@ List<StationInf> list=mapper.getAllSinfBinf2(); return new Response().setII(1,list!=null,list,"宸︿晶鐢垫簮鏈烘埧淇℃伅"); } + + /*鏌ヨ宸︿晶鏈烘埧淇℃伅鍒楄〃(鍖呭惈鐢垫簮鍜岀數姹�) + * @param null 鍏ュ弬 + * @return null + * @author lxw + * @date 2024/6/27 15:58 + **/ + public Response getAllSinfBinf() { + List<StationInf> list=sinfMapper.selectList((Wrapper<StationInf>) ActionUtil.objeNull); + if(list!=null){ + for (StationInf sinf:list) { + if(sinf.getStype()==1){ + List<BattInf> binfList=mapper.selectBinfList(sinf.getSinfId()); + sinf.setBinfList(binfList); + } + if(sinf.getStype()==2){ + List<PowerInf> pinfList=mapper.selectPinfList(sinf.getSinfId()); + sinf.setPinfList(pinfList); + } + if(sinf.getStype()==0){ + List<BattInf> binfList=mapper.selectBinfList(sinf.getSinfId()); + sinf.setBinfList(binfList); + List<PowerInf> pinfList=mapper.selectPinfList(sinf.getSinfId()); + sinf.setPinfList(pinfList); + } + } + } + return new Response().setII(1,list!=null,list,"鏌ヨ宸︿晶鏈烘埧淇℃伅鍒楄〃(鍖呭惈鐢垫簮鍜岀數姹�)"); + } } -- Gitblit v1.9.1