1.调整终端周期检测功能
This commit is contained in:
@@ -209,18 +209,24 @@
|
||||
|
||||
|
||||
<select id="getDeviceByIdOnOrOff" resultType="com.njcn.device.pq.pojo.vo.TerminalBaseVO">
|
||||
SELECT
|
||||
case when
|
||||
t3.obj_id is not null and t3.obj_id !='' then t3.obj_name
|
||||
else sub.name end subName,
|
||||
SELECT distinct
|
||||
case when
|
||||
t4.obj_id is not null and t4.obj_id !='' then t4.obj_name
|
||||
else sub.name end subName,
|
||||
t1.id devId,t1.name devName,t2.ip,t2.dev_type,t2.update_time,gd.name gdName
|
||||
FROM
|
||||
pq_line t3,
|
||||
pq_line_detail t4,
|
||||
pq_line bus,
|
||||
pq_line t1,
|
||||
pq_device t2,
|
||||
pq_line sub,
|
||||
pq_line gd
|
||||
WHERE
|
||||
t1.id = t2.id
|
||||
t3.id = t4.id
|
||||
and t3.pid = bus.id
|
||||
and bus.pid = t1.id
|
||||
and t1.id = t2.id
|
||||
and t1.pid = sub.id
|
||||
and sub.pid = gd.id
|
||||
<if test="deviceType.devModel!=null and deviceType.devModel.size()!=0">
|
||||
|
||||
@@ -24,6 +24,10 @@ public interface TerminalMaintainMapper {
|
||||
*/
|
||||
List<TerminalMaintainVO> getTerminalDevInfo(@Param("devIds") List<String> devIds, @Param("comFlag") Integer comFlag, @Param("devType") String devType);
|
||||
|
||||
|
||||
List<TerminalMaintainVO> terminalConfig(@Param("devIds") List<String> devIds, @Param("comFlag") Integer comFlag, @Param("devType") String devType);
|
||||
|
||||
|
||||
/**
|
||||
* 获取区域
|
||||
* @author cdf
|
||||
|
||||
@@ -38,6 +38,35 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="terminalConfig" resultType="TerminalMaintainVO">
|
||||
SELECT distinct
|
||||
IF(TRIM(detail.obj_name) != '', CONCAT(detail.obj_name,'_',a.NAME), a.NAME) as name,
|
||||
a.id,
|
||||
a.pid,
|
||||
a.level,
|
||||
b.run_flag,
|
||||
b.ip,
|
||||
b.com_flag,
|
||||
b.dev_type devType
|
||||
FROM
|
||||
pq_line line
|
||||
inner join pq_line_detail detail on line.id = detail.id
|
||||
inner join pq_line bus on line.pid = bus.id
|
||||
inner join pq_line a on bus.pid = a.id
|
||||
INNER JOIN pq_device b ON a.id = b.id
|
||||
where a.id in
|
||||
<foreach collection="devIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="comFlag != null">
|
||||
AND b.Com_Flag=#{comFlag}
|
||||
</if>
|
||||
<if test="devType !=null and devType != ''">
|
||||
AND b.Dev_Type =#{devType}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getGdAndSubList" resultType="TerminalMaintainVO">
|
||||
select id,name,level,pid from pq_line where level = #{level} and state = 1 order by sort
|
||||
</select>
|
||||
@@ -77,14 +106,17 @@
|
||||
|
||||
<select id="getRunFlagList" resultType="TerminalMaintainVO">
|
||||
SELECT
|
||||
IF(TRIM(detail.obj_name) != '', CONCAT(detail.obj_name,'_',a.NAME), a.NAME) as name,
|
||||
a.id,
|
||||
a.pid,
|
||||
a.NAME,
|
||||
b.ip,
|
||||
a.level,
|
||||
b.run_flag
|
||||
FROM
|
||||
pq_line a
|
||||
pq_line line
|
||||
inner join pq_line_detail detail on line.id = detail.id
|
||||
inner join pq_line bus on line.pid = bus.id
|
||||
inner join pq_line a on bus.pid = a.id
|
||||
INNER JOIN pq_device b ON a.id = b.id
|
||||
WHERE a.id in
|
||||
<foreach collection="ids" item="item" separator="," index="index" open="(" close=")">
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.device.terminal.service.impl;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
@@ -108,10 +109,13 @@ public class TerminalMaintainServiceImpl implements TerminalMaintainService {
|
||||
terminalMaintainVO.setName(generalDeviceDTO.getName());
|
||||
terminalMaintainVO.setId(generalDeviceDTO.getIndex());
|
||||
terminalMaintainVO.setLevel(1);
|
||||
List<TerminalMaintainVO> devList = terminalMaintainMapper.getTerminalDevInfo(devIds,terminalMainQueryParam.getComFlag(),terminalMainQueryParam.getDevType());
|
||||
List<TerminalMaintainVO> devList = terminalMaintainMapper.terminalConfig(devIds,terminalMainQueryParam.getComFlag(),terminalMainQueryParam.getDevType());
|
||||
if (CollectionUtil.isEmpty(devList)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
List<String> subIndexes = devList.stream().map(TerminalMaintainVO::getPid).collect(Collectors.toList());
|
||||
List<TerminalMaintainVO> subList1 = terminalMaintainMapper.getPqLineGdAndSubList(subIndexes);
|
||||
List<String> gdIndexes = subList1.stream().map(TerminalMaintainVO::getPid).collect(Collectors.toList());
|
||||
|
||||
Reference in New Issue
Block a user