删除监测点表devid
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import com.alibaba.nacos.client.naming.utils.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
||||
import com.njcn.csdevice.mapper.CsLinePOMapper;
|
||||
import com.njcn.csdevice.pojo.po.CsLedger;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.service.CsLinePOService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
@@ -17,18 +24,28 @@ import java.util.List;
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> implements CsLinePOService{
|
||||
private final CsLedgerMapper csLedgerMapper;
|
||||
|
||||
@Override
|
||||
public List<CsLinePO> getLineByDev(List<String> list) {
|
||||
return this.lambdaQuery().eq(CsLinePO::getDevId,list).list();
|
||||
List<CsLinePO> result = new ArrayList<>();
|
||||
list.forEach(temp->{
|
||||
List<CsLinePO> csLinePOList = queryByDevId(temp);
|
||||
result.addAll(csLinePOList);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsLinePO> queryByDevId(String devId) {
|
||||
QueryWrapper<CsLinePO> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("dev_id", devId);
|
||||
List<CsLinePO> csLinePOList = this.list(queryWrapper);
|
||||
return csLinePOList;
|
||||
QueryWrapper<CsLedger> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("state",1).eq("pid",devId);
|
||||
List<CsLedger> csLedgerList = csLedgerMapper.selectList(queryWrapper);
|
||||
List<String> csPairList = csLedgerList.stream().map(CsLedger::getId).collect(Collectors.toList());
|
||||
List<CsLinePO> csLinePOS = this.listByIds(csPairList);
|
||||
csLinePOS.forEach(temp->temp.setDevId(devId));
|
||||
return csLinePOS;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user