| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.StationInfMapper; |
| | | import com.whyc.pojo.db_batt.StationInf; |
| | |
| | | List<StationInf> list=mapper.getAllSinf(); |
| | | return new Response().setII(1,list!=null,list,"查询左侧机房信息列表"); |
| | | } |
| | | |
| | | public StationInf getByStationName(String stationName) { |
| | | QueryWrapper<StationInf> query = Wrappers.query(); |
| | | query.eq("sinf_name",stationName); |
| | | return mapper.selectOne(query); |
| | | } |
| | | |
| | | public StationInf add(StationInf stationNew) { |
| | | int stationId = mapper.getMaxStationId(); |
| | | stationNew.setSinfId(stationId+1); |
| | | mapper.insert(stationNew); |
| | | return stationNew; |
| | | } |
| | | |
| | | public int getMaxStationId() { |
| | | return mapper.getMaxStationId(); |
| | | } |
| | | } |