装置在线率调度任务

This commit is contained in:
hanyong
2022-09-26 13:10:27 +08:00
parent 7f18439b12
commit adc1e44a71
8 changed files with 453 additions and 4 deletions

View File

@@ -306,6 +306,14 @@ public class LineController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineMapper.getDeviceList(), methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getRunLineIdsList")
@ApiOperation("获取生成在线率的监测点Id")
public HttpResult<List<String>> getRunLineIdsList() {
String methodDescribe = getMethodDescribe("getRunLineIdsList");
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineMapper.getRunLineIdsList(), methodDescribe);
}
/**
* 获取当前状态在线的监测点数量
@@ -343,6 +351,21 @@ public class LineController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,idsRes, methodDescribe);
}
/**
* 获取监测点设备id
* @param lineIds 监测点集合
* @return 监测点设备id
* @author cdf
* @date 2022/8/1
*/
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getOnLineDevLine")
@ApiOperation("获取当前状态在线的监测点数量")
@ApiImplicitParam(name = "lineIds", value = "监测点集合", required = true)
public HttpResult<List<OnlineLineDTO>> getOnLineDevLine(@RequestBody List<String> lineIds) {
String methodDescribe = getMethodDescribe("getOnLineDevLine");
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineMapper.getOnLineDevLine(lineIds), methodDescribe);
}
}

View File

@@ -7,13 +7,10 @@ import com.njcn.common.pojo.dto.SimpleDTO;
import com.njcn.device.pojo.bo.BaseLineInfo;
import com.njcn.device.pojo.bo.DeviceType;
import com.njcn.device.pojo.bo.excel.TerminalBaseExcel;
import com.njcn.device.pojo.dto.OverLimitLineDTO;
import com.njcn.device.pojo.dto.PollutionLineDTO;
import com.njcn.device.pojo.dto.WarningSubstationDTO;
import com.njcn.device.pojo.dto.*;
import com.njcn.device.pojo.param.DeviceInfoParam;
import com.njcn.device.pojo.po.*;
import com.njcn.device.pojo.vo.*;
import com.njcn.device.pojo.dto.PollutionSubstationDTO;
import com.njcn.web.pojo.vo.LineDataVO;
import org.apache.ibatis.annotations.Param;
@@ -319,15 +316,32 @@ public interface LineMapper extends BaseMapper<Line> {
*/
List<String> getDeviceList();
/**
* 获取生成在线率的监测点Id
* @return 监测点Id
*/
List<String> getRunLineIdsList();
/**
* 获取当前状态在线的监测点数量
* @return Integer 在线监测点数量
*/
Integer getOnLineCount(@Param("lineIds")List<String> lineIds);
/**
* 获取监测点设备id
* @return Integer 监测点设备id
*/
List<OnlineLineDTO> getOnLineDevLine(@Param("lineIds")List<String> lineIds);
/**
* 获取当前状态在线和离线的监测点
* @return 在线或离线监测点ids
*/
List<String> getOnOrUnLine(@Param("list")List<String> lineIds,@Param("comFlag")Integer comFlag);
}

View File

@@ -902,6 +902,19 @@ FROM
SELECT Id FROM pq_device WHERE Dev_Model = 1 AND Dev_Data_Type IN (1,2) AND Run_Flag = 0
</select>
<select id="getRunLineIdsList" resultType="string">
select a.id from pq_line a
inner join pq_line b on a.pid = b.id
inner join pq_line c on b.pid = c.id
inner join pq_device d on c.id = d.id
where d.Dev_Model = 1
AND d.Dev_Data_Type IN (1,2)
AND d.Run_Flag = 0
and a.level = 6
and a.state = 1
</select>
<select id="getOnLineCount" resultType="int">
SELECT
@@ -921,6 +934,17 @@ FROM
</foreach>
</select>
<select id="getOnLineDevLine" resultType="OnlineLineDTO">
select a.id lineId,c.id devId from pq_line a
inner join pq_line b on a.pid = b.id
inner join pq_line c on b.pid = c.id
where a.id in
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
<select id="getOnOrUnLine" resultType="String">
select a.id from pq_line a
inner join pq_line b on a.pid = b.id