whyclxw
2025-04-18 b2300d14a4a41029c47615f757e621e025f18cda
src/main/java/com/whyc/service/StationInfService.java
@@ -7,9 +7,11 @@
import com.whyc.dto.Response;
import com.whyc.dto.Station.Provice;
import com.whyc.dto.StationDto;
import com.whyc.mapper.BaojigroupMapper;
import com.whyc.mapper.StationInfMapper;
import com.whyc.pojo.plus_inf.LockInf;
import com.whyc.pojo.plus_inf.StationInf;
import com.whyc.pojo.plus_user.Baojigroup;
import com.whyc.util.ActionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -22,8 +24,11 @@
    @Autowired(required = false)
    private StationInfMapper mapper;
    @Autowired(required = false)
    @Autowired
    private LockInfService linfService;
    @Autowired(required = false)
    private BaojigroupMapper groupMapper;
    //获取左侧列表
    public Response getLeftStation(int uid) {
@@ -139,4 +144,16 @@
        PageInfo pageInfo=new PageInfo(list);
        return new Response().setII(1,list!=null,pageInfo,"查询机房");
    }
    //根据stationid和包机组id查询机房名和包机组名
    public Response getNamebyId(Integer stationId, Integer baojiId) {
        QueryWrapper wrapper=new QueryWrapper();
        wrapper.eq("station_id",stationId);
        wrapper.last("limit 1");
        StationInf sinf=mapper.selectOne(wrapper);
        QueryWrapper wrapper1=new QueryWrapper();
        wrapper1.eq("id",baojiId);
        wrapper1.last("limit 1");
        Baojigroup baoji=groupMapper.selectOne(wrapper1);
        return new Response().setIII(1,true,sinf,baoji,"根据stationid和包机组id查询机房名和包机组名");
    }
}