feat: 增加lineId和towerId查询装置接口

dev
huangfeng 1 year ago
parent 6c053478fb
commit 2645d09a73

@ -29,6 +29,7 @@ import com.shxy.xymanager_common.vo.*;
import com.shxy.xymanager_dao.dao.*;
import com.shxy.xymanager_service.service.CacheService;
import com.shxy.xymanager_service.service.TerminalService;
import com.shxy.xymanager_service.service.TowerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -97,6 +98,9 @@ public class TerminalServiceImpl implements TerminalService {
@Autowired
TerminalBasicInfoHistoryDao terminalBasicInfoHistoryDao;
@Autowired
TowerService towerService;
/**
*
*
@ -929,5 +933,24 @@ public class TerminalServiceImpl implements TerminalService {
return Asserts.success(dataTable);
}
@Override
public List<Terminals> getByLineAndTower(Integer lineId, Integer towerId) {
List<Integer> towerIdList = new ArrayList<>();
if (lineId != null){
List<Towers> towersList = towerService.getByLine(lineId);
for(Towers tower: towersList){
towerIdList.add(tower.getId());
}
}
if (towerId != null){
towerIdList.add(towerId);
}
TerminalsExample example = new TerminalsExample();
TerminalsExample.Criteria criteria = example.createCriteria();
criteria.andTowerIdIn(towerIdList);
List<Terminals> result =terminalsDao.selectByExample(example);
return result;
}
}

@ -154,5 +154,14 @@ public class TowerServiceImpl implements TowerService {
}
return Asserts.success(model);
}
@Override
public List<Towers> getByLine(Integer lineId) {
TowersExample example = new TowersExample();
TowersExample.Criteria criteria = example.createCriteria();
criteria.andLineIdEqualTo(lineId);
List<Towers> list = towerDao.selectByExample(example);
return list;
}
}

@ -180,4 +180,6 @@ public interface TerminalService {
* @return
*/
ServiceBody<TableDataInfo<TerminalBasicInfoHistory>> getTermBasicInfoHistory(TermFaultsVo vo);
List<Terminals> getByLineAndTower(Integer lineId, Integer towerId);
}

@ -2,10 +2,13 @@ package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.dto.TowerDto;
import com.shxy.xymanager_common.entity.Towers;
import com.shxy.xymanager_common.model.AllTowerListModel;
import com.shxy.xymanager_common.model.TowerListModel;
import com.shxy.xymanager_common.vo.*;
import java.util.List;
/**
*
*
@ -62,5 +65,5 @@ public interface TowerService {
*/
ServiceBody<AllTowerListModel> getAllTower();
List<Towers> getByLine(Integer lineId);
}

Loading…
Cancel
Save