代码调整

This commit is contained in:
2022-12-27 15:51:37 +08:00
parent 97e18b59cf
commit 7c4cef74e7
17 changed files with 300 additions and 24 deletions

View File

@@ -20,13 +20,17 @@ import java.util.List;
*/
public interface DeviceMapper extends BaseMapper<Device> {
/**
* 通过设备id集查询装置信息
* 获取变电站下面装置
* @param subId 变电站id
* @param ip 装置ip
* @param port 装置端口号
* @author cdf
* @date 2022/5/11
* @date 2022/12/26
*/
//TODO
List<Device> getDeviceList(@Param("list") List<String> list);
List<Device> getDeviceBySubId(@Param("subId") String subId,@Param("ip") String ip,@Param("port") Integer port);
/**
* 获取监测点台账信息

View File

@@ -3,7 +3,13 @@
<mapper namespace="com.njcn.device.pq.mapper.DeviceMapper">
<select id="getDeviceList">
<select id="getDeviceBySubId" resultType="Device">
select * from pq_line a
inner join pq_device b on a.id=b.id
where a.pid = #{subId}
and a.state = 1
and b.ip = #{ip}
and b.port = #{port}
</select>

View File

@@ -1546,7 +1546,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
if (Objects.isNull(temp)) {
temp = assembleLine(deviceName, LineBaseEnum.DEVICE_LEVEL.getCode(), pids.get(LineBaseEnum.SUB_LEVEL.getCode()), pids);
this.baseMapper.insert(temp);
List<Device> existIp = lineMapper.getDeviceBySubId(pids.get(LineBaseEnum.SUB_LEVEL.getCode()), Stream.of(oracleTerminalExcel.getIp()).collect(Collectors.toList()));
List<Device> existIp = deviceMapper.getDeviceBySubId(pids.get(LineBaseEnum.SUB_LEVEL.getCode()),oracleTerminalExcel.getIp(),oracleTerminalExcel.getPort());
if (CollectionUtil.isNotEmpty(existIp)) {
Device device = existIp.get(0);
if (!device.getId().equalsIgnoreCase(temp.getId())) {