ycl-pojo/src/main/java/com/ycl/platform/domain/entity/YwPoint.java
@@ -42,6 +42,10 @@ @ApiModelProperty("运维单位") @TableField(value = "unit_id") private Long unitId; //是否参与考核 @ApiModelProperty("考核状态") @TableField("examine_status") private Boolean examineStatus; @ApiModelProperty("运维状态") @TableField("status") ycl-server/src/main/java/com/ycl/api/YS/YSInit.java
@@ -36,17 +36,17 @@ System.out.printf("Initialize failed:%d", netdevsdk.NETDEV_GetLastError()); return; } // try { // Common.updateStructureByReferenceMethod = Structure.class.getDeclaredMethod("updateStructureByReference", Class.class, Structure.class, Pointer.class); // Common.updateStructureByReferenceMethod.setAccessible(true); // } catch (Exception e) { // throw new RuntimeException(e); // } try { Common.updateStructureByReferenceMethod = Structure.class.getDeclaredMethod("updateStructureByReference", Class.class, Structure.class, Pointer.class); Common.updateStructureByReferenceMethod.setAccessible(true); } catch (Exception e) { throw new RuntimeException(e); } // File file=new File(strPicturePath); // if(!file.exists()){ // file.mkdir(); // } File file=new File(strPicturePath); if(!file.exists()){ file.mkdir(); } NetDEVSDKLib.NETDEV_REV_TIMEOUT_S pstRevTimeout=new NetDEVSDKLib.NETDEV_REV_TIMEOUT_S(); pstRevTimeout.dwRevTimeOut=3; ycl-server/src/main/java/com/ycl/config/RestTemplateConfig.java
@@ -2,18 +2,22 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.client.SimpleClientHttpRequestFactory; import org.springframework.web.client.RestTemplate; /** * @author xp * @date 2022/11/16 * 设置RestTemplate超时时间,单位:毫秒 * 如这里设置为5s */ @Configuration public class RestTemplateConfig { @Bean public RestTemplate restTemplate() { return new RestTemplate(); SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory(); requestFactory.setConnectTimeout(1000 * 5); requestFactory.setReadTimeout(1000 * 5); return new RestTemplate(requestFactory); } } ycl-server/src/main/java/com/ycl/platform/service/impl/WorkOrderServiceImpl.java
@@ -209,7 +209,7 @@ SysConfig normal = configMapper.checkConfigKeyUnique("normal.wordkorder.alarm.time"); // 如果即将生成工单,但是设备国标码查不到点位,则不添加? List<WorkOrder> notAddList = new ArrayList<>(); //查redis今日工单数量 //TODO:查redis今日工单数量 int workOrderNum = 0; //UUID作为value,保证上锁的线程自己解锁 String requestId = IdUtils.fastSimpleUUID(); @@ -766,11 +766,15 @@ public synchronized String getFrameImgByDevice(String deviceId, String channelId, String workOrderNo) throws Exception { String url = String.format(this.rtspServer + "/api/play/start/img/%s/%s", deviceId, channelId); String result = HttpUtils.sendGet(url); JSONObject jsonObject = JSON.parseObject(result); Object imgUrl = jsonObject.get("data"); imgUrl = Objects.isNull(imgUrl) ? "" : imgUrl; log.info("拿到取流图片响应结果:" + imgUrl); return (String) imgUrl; log.info("拿到取流图片响应结果:" + result); WVPResult wvpResult = JSON.parseObject(result, WVPResult.class); if(wvpResult.getCode() == 0) { Object imgUrl = (Object) wvpResult.getData(); imgUrl = Objects.isNull(imgUrl) ? "" : imgUrl; log.info("拿到取流图片:" + imgUrl); return (String) imgUrl; } return null; // WVPResult wvpResult = JSON.parseObject(result, WVPResult.class); // String imgUrl = null; // if (wvpResult.getCode() == 0) { ycl-server/src/main/java/com/ycl/platform/service/impl/YwPointServiceImpl.java
@@ -37,6 +37,7 @@ import constant.PointHeaderConstant; import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -60,6 +61,7 @@ */ @Service @RequiredArgsConstructor @Slf4j public class YwPointServiceImpl extends ServiceImpl<YwPointMapper, YwPoint> implements YwPointService { private final SysDeptMapper sysDeptMapper; ycl-server/src/main/java/com/ycl/task/MonitorTask.java
@@ -63,16 +63,16 @@ //同步点位在线率到mongo(弃用) public void siteOnline() { // log.info("开始同步点位在线率到mongo"); // List<TMonitorResult> tMonitorResults = monitorMapper.selectMonitorResult(null); // if (!CollectionUtils.isEmpty(tMonitorResults)) { // //如果存在之前的数据先删除 // Query query = new Query(Criteria.where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); // DeleteResult result = mongoTemplate.remove(query, TMonitorResult.class); // //存放在mongo中 // mongoTemplate.insertAll(tMonitorResults); // log.info("结束同步点位在线率到mongo"); // } log.info("开始同步点位在线率到mongo"); List<TMonitorResult> tMonitorResults = monitorMapper.selectMonitorResult(null); if (!CollectionUtils.isEmpty(tMonitorResults)) { //如果存在之前的数据先删除 Query query = new Query(Criteria.where("mongoCreateTime").gte(DateUtils.getDayStart(new Date())).lt(DateUtils.getDayEnd(new Date()))); DeleteResult result = mongoTemplate.remove(query, TMonitorResult.class); //存放在mongo中 mongoTemplate.insertAll(tMonitorResults); log.info("结束同步点位在线率到mongo"); } } //同步mongodb一机一档到数据库 @@ -101,8 +101,7 @@ List<TMonitor> monitorList = new ArrayList<>(); //准备插入点位表的数据 List<YwPoint> ywPointList = new ArrayList<>(); //新的数据,原数据库中不存在的数据 Set<TMonitor> newMonitorList = new HashSet<>(); //全年留存 for (MonitorQualifyResult result : oneMachineFileResults) { @@ -110,10 +109,6 @@ YwPoint point = getPoint(result, pointMap, importantSite); monitorList.add(monitor); ywPointList.add(point); //比对筛选出新的数据 if (!CollectionUtils.isEmpty(monitorVOMap) && !monitorVOMap.containsKey(result.getSerialNumber().getValue())) { newMonitorList.add(monitor); } } //添加老数据 List<String> numbers = CollectionUtils.isEmpty(monitorList) ? new ArrayList<>() : monitorList.stream().map(TMonitor::getSerialNumber).collect(Collectors.toList()); @@ -131,7 +126,9 @@ }); List<String> points = CollectionUtils.isEmpty(ywPointList) ? new ArrayList<>() : ywPointList.stream().map(YwPoint::getSerialNumber).collect(Collectors.toList()); pointMap.forEach((key, value) -> { //老设备状态改为不参与考核 if (!points.contains(key)) { value.setExamineStatus(Boolean.FALSE); ywPointList.add(value); } }); @@ -165,6 +162,8 @@ ywPoint.setCreateTime(new Date()); ywPoint.setUpdateTime(new Date()); } //状态设置为考核设备 ywPoint.setExamineStatus(Boolean.TRUE); //比对是否是重点点位 if (importantSite.contains(result.getSxjcjqy().getValue())) { ywPoint.setImportantTag(Boolean.TRUE); ycl-server/src/main/java/com/ycl/task/UYTask.java
@@ -174,6 +174,7 @@ /** * 点位在线检测 */ //TODO:视频离线次数、监测次数 public void pointOnline() throws ExecutionException, InterruptedException { log.info("开始检测点位在线"); Integer times = 2; @@ -203,16 +204,15 @@ OnlineCheckThread thread = new OnlineCheckThread(monitor, checkPointUtil, time); return thread.call(); // 假设 OnlineCheckThread 实现了 Callable 接口 }, executorService) .orTimeout(30, TimeUnit.SECONDS) .orTimeout(40, TimeUnit.SECONDS) .exceptionally(ex -> { if (ex instanceof TimeoutException) { log.error("任务执行超时:"); log.error("任务执行超时:"+monitor.getIp()); } else { log.error("任务执行异常:" + ex); log.error("任务执行异常:"+monitor.getIp() + ex); } int checkTimes = 1; int offLineTimes = 1; //TODO:BUG Map<String, Object> map = (Map<String, Object>) redisTemplate.opsForHash().get(RedisConstant.ONLINE_KEY, monitor.getIp()); if (!CollectionUtils.isEmpty(map)) { checkTimes = (Integer) map.get("checkTimes") + 1; ycl-server/src/main/java/com/ycl/task/WorkOrderImgTask.java
@@ -57,44 +57,6 @@ // ); public void run() throws FFmpegFrameGrabber.Exception { // String rtspUrl = "http://www.w3school.com.cn/i/movie.mp4"; // if (StringUtils.hasText(rtspUrl)) { // FFmpegFrameGrabber grabber = FFmpegFrameGrabber.createDefault(rtspUrl); // try { //// grabber.setOption("rtsp_transport", "tcp"); // 使用tcp的方式,不然会丢包很严重 // grabber.setImageWidth(1920); // grabber.setImageHeight(1080); // grabber.setFrameRate(25); // grabber.start(); // System.out.println("成功"); // Frame frame = grabber.grabImage(); // String imgUrl = null; // if (frame != null) { // System.out.println("成功2"); // //转换图像 // Java2DFrameConverter converter = new Java2DFrameConverter(); // BufferedImage srcImage = converter.getBufferedImage(frame); // System.out.println(srcImage); // if (srcImage != null) { // imgUrl = IdUtils.fastSimpleUUID() + ".png"; // // 生成图片路径 // String imgPath = "/" + imgUrl; // System.out.println("图片保存地址:" + imgPath); //// imgUrl = Constants.RESOURCE_PREFIX + "/" + imgUrl; // //创建文件 // File file = new File("D:\\Codes\\zgyw\\"+imgUrl); // //输出文件 // ImageIO.write(srcImage, "png", file); // } // } // } catch (IOException e) { // e.printStackTrace(); // } finally { // grabber.stop(); // 停止捕获 //// grabber.close(); // 释放资源 // } // } // 查出最近一周的故障的设备 Date now = new Date(); Calendar ca = Calendar.getInstance(); ycl-server/src/main/java/com/ycl/utils/CheckPointUtil.java
@@ -48,7 +48,7 @@ */ public TMonitorResult check(TMonitorResult monitor) { // 先检测能否访问该ip的网页 ResponseEntity<Object> res = null; ResponseEntity<String> res = null; log.info("监测IP:" + monitor.getIp()); String prefix = "http://"; if ("127.0.0.1".equals(monitor.getIp())) { @@ -115,9 +115,10 @@ } boolean webReachable = false; try { ResponseEntity<Object> res = selfHttpUtil.get(prefix + checkUtil.getIp(), null, null); ResponseEntity<String> res = selfHttpUtil.get(prefix + checkUtil.getIp(), null, null); webReachable = Objects.nonNull(res) && HttpStatus.OK == res.getStatusCode(); } catch (Exception e) { log.info("检测web异常"+e.getMessage()); webReachable = Boolean.FALSE; } // ping @@ -130,22 +131,22 @@ } catch (IOException e) { e.printStackTrace(); } String imgUrl = ""; // 查出国标设备,就一条数据 List<DeviceInfo> gbDevices = new LambdaQueryChainWrapper<>(deviceInfoMapper) .orderByDesc(DeviceInfo::getUpdateTime) .last("limit 1") .list(); if (! CollectionUtils.isEmpty(gbDevices)) { try { imgUrl = workOrderService.getFrameImgByDevice(gbDevices.get(0).getDeviceId(), checkUtil.getSerialNumber(), IdUtils.workOrderNO(new Date(), "99999")); result.setImg(imgUrl); } catch (Exception e) { e.printStackTrace(); if(pingReachable || webReachable) { // 查出国标设备,就一条数据 List<DeviceInfo> gbDevices = new LambdaQueryChainWrapper<>(deviceInfoMapper) .orderByDesc(DeviceInfo::getUpdateTime) .last("limit 1") .list(); if (!CollectionUtils.isEmpty(gbDevices)) { try { imgUrl = workOrderService.getFrameImgByDevice(gbDevices.get(0).getDeviceId(), checkUtil.getSerialNumber(), IdUtils.workOrderNO(new Date(), "99999")); result.setImg(imgUrl); } catch (Exception e) { e.printStackTrace(); } } } String status = ""; if (! webReachable) { status += "设备web访问失败;"; @@ -155,6 +156,9 @@ } if (StringUtils.isEmpty(imgUrl)) { status += "未获取到图片"; } if (StringUtils.isEmpty(status)) { status += "设备正常"; } result.setStatus(status); return result; @@ -187,6 +191,8 @@ String status = ""; if (! pingReachable) { status += "ip未ping通;"; }else { status += "成功"; } result.setStatus(status); return result; ycl-server/src/main/java/com/ycl/utils/http/SelfHttpUtil.java
@@ -1,14 +1,23 @@ package com.ycl.utils.http; import lombok.RequiredArgsConstructor; import org.apache.http.client.HttpClient; import org.apache.http.client.config.RequestConfig; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.lang.Nullable; import org.springframework.stereotype.Component; import org.springframework.util.MultiValueMap; import org.springframework.web.client.RestTemplate; import java.util.Collections; import java.util.Map; /** * @author xp @@ -18,7 +27,8 @@ @RequiredArgsConstructor public class SelfHttpUtil { private final RestTemplate httpClient; private final RestTemplate restTemplate; /** * post @@ -29,7 +39,7 @@ * @return */ public Object post(String url, @Nullable Object data, @Nullable MultiValueMap header) { ResponseEntity<Object> response = httpClient.exchange( ResponseEntity<Object> response = restTemplate.exchange( url, HttpMethod.POST, getHttpEntity(data, header), @@ -45,7 +55,7 @@ * @return */ public Object post(String url, String token, @Nullable Object data) { ResponseEntity<Object> response = httpClient.exchange( ResponseEntity<Object> response = restTemplate.exchange( url, HttpMethod.POST, getHttpEntity(data, token), @@ -81,12 +91,15 @@ * @param params * @return */ public ResponseEntity<Object> get(String url, @Nullable MultiValueMap header, @Nullable Object... params) { ResponseEntity<Object> response = httpClient.exchange( public ResponseEntity<String> get(String url, @Nullable MultiValueMap header, @Nullable Map<String, Object> params) { if (params == null) { params = Collections.emptyMap(); } ResponseEntity<String> response = restTemplate.exchange( url, HttpMethod.GET, getHttpEntity(null, header), Object.class, String.class, params ); return response; ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
@@ -111,6 +111,7 @@ ) w on m.serial_number = w.serial_number and w.deleted = 0 left join t_yw_unit u on p.unit_id = u.id and u.deleted = 0 <where> p.examine_status = 1 <if test="serialNumber != null and serialNumber != ''">and m.serial_number = #{serialNumber}</if> <if test="name != null and name != ''"> and (name like concat('%', #{name}, '%') @@ -345,7 +346,7 @@ left join t_yw_point p on m.serial_number = p.serial_number left join sys_dept d on p.dept_id = d.dept_id and d.del_flag = 0 <where> camera_fun_type like concat('%', #{cameraFunType}, '%') camera_fun_type like concat('%', #{cameraFunType}, '%') and p.examine_status = 1 <if test="provinceTag!=null"> and p.province_tag = #{provinceTag} </if> @@ -365,6 +366,7 @@ LEFT JOIN t_yw_point p ON t.serial_number = p.serial_number left join sys_dept d on p.dept_id = d.dept_id and d.del_flag = 0 <where> p.examine_status = 1 <!-- (p.recovery = 1 OR TIMESTAMPDIFF(DAY, p.recovery_time, NOW()) <![CDATA[<=]]> #{time}) --> <if test="provinceTag!=null"> and p.province_tag = #{provinceTag} @@ -438,8 +440,8 @@ COUNT(p2.id) AS errorNum, COUNT(p1.id) - COUNT(p2.id) AS normalNum FROM t_monitor LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number <if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.dept_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if> LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.online = 0 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if> LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number AND p1.examine_status = 1<if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.dept_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if> LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.examine_status = 1 AND p2.online = 0 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if> WHERE INSTR(camera_fun_type, 1) UNION ALL SELECT @@ -448,8 +450,8 @@ COUNT(p2.id) AS errorNum, COUNT(p1.id) - COUNT(p2.id) AS normalNum FROM t_monitor LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number <if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.dept_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if> LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.online = 0 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = '1' </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if> LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number AND p1.examine_status = 1 <if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.dept_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if> LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.examine_status = 1 AND p2.online = 0 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = '1' </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if> WHERE INSTR(camera_fun_type, 2) UNION ALL SELECT @@ -458,8 +460,8 @@ COUNT(p2.id) AS errorNum, COUNT(p1.id) - COUNT(p2.id) AS normalNum FROM t_monitor LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number <if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.dept_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if> LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.online = 0 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if> LEFT JOIN t_yw_point p1 ON t_monitor.serial_number = p1.serial_number AND p1.examine_status = 1 <if test="dataScope == 1"> AND p1.province_tag = 1 </if><if test="dataScope == 3"> AND p1.dept_tag = 1 </if><if test="deptId != null"> AND p1.dept_id = #{deptId} </if> LEFT JOIN t_yw_point p2 ON t_monitor.serial_number = p2.serial_number AND p2.examine_status = 1 AND p2.online = 0 AND p1.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if><if test="deptId != null"> AND p2.dept_id = #{deptId} </if> WHERE INSTR(camera_fun_type, 3) </select> <select id="monitorRate" resultType="com.ycl.platform.domain.vo.screen.MonitorRateVO"> @@ -475,8 +477,8 @@ COUNT(m2.id) AS faceErrorNum FROM sys_dept d LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.dept_tag = 1 </if> LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.online = 0 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if> LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 AND p.examine_status = 1 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.dept_tag = 1 </if> LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.online = 0 AND p2.examine_status = 1 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if> LEFT JOIN t_monitor m ON m.serial_number = p.serial_number AND INSTR(m.camera_fun_type, 3) LEFT JOIN t_monitor m2 ON m2.serial_number = p2.serial_number AND INSTR(m2.camera_fun_type, 3) WHERE d.del_flag = 0 AND d.area IS NOT NULL @@ -493,8 +495,8 @@ COUNT(m2.id) AS carErrorNum FROM sys_dept d LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.dept_tag = 1 </if> LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.online = 0 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if> LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 AND p.examine_status = 1 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.dept_tag = 1 </if> LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.examine_status = 1 AND p2.online = 0 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if> LEFT JOIN t_monitor m ON m.serial_number = p.serial_number AND INSTR(m.camera_fun_type, 2) LEFT JOIN t_monitor m2 ON m2.serial_number = p2.serial_number AND INSTR(m2.camera_fun_type, 2) WHERE d.del_flag = 0 AND d.area IS NOT NULL @@ -511,8 +513,8 @@ COUNT(m2.id) AS videoErrorNum FROM sys_dept d LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.dept_tag = 1 </if> LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.online = 0 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if> LEFT JOIN t_yw_point p ON p.dept_id = d.dept_id AND p.deleted = 0 AND p.examine_status = 1 <if test="dataScope == 1"> AND p.province_tag = 1 </if><if test="dataScope == 3"> AND p.dept_tag = 1 </if> LEFT JOIN t_yw_point p2 ON p2.dept_id = d.dept_id AND p2.deleted = 0 AND p2.examine_status = 1 AND p2.online = 0 AND p.id = p2.id <if test="dataScope == 1"> AND p2.province_tag = 1 </if><if test="dataScope == 3"> AND p2.dept_tag = 1 </if> LEFT JOIN t_monitor m ON m.serial_number = p.serial_number AND INSTR(m.camera_fun_type, 1) LEFT JOIN t_monitor m2 ON m2.serial_number = p2.serial_number AND INSTR(m2.camera_fun_type, 1) WHERE d.del_flag = 0 AND d.area IS NOT NULL ycl-server/src/main/resources/mapper/zgyw/YwPointMapper.xml
@@ -80,6 +80,7 @@ LEFT JOIN t_yw_unit tyu ON typ.unit_id = tyu.id AND tyu.deleted = 0 LEFT JOIN sys_dept sd ON typ.dept_id = sd.dept_id AND sd.del_flag = 0 <where> typ.examine_status = 1 <if test="query.pointName != null and query.pointName != ''"> AND typ.point_name like concat('%', #{query.pointName}, '%') </if> @@ -238,6 +239,7 @@ INNER JOIN t_monitor m ON yp.serial_number = m.serial_number LEFT JOIN t_yw_unit yu ON yu.id = yp.unit_id <where> yp.examine_status = 1 <if test="query.pointName != null and query.pointName != ''"> AND m.name like concat('%', #{query.pointName} ,'%') </if>