| | |
| | | import com.whyc.mapper.BattInfMapper; |
| | | import com.whyc.pojo.A059StationInf; |
| | | import com.whyc.pojo.Battinf; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | private BattInfMapper battInfMapper; |
| | | |
| | | |
| | | public Response getA059StationInfListAndBattInf(int pageNum,int pageSize,String province,String city,String county){ |
| | | PageHelper.startPage(pageNum,pageSize); |
| | | public Response getA059StationInfListAndBattInf(int pageNum, int pageSize, String province, String city, String county, int stationType) { |
| | | PageHelper.startPage(pageNum, pageSize); |
| | | List<A059StationInfDTO> list = new ArrayList<>(); |
| | | QueryWrapper<A059StationInf> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("station_province",province); |
| | | queryWrapper.eq("station_city",city); |
| | | queryWrapper.eq("station_county",county); |
| | | if (province!=null) { |
| | | queryWrapper.eq("station_province", province); |
| | | } |
| | | if (city!=null) { |
| | | queryWrapper.eq("station_city", city); |
| | | } |
| | | if (county!=null) { |
| | | queryWrapper.eq("station_county", county); |
| | | } |
| | | if (stationType != -1) { |
| | | queryWrapper.eq("station_type", stationType); |
| | | } |
| | | queryWrapper.orderByDesc("last_update_time"); |
| | | List<A059StationInf> stationInfs = mapper.selectList(null); |
| | | List<A059StationInf> stationInfs = mapper.selectList(queryWrapper); |
| | | QueryWrapper<Battinf> battinfQueryWrapper = new QueryWrapper<>(); |
| | | for (A059StationInf stationInf:stationInfs) { |
| | | for (A059StationInf stationInf : stationInfs) { |
| | | A059StationInfDTO dto = new A059StationInfDTO(); |
| | | dto.setStationInf(stationInf); |
| | | battinfQueryWrapper.eq("dev_num",stationInf.getDevNum()); |
| | | Battinf battinf = battInfMapper.selectOne(battinfQueryWrapper); |
| | | //battinfQueryWrapper.eq("StationName1",stationInf.getStationProvince()) |
| | | //.eq("StationName2",stationInf.getStationCity()) |
| | | //.eq("StationName5",stationInf.getStationCounty()) |
| | | //.eq("StationName3",stationInf.getStationNameEx()); |
| | | // |
| | | //List<Battinf> battinf = battInfMapper.selectList(battinfQueryWrapper); |
| | | List<Battinf> battinf = battInfMapper.getA059StationOfBattinf(stationInf.getStationProvince(), stationInf.getStationCity(), stationInf.getStationCounty(), stationInf.getStationNameEx()); |
| | | dto.setBattinf(battinf); |
| | | list.add(dto); |
| | | } |