Browse Source

印尼项目-易达接口对接6/6

master
王寅 8 months ago
parent
commit
24b1cb000d
9 changed files with 400 additions and 60 deletions
  1. +161
    -10
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/controller/PatrolResultController.java
  2. +28
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/domain/InspectionPointParam.java
  3. +39
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/domain/InspectionPointResultVo.java
  4. +14
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/domain/PointDataResultVo.java
  5. +15
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/domain/PointDataVo.java
  6. +5
    -6
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/mapper/PatrolResultMapper.java
  7. +5
    -6
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/IPatrolResultService.java
  8. +11
    -6
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java
  9. +122
    -32
      inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml

+ 161
- 10
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/controller/PatrolResultController.java View File

@ -1,10 +1,10 @@
package com.inspect.partrolresult.controller;
import com.alibaba.druid.support.json.JSONUtils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.inspect.analysis.domain.ResultAnalysis;
import com.inspect.analysis.domain.resultList;
import com.inspect.analysis.domain.results;
import com.inspect.analysis.service.IResultAnalysisService;
import com.inspect.base.core.constant.Color;
import com.inspect.base.core.constant.RedisConst;
@ -28,12 +28,9 @@ import com.inspect.base.core.web.page.TableDataInfo;
import com.inspect.common.log.annotation.Log;
import com.inspect.common.log.enums.BizType;
import com.inspect.base.redis.service.RedisService;
import com.inspect.img.service.IInspectionReportImgService;
import com.inspect.infrared.InfraredImageParser;
import com.inspect.infrared.InfraredRequestParam;
import com.inspect.infrared.InfraredResponse;
import com.inspect.insreport.service.IInspectionReportService;
import com.inspect.insreportdata.service.IInspectionReportDataService;
import com.inspect.base.core.domain.maintain.MaintainRegion;
import com.inspect.maintain.domain.MaintainAreaXML;
import com.inspect.maintain.domain.PatrolMaintainModuleXml;
@ -61,7 +58,6 @@ import com.inspect.task.domain.PatrolTaskXML;
import com.inspect.task.service.IPatrolTaskService;
import com.inspect.taskftp.domain.PatrolTaskFtp;
import com.inspect.taskftp.service.IPatrolTaskFtpService;
import com.inspect.taskinfo.service.IPatrolTaskInfoService;
import com.inspect.taskstatus.domain.PatrolTaskStatus;
import com.inspect.taskstatus.service.IPatrolTaskStatusService;
@ -72,6 +68,8 @@ import java.lang.reflect.Field;
import java.net.HttpURLConnection;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
@ -92,7 +90,6 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
@ -324,7 +321,7 @@ public class PatrolResultController extends BaseController {
PatrolResultAux patrolResultAuxQuery = new PatrolResultAux();
patrolResultAuxQuery.setResultId(brr.getLineId() + "");
resultAuxList = iPatrolResultAuxService.selectPatrolResultAuxList(patrolResultAuxQuery);
if(resultAuxList.isEmpty()) {
if (resultAuxList.isEmpty()) {
continue;
}
@ -811,7 +808,7 @@ public class PatrolResultController extends BaseController {
}
algInfoList.removeAll(judgeList);
List<AlgInfo> meterList = (algInfoList).stream().filter((item) -> {
List<AlgInfo> meterList = (algInfoList).stream().filter((item) -> {
return "meter".equals(item.getAlgSubtypeCode());
}).collect(Collectors.toList());
if (!meterList.isEmpty()) {
@ -1346,7 +1343,7 @@ public class PatrolResultController extends BaseController {
i = patrolResultService.updatePatrolResult(patrolResult2);
// if (!"2".equals(Jqtype)) {
resultList.add(patrolResult2);
resultList.add(patrolResult2);
// }
} else {
arr.setMainId(mainID + "");
@ -1394,7 +1391,7 @@ public class PatrolResultController extends BaseController {
i = patrolResultService.insertPatrolResult(arr);//
resultStatistics.compare(arr);
// if (!"2".equals(Jqtype)) {
resultList.add(arr);
resultList.add(arr);
// }
}
}
@ -1913,4 +1910,158 @@ public class PatrolResultController extends BaseController {
return dataMsg.getFilePath() + "/" + fileName;
}
}
/**
* 获取巡检告警结果列表接
*
* @param pointDataVo
* @return
*/
@GetMapping({"/pointTrendData"})
public AjaxResult pointTrendData(PointDataVo pointDataVo) {
// 定义日期时间格式
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
LocalDateTime startDateTime = null;
LocalDateTime endDateTime = null;
if (StringUtils.isNotEmpty(pointDataVo.getStartTime()) && StringUtils.isNotEmpty(pointDataVo.getEndTime())) {
// 补全开始和结束时间
startDateTime = LocalDateTime.parse(pointDataVo.getStartTime() + " 00:00:00", formatter);
endDateTime = LocalDateTime.parse(pointDataVo.getEndTime() + " 23:59:59", formatter);
}
PatrolResult patrolResult = new PatrolResult();
patrolResult.setDeviceId(pointDataVo.getDeviceId());
List<PatrolResult> list = patrolResultService.selectPatroByAllDev(patrolResult);
List<PointDataResultVo> between_list = new ArrayList<>();
for (PatrolResult result : list) {
LocalDateTime resultDateTime = LocalDateTime.parse(result.getTime(), formatter);
PatrolResultAux pra = new PatrolResultAux();
pra.setResultId(result.getLineId() + "");
List<PatrolResultAux> pra1 = iPatrolResultAuxService.selectPatrolResultAuxList(pra);
if (!pra1.isEmpty()) {
result.setValue(pra1.get(0).getValue());
}
if ("0".equals(result.getValue())) {
result.setValue("正常");
}
if ("-1".equals(result.getValue()) || "1".equals(result.getValue())) {
result.setValue("异常");
}
if (StringUtils.isNotEmpty(pointDataVo.getStartTime()) && StringUtils.isNotEmpty(pointDataVo.getEndTime())) {
// 使用if判断时间范围
if (!resultDateTime.isBefore(startDateTime) && !resultDateTime.isAfter(endDateTime)) {
PointDataResultVo patrolResultVo = new PointDataResultVo();
patrolResultVo.setTime(result.getTime());
patrolResultVo.setValue(result.getValue());
between_list.add(patrolResultVo);
} else {
}
} else {
PointDataResultVo patrolResultVo = new PointDataResultVo();
patrolResultVo.setTime(result.getTime());
patrolResultVo.setValue(result.getValue());
between_list.add(patrolResultVo);
}
}
return AjaxResult.success(between_list);
}
@GetMapping({"/inspectResult"})
public AjaxResult inspectResult(InspectionPointParam inspectionPointParam) {
inspectionPointParam.setOffset((inspectionPointParam.getPageNum() - 1) * inspectionPointParam.getPageSize());
List<InspectionPointResultVo> inspectionPointResultVo = patrolResultService.inspectResult(inspectionPointParam);
if (!inspectionPointResultVo.isEmpty()) {
for (InspectionPointResultVo brr : inspectionPointResultVo) {
// String pointId;
// if (StringUtils.isNotEmpty(brr.getComponentId()) && StringUtils.isEmpty(brr.getDeviceName())) {
// pointId = this.recursionGetNameId(brr.getComponentId());
// if (StringUtils.isNotEmpty(pointId)) {
// String[] ars = pointId.split(StringUtils.COMMA);
// if (StringUtils.isNotEmpty(ars[0])) {
// brr.setDeviceName(ars[0]);
// }
//
// if (ars.length > 1 && StringUtils.isNotEmpty(ars[1])) {
// brr.setMaterialId(ars[1]);
// }
// }
// }
if (StringUtils.isNotEmpty(brr.getResultType())) {
if (brr.getResultType().equals("0")) {
brr.setAlarmType("1");
Map<String, String> stringStringMap = resultAnalysisService.selectPointInfoById(brr.getDeviceId());
if (stringStringMap != null) {
if (StringUtils.isNotEmpty(stringStringMap.get("point_impt_level"))) {
if (stringStringMap.get("point_impt_level").equals("Ⅰ")) {
brr.setAlarmLevel("EMERGENCY");
} else if (stringStringMap.get("point_impt_level").equals("Ⅱ")) {
brr.setAlarmLevel("SERIOUS");
} else {
brr.setAlarmLevel("TEPID");
}
} else {
brr.setAlarmLevel("TEPID");
}
} else {
brr.setAlarmLevel("TEPID");
}
} else {
brr.setAlarmLevel("NORMAL");
}
}
if (StringUtils.isNotEmpty(brr.getDeviceId())) {
String pointId = brr.getDeviceId();
List<Map<String, Object>> pointPrelist = this.patrolTaskService.selectBasePointPre(pointId);
if (pointPrelist != null && !pointPrelist.isEmpty()) {
Map<String, Object> drr = (Map) pointPrelist.get(0);
if (drr != null && drr.get("channel_code") != null) {
String channel_code = (String) drr.get("channel_code");
brr.setPatroldeviceCode(channel_code);
BasedataEqpBookChannel basedataEqpBookChannel = this.patrolResultService.selectChannelName(channel_code);
if (basedataEqpBookChannel != null) {
brr.setPatroldeviceName(basedataEqpBookChannel.getChannelName());
}
}
}
}
}
}
List<InspectionPointResultVo> filteredList = new ArrayList<>();
for (InspectionPointResultVo brr : inspectionPointResultVo) {
boolean flag = true;
if ((inspectionPointParam.getAlarmLevel() != null && !inspectionPointParam.getAlarmLevel().equals(brr.getAlarmLevel()))) {
flag = false;
}
if ((inspectionPointParam.getAlarmType() != null && !inspectionPointParam.getAlarmType().equals(brr.getAlarmType()))) {
flag = false;
}
if ((inspectionPointParam.getPatroldeviceCode() != null && !inspectionPointParam.getPatroldeviceCode().equals(brr.getPatroldeviceCode()))) {
flag = false;
}
if (flag) {
filteredList.add(brr);
}
}
return AjaxResult.success(filteredList);
}
public String recursionGetNameId(String devId) {
String str = "";
Map<String, Object> basedataDevice = this.patrolResultService.selectDevInfoById(devId);
if (null != basedataDevice && null != basedataDevice.get("parent_id")) {
if (basedataDevice.get("power_main_equ_flag").equals("Yes")) {
return basedataDevice.get("device_name") + "," + basedataDevice.get("phyasset_id");
}
devId = basedataDevice.get("parent_id") + "";
str = this.recursionGetNameId(devId);
}
return str;
}
}

+ 28
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/domain/InspectionPointParam.java View File

@ -0,0 +1,28 @@
package com.inspect.partrolresult.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 巡检结果请求参数
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public class InspectionPointParam {
String startTime;
String endTime;
String patroldeviceCode;
String deviceId;
String mainDevId;
String componentId;
String taskPatrolledId;
String alarmLevel;
String alarmType;
String resultType;
int pageNum;
int pageSize;
int offset;
}

+ 39
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/domain/InspectionPointResultVo.java View File

@ -0,0 +1,39 @@
package com.inspect.partrolresult.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* \
* 巡检结果
*/
@AllArgsConstructor
@NoArgsConstructor
@Data
public class InspectionPointResultVo {
int id;
String patroldeviceCode;
String patroldeviceName;
String taskCode;
String taskName;
String taskPatrolledId;
String deviceId;
String deviceName;
String mainDevId;
String mainDevName;
String componentId;
String componentName;
String value;
String unit;
String recognitionType;
String time;
String fileType;
String filePath;
String baseFilePath;
String rectangle;
String alarmLevel;
String alarmType;
String content;
String resultType;
}

+ 14
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/domain/PointDataResultVo.java View File

@ -0,0 +1,14 @@
package com.inspect.partrolresult.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Data
public class PointDataResultVo {
private String time;
private String value;
}

+ 15
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/domain/PointDataVo.java View File

@ -0,0 +1,15 @@
package com.inspect.partrolresult.domain;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Data
public class PointDataVo {
private String startTime;
private String endTime;
private String deviceId ;
}

+ 5
- 6
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/mapper/PatrolResultMapper.java View File

@ -1,12 +1,7 @@
package com.inspect.partrolresult.mapper;
import com.inspect.analysis.domain.ResultAnalysis;
import com.inspect.partrolresult.domain.AlgInfo;
import com.inspect.partrolresult.domain.BasePointAreaInfo;
import com.inspect.partrolresult.domain.PatrolPresetPosModule;
import com.inspect.partrolresult.domain.PatrolResult;
import com.inspect.partrolresult.domain.PatrolResultRef;
import com.inspect.partrolresult.domain.ResultValue;
import com.inspect.partrolresult.domain.*;
import com.inspect.statistics.domain.TaskStatisticsConfig;
import com.inspect.system.base.openDomain.BasedataEqpBookMoMain;
@ -100,4 +95,8 @@ public interface PatrolResultMapper {
List<PatrolResultRef> selectResultRefByLineId(String lineId);
List<BasePointAreaInfo> selectBaseInfoByMainId(String mainId);
List<InspectionPointResultVo> inspectResult(InspectionPointParam inspectionPointParam);
BasedataEqpBookChannel selectChannelName(@Param("channelCode") String channelCode);
}

+ 5
- 6
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/IPatrolResultService.java View File

@ -1,12 +1,7 @@
package com.inspect.partrolresult.service;
import com.inspect.analysis.domain.ResultAnalysis;
import com.inspect.partrolresult.domain.AlgInfo;
import com.inspect.partrolresult.domain.BasePointAreaInfo;
import com.inspect.partrolresult.domain.PatrolPresetPosModule;
import com.inspect.partrolresult.domain.PatrolResult;
import com.inspect.partrolresult.domain.PatrolResultRef;
import com.inspect.partrolresult.domain.ResultValue;
import com.inspect.partrolresult.domain.*;
import com.inspect.resultmain.domain.PatrolTaskResultMain;
import com.inspect.system.base.openDomain.BasedataEqpBookMoMain;
import com.inspect.task.domain.PatrolData;
@ -83,4 +78,8 @@ public interface IPatrolResultService {
List<PatrolResultRef> selectResultRefByLineId(String lineId);
List<BasePointAreaInfo> selectBaseInfoByMainId(String mainId);
List<InspectionPointResultVo> inspectResult(InspectionPointParam inspectionPointParam);
BasedataEqpBookChannel selectChannelName(String channelCode);
}

+ 11
- 6
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java View File

@ -14,12 +14,7 @@ import com.inspect.insreport.domain.InspectionReport;
import com.inspect.insreport.mapper.InspectionReportMapper;
import com.inspect.insreportdata.domain.InspectionReportData;
import com.inspect.insreportdata.mapper.InspectionReportDataMapper;
import com.inspect.partrolresult.domain.AlgInfo;
import com.inspect.partrolresult.domain.BasePointAreaInfo;
import com.inspect.partrolresult.domain.PatrolPresetPosModule;
import com.inspect.partrolresult.domain.PatrolResult;
import com.inspect.partrolresult.domain.PatrolResultRef;
import com.inspect.partrolresult.domain.ResultValue;
import com.inspect.partrolresult.domain.*;
import com.inspect.partrolresult.mapper.PatrolResultMapper;
import com.inspect.partrolresult.service.IPatrolResultService;
import com.inspect.partrolresult.util.PrintUtil;
@ -541,6 +536,16 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
return this.patrolResultMapper.selectBaseInfoByMainId(mainId);
}
@Override
public List<InspectionPointResultVo> inspectResult(InspectionPointParam inspectionPointParam) {
return this.patrolResultMapper.inspectResult(inspectionPointParam);
}
@Override
public BasedataEqpBookChannel selectChannelName(String channelCode) {
return patrolResultMapper.selectChannelName(channelCode);
}
public static void main(String[] args) {
List<String> students = new ArrayList<>();
students.add("s1");


+ 122
- 32
inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml View File

@ -134,18 +134,18 @@
<if test="mainId != null and mainId != ''">and main_id = #{mainId}</if>
</where>
</select>
<!-- <resultMap type="PatrolData" id="PatrolDataResult">-->
<!-- <result property="lineId" column="line_id"/>-->
<!-- <result property="pointName" column="point_name"/>-->
<!-- <result property="patrolTime" column="patrol_time"/>-->
<!-- <result property="pointStatus" column="point_status"/>-->
<!-- <result property="warnStatus" column="warn_status"/>-->
<!-- <result property="desc" column="desc"/>-->
<!-- <result property="img" column="img"/>-->
<!-- <result property="imgType" column="img_type"/>-->
<!-- <result property="dataType" column="data_type"/>-->
<!-- <result property="imgAnalyse" column="img_analysis"/>-->
<!-- </resultMap>-->
<!-- <resultMap type="PatrolData" id="PatrolDataResult">-->
<!-- <result property="lineId" column="line_id"/>-->
<!-- <result property="pointName" column="point_name"/>-->
<!-- <result property="patrolTime" column="patrol_time"/>-->
<!-- <result property="pointStatus" column="point_status"/>-->
<!-- <result property="warnStatus" column="warn_status"/>-->
<!-- <result property="desc" column="desc"/>-->
<!-- <result property="img" column="img"/>-->
<!-- <result property="imgType" column="img_type"/>-->
<!-- <result property="dataType" column="data_type"/>-->
<!-- <result property="imgAnalyse" column="img_analysis"/>-->
<!-- </resultMap>-->
<resultMap type="PatrolData" id="PatrolDataResult">
<result property="lineId" column="line_id"/>
<result property="pointName" column="point_name"/>
@ -206,8 +206,8 @@
b.point_status ,
b.result_type as warn_status,
b.description as 'desc',
<if test="filter == 0 "> b.res_img_url as img, </if>
<if test="filter == 1 "> b.image_normal_url_path as img, </if>
<if test="filter == 0 ">b.res_img_url as img,</if>
<if test="filter == 1 ">b.image_normal_url_path as img,</if>
a.file_type as img_type,
a.data_type,
b.filter,
@ -247,27 +247,44 @@
and a.task_patrolled_id=#{taskPatrolId}
and b.task_patrol_id=#{taskPatrolId}
</if>
<if test="objectId != null and objectId != ''">and b.objectId=#{objectId} </if>
<if test="objectId != null and objectId != ''">and b.objectId=#{objectId}</if>
<if test="result != null and result != ''">and b.result = #{result}</if>
<if test="resultType != null and resultType != '' and resultType == '1'.toString ">and b.result_type = #{resultType} </if>
<if test="resultType != null and resultType != '' and resultType == '2'.toString ">and b.result_type = #{resultType} </if>
<if test="filter != null and filter != '' and resCode == null">and b.filter = #{filter} and b.point_status = '0' and b.res_code='2000' </if>
<if test="resCode != null and resCode != ''">and b.filter = #{filter} and b.res_code!=#{resCode} </if>
<if test="pointName != null and pointName != ''">and a.device_name like concat('%', #{pointName}, '%') </if>
<if test="deviceName != null and deviceName != ''">and d.device_name like concat('%', #{deviceName}, '%') </if>
<if test="resultType != null and resultType != '' and resultType == '1'.toString ">and b.result_type =
#{resultType}
</if>
<if test="resultType != null and resultType != '' and resultType == '2'.toString ">and b.result_type =
#{resultType}
</if>
<if test="filter != null and filter != '' and resCode == null">and b.filter = #{filter} and b.point_status
= '0' and b.res_code='2000'
</if>
<if test="resCode != null and resCode != ''">and b.filter = #{filter} and b.res_code!=#{resCode}</if>
<if test="pointName != null and pointName != ''">and a.device_name like concat('%', #{pointName}, '%')</if>
<if test="deviceName != null and deviceName != ''">and d.device_name like concat('%', #{deviceName}, '%')
</if>
<if test="posType != null and posType != '' and posType == '0'.toString">
<if test="channelName != null and channelName != ''">and g.channel_name like concat('%', #{channelName}, '%') </if>
<if test="deviceSource != null and deviceSource != ''">and g.device_source like concat('%', #{deviceSource}, '%') </if>
<if test="channelName != null and channelName != ''">and g.channel_name like concat('%',
#{channelName}, '%')
</if>
<if test="deviceSource != null and deviceSource != ''">and g.device_source like concat('%',
#{deviceSource}, '%')
</if>
</if>
<if test="posType != null and posType != '' and posType != '0'.toString">
<if test="channelName != null and channelName != ''">and h.patrol_device_name like concat('%', #{channelName}, '%') </if>
<if test="deviceSource != null and deviceSource != ''">and h.device_source like concat('%', #{deviceSource}, '%') </if>
<if test="channelName != null and channelName != ''">and h.patrol_device_name like concat('%',
#{channelName}, '%')
</if>
<if test="deviceSource != null and deviceSource != ''">and h.device_source like concat('%',
#{deviceSource}, '%')
</if>
</if>
<if test="desc != null and desc != ''">and b.description like concat('%', #{desc}, '%')</if>
<if test="pointStatus != null and pointStatus != ''">and b.point_status like concat('%', #{pointStatus},
'%')
</if>
<if test="desc != null and desc != ''">and b.description like concat('%', #{desc}, '%') </if>
<if test="pointStatus != null and pointStatus != ''">and b.point_status like concat('%', #{pointStatus}, '%') </if>
</where>
<if test="abnormal == 0"> ORDER BY d.device_name,a.device_name </if>
<if test="abnormal == 1"> ORDER BY b.point_status </if>
<if test="abnormal == 0">ORDER BY d.device_name,a.device_name</if>
<if test="abnormal == 1">ORDER BY b.point_status</if>
</select>
@ -387,7 +404,7 @@
<if test="deviceTypeName != null and deviceTypeName != ''">and e.device_type_name like
concat('%',#{deviceTypeName},'%')
</if>
<if test="deviceId != null and deviceId != ''"> and a.device_id =#{deviceId} </if>
<if test="deviceId != null and deviceId != ''">and a.device_id =#{deviceId}</if>
<if test="mainId != null and mainId != ''">and a.main_id =#{mainId}</if>
<if test="taskName != null and taskName != ''">and a.task_name like concat('%',#{taskName},'%')</if>
</where>
@ -457,7 +474,8 @@
from basedata_patrolpoint a
left join basedata_alg_subtype b on a.alg_subtype_ids = b.alg_subtype_id
left join basedata_alg c on b.alg_id = c.alg_id
where CONVERT(a.patrol_point_id, CHAR) = #{lineId} OR a.patrol_point_code LIKE concat('%',#{lineId})
where CONVERT(a.patrol_point_id, CHAR) = #{lineId}
OR a.patrol_point_code LIKE concat('%', #{lineId})
</select>
<select id="selectAlgorithmInfo" parameterType="String" resultType="java.util.Map">
select *
@ -580,7 +598,8 @@
d.area_name as jg_name,
e.area_name
from patrol_result f
left join basedata_patrolpoint a on f.device_id = a.patrol_point_id OR f.device_name = a.patrol_point_name
left join basedata_patrolpoint a
on f.device_id = a.patrol_point_id OR f.device_name = a.patrol_point_name
left join basedata_device b on a.device_id = b.device_id and b.power_main_equ_flag = "no"
left join basedata_device c on b.parent_id = c.device_id
left join basedata_area d on c.area_id = d.area_id and d.area_type = 'bayunit'
@ -858,4 +877,75 @@
where task_code = #{taskCode}
and to_days(create_time) = to_days(#{createTime})
</select>
<resultMap type="com.inspect.partrolresult.domain.BasedataEqpBookChannel" id="channelResultMap">
<result property="channelName" column="channel_name"/>
</resultMap>
<select id="selectChannelName" parameterType="java.lang.String"
resultMap="channelResultMap">
select channel_name channel_name
from basedata_eqpbook_channel
where channel_code = #{channelCode}
</select>
<resultMap type="com.inspect.partrolresult.domain.InspectionPointResultVo" id="InspectionPointResultMap">
<result property="id" column="id"/>
<!-- <result property="deviceName" column="device_name"/>-->
<result property="patroldeviceCode" column="patrol_device_code"/>
<result property="patroldeviceName" column="patrol_device_name"/>
<result property="taskCode" column="task_code"/>
<result property="taskName" column="task_name"/>
<result property="taskPatrolledId" column="task_patrolled_id"/>
<result property="deviceId" column="device_id"/>
<result property="deviceName" column="device_name"/>
<result property="mainDevId" column="main_dev_id"/>
<result property="mainDevName" column="main_dev_name"/>
<result property="componentId" column="component_name"/>
<result property="componentName" column="component_id"/>
<result property="value" column="value"/>
<result property="unit" column="unit"/>
<result property="recognitionType" column="recognition_type"/>
<result property="time" column="time"/>
<result property="fileType" column="file_type"/>
<result property="filePath" column="file_path"/>
<result property="baseFilePath" column="base_file_path"/>
<result property="rectangle" column="rectangle"/>
<result property="alarmLevel" column="alarm_level"/>
<result property="alarmType" column="alarm_type"/>
<result property="content" column="content"/>
<result property="resultType" column="result_type"/>
</resultMap>
<select id="inspectResult" parameterType="com.inspect.partrolresult.domain.InspectionPointParam" resultMap="InspectionPointResultMap">
SELECT pr.line_id id,
pr.task_code task_code,
pr.task_name task_name,
pr.task_patrolled_id task_patrolled_id,
pr.device_id,
pr.device_name,
bd.device_name AS component_name,
bd.device_id AS component_id,
pr.value,
pr.unit,
pr.recognition_type,
pr.time,
pr.file_type,
pr.file_path,
pr.file_path base_file_path,
pr.rectangle,
ra.result_type,
ra.description content
FROM patrol_result pr
LEFT JOIN result_analysis ra on pr.line_id = ra.business_id
LEFT JOIN basedata_patrolpoint bp ON pr.device_id = bp.patrol_point_id
LEFT JOIN basedata_device bd ON bp.device_id = bd.device_id
<where>
<if test="startTime != null ">and pr.time &gt;= #{startTime}</if>
<if test="endTime != null ">and pr.time &lt;= #{endTime}</if>
<if test="deviceId != null ">and pr.device_id = #{deviceId}</if>
<if test="taskPatrolledId != null ">and pr.task_patrolled_id = #{taskPatrolledId}</if>
<if test="componentId != null ">and bd.device_id = #{componentId}</if>
<if test="resultType != null ">and ra.result_type = #{resultType}</if>
</where>
LIMIT #{pageSize} OFFSET #{offset}
</select>
</mapper>

Loading…
Cancel
Save