From 92961b33e531ae3f61ec908252081bfe679d3300 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期一, 04 十一月 2024 15:08:18 +0800
Subject: [PATCH] 考核积分导出

---
 ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml                 |    9 +---
 ycl-server/src/main/java/com/ycl/calculate/CarConsistentCalculation.java          |    5 ++
 ycl-server/src/main/java/com/ycl/calculate/CarClockAccuracyCalculation.java       |    4 ++
 ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml                |    9 +---
 ycl-server/src/main/java/com/ycl/calculate/IndexCalculationUtils.java             |   15 ++++++-
 ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityMapper.xml         |    2 
 ycl-server/src/main/resources/mapper/zgyw/YwPointMapper.xml                       |   14 ++++++
 ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java             |    2 +
 ycl-server/src/main/java/com/ycl/task/CheckScoreTask.java                         |   20 +++++++---
 ycl-server/src/main/java/com/ycl/platform/mapper/YwPointMapper.java               |    9 ++++
 ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java |   13 ------
 ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml               |    9 +---
 ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml                      |    2 
 13 files changed, 67 insertions(+), 46 deletions(-)

diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java
index d8bea2b..d3a75e7 100644
--- a/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java
+++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/entity/CheckScore.java
@@ -37,6 +37,8 @@
     private Long deptId;
     @TableField(exist = false)
     private String deptName;
+    //璁惧鏁伴噺
+    private Integer deviceCount;
     /** 鑰冩牳妯℃澘id */
     @Excel(name = "鑰冩牳妯℃澘id")
     private Integer templateId;
diff --git a/ycl-server/src/main/java/com/ycl/calculate/CarClockAccuracyCalculation.java b/ycl-server/src/main/java/com/ycl/calculate/CarClockAccuracyCalculation.java
index baffec9..01dfdd3 100644
--- a/ycl-server/src/main/java/com/ycl/calculate/CarClockAccuracyCalculation.java
+++ b/ycl-server/src/main/java/com/ycl/calculate/CarClockAccuracyCalculation.java
@@ -1,9 +1,12 @@
 package com.ycl.calculate;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.ycl.platform.domain.entity.CheckIndexCar;
+import com.ycl.platform.domain.entity.YwPoint;
 import com.ycl.platform.domain.result.HK.VehicleDeviceInspectionResult;
 import com.ycl.platform.mapper.CheckIndexCarMapper;
 import com.ycl.platform.mapper.TMonitorMapper;
+import com.ycl.platform.mapper.YwPointMapper;
 import com.ycl.platform.service.ICheckIndexCarService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -15,6 +18,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * 璁$畻杞﹁締鏃堕挓鍑嗙‘鎬�
diff --git a/ycl-server/src/main/java/com/ycl/calculate/CarConsistentCalculation.java b/ycl-server/src/main/java/com/ycl/calculate/CarConsistentCalculation.java
index 09fa8de..8e82608 100644
--- a/ycl-server/src/main/java/com/ycl/calculate/CarConsistentCalculation.java
+++ b/ycl-server/src/main/java/com/ycl/calculate/CarConsistentCalculation.java
@@ -1,8 +1,11 @@
 package com.ycl.calculate;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.ycl.platform.domain.entity.CheckIndexCar;
+import com.ycl.platform.domain.entity.YwPoint;
 import com.ycl.platform.domain.result.UY.MonitorQualifyResult;
 import com.ycl.platform.mapper.CheckIndexCarMapper;
+import com.ycl.platform.mapper.YwPointMapper;
 import com.ycl.platform.service.ICheckIndexCarService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -27,7 +30,6 @@
     private CheckIndexCarMapper checkIndexCarMapper;
     @Autowired
     private ICheckIndexCarService checkIndexCarService;
-
     //鍖哄煙杞﹁締鐩綍涓�鑷寸巼鐨勫唴閮ㄧ被
     protected static class AreaStats {
         int totalSites = 0;
@@ -42,6 +44,7 @@
 
         // 鏌ヨ鏄惁index琛ㄥ凡缁忓瓨鍦ㄤ粖鏃ユ暟鎹�
         List<CheckIndexCar> checkIndexCarList = checkIndexCarMapper.selectToday(DateUtils.getDate());
+
         List<CheckIndexCar> checkIndexCars = new ArrayList<>();
         areaStatsMap.forEach((deptId, stats) -> {
             if (stats.totalSites > 0) {
diff --git a/ycl-server/src/main/java/com/ycl/calculate/IndexCalculationUtils.java b/ycl-server/src/main/java/com/ycl/calculate/IndexCalculationUtils.java
index 95bc918..51343fe 100644
--- a/ycl-server/src/main/java/com/ycl/calculate/IndexCalculationUtils.java
+++ b/ycl-server/src/main/java/com/ycl/calculate/IndexCalculationUtils.java
@@ -1,10 +1,16 @@
 package com.ycl.calculate;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.ycl.platform.base.CheckIndex;
+import com.ycl.platform.domain.entity.YwPoint;
+import com.ycl.platform.mapper.YwPointMapper;
 import constant.ApiConstants;
 import constant.CheckConstants;
 import enumeration.general.PublishType;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
@@ -12,14 +18,15 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
+import java.util.stream.Collectors;
 
 
 @Slf4j
 public class IndexCalculationUtils {
+
     //妫�鏌ユ槸鍚﹀瓨鍦ㄥ綋鏃ユ暟鎹�
     public <T extends CheckIndex> T getCheckIndex(String key, List<T> checkIndexList, Class<T> clazz) {
         T checkIndex;
-
         // 妫�鏌ユ槸鍚﹀凡瀛樺湪浠婃棩鏁版嵁
         Optional<T> existingIndex = checkIndexList.stream()
                 .filter(index -> key.startsWith(ApiConstants.Province) ?
@@ -46,7 +53,9 @@
         return checkIndex;
     }
 
-    /** --------鎸囨爣绠楁硶---------*/
+    /**
+     * --------鎸囨爣绠楁硶---------
+     */
 
     //涓�鏈轰竴妗e悎鏍肩巼
     public BigDecimal monitorQualify(Map<String, Object> param) {
@@ -110,7 +119,7 @@
     public BigDecimal viewConnectStability(Map<String, Object> param) {
         BigDecimal totalDataSum = new BigDecimal((Integer) param.get("totalDataSum"));
         BigDecimal lastCount = (BigDecimal) param.get("lastCount");
-        log.info("瑙嗗浘搴撳鎺ョǔ瀹氭�э紝totalDataSum锛歿}锛宭astCount锛歿}",totalDataSum,lastCount);
+        log.info("瑙嗗浘搴撳鎺ョǔ瀹氭�э紝totalDataSum锛歿}锛宭astCount锛歿}", totalDataSum, lastCount);
         return totalDataSum.divide(lastCount, 4, RoundingMode.HALF_UP);
     }
 
diff --git a/ycl-server/src/main/java/com/ycl/platform/mapper/YwPointMapper.java b/ycl-server/src/main/java/com/ycl/platform/mapper/YwPointMapper.java
index bc2ce19..89c1ff0 100644
--- a/ycl-server/src/main/java/com/ycl/platform/mapper/YwPointMapper.java
+++ b/ycl-server/src/main/java/com/ycl/platform/mapper/YwPointMapper.java
@@ -123,4 +123,13 @@
      * @return
      */
     Integer distinctCount(@Param("query") DataCenterQuery query);
+
+    /**
+     * 璁惧鏁伴噺
+     * @param examineCategory
+     * @param examineTag
+     * @return
+     */
+    List<YwPointVO> selectToCount(Short examineCategory, Short examineTag);
+
 }
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java
index 82c2ad2..496430d 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java
@@ -322,9 +322,7 @@
             //鏉冮檺鎺у埗 鍙兘鏌ョ湅宸插彂甯�
             roleControl(checkIndexCar);
             checkIndexCar.setExamineTag(Short.valueOf(examineTag + ""));
-            if (examineTag == 0) {
-                checkIndexCar.setProvinceTag(Boolean.TRUE);
-            }
+
             checkIndexCars.addAll(indexCarService.selectCheckIndexCarList(checkIndexCar));
         }
         //璁$畻骞冲潎鍊兼斁鍦╡xcel鏈�鍚�
@@ -372,9 +370,6 @@
             //鏉冮檺鎺у埗 鍙兘鏌ョ湅宸插彂甯�
             roleControl(checkIndexFace);
             checkIndexFace.setExamineTag(Short.valueOf(examineTag + ""));
-            if (examineTag == 0) {
-                checkIndexFace.setProvinceTag(Boolean.TRUE);
-            }
             checkIndexFaces.addAll(indexFaceService.selectCheckIndexFaceList(checkIndexFace));
         }
         //璁$畻骞冲潎鍊兼斁鍦╡xcel鏈�鍚�
@@ -421,12 +416,6 @@
             //鏉冮檺鎺у埗 鍙兘鏌ョ湅宸插彂甯�
             roleControl(checkIndexVideo);
             checkIndexVideo.setExamineTag(Short.valueOf(examineTag + ""));
-            if (examineTag == 0) {
-                checkIndexVideo.setProvinceTag(Boolean.TRUE);
-            }else if(examineTag ==2){
-                //鍙湁瑙嗛鏈夊叕瀹夐儴鏁版嵁
-                checkIndexVideo.setDeptTag(Boolean.TRUE);
-            }
             checkIndexVideos.addAll(indexVideoService.selectCheckIndexVideoList(checkIndexVideo));
         }
         //璁$畻骞冲潎鍊兼斁鍦╡xcel鏈�鍚�
diff --git a/ycl-server/src/main/java/com/ycl/task/CheckScoreTask.java b/ycl-server/src/main/java/com/ycl/task/CheckScoreTask.java
index 060b61a..9b44e1c 100644
--- a/ycl-server/src/main/java/com/ycl/task/CheckScoreTask.java
+++ b/ycl-server/src/main/java/com/ycl/task/CheckScoreTask.java
@@ -4,6 +4,7 @@
 import com.google.common.base.CaseFormat;
 import com.ycl.platform.base.CheckIndex;
 import com.ycl.platform.domain.entity.*;
+import com.ycl.platform.domain.vo.YwPointVO;
 import com.ycl.platform.mapper.*;
 import com.ycl.platform.service.*;
 import constant.CheckConstants;
@@ -41,12 +42,15 @@
     private CheckIndexFaceMapper faceMapper;
     @Autowired
     private CheckIndexCarMapper carMapper;
+    @Autowired
+    private YwPointMapper pointMapper;
     //鍏畨閮ㄥ彧鏈夎棰戣�冩牳
     public void executeTemplate(Integer templateId) {
         CheckTemplate checkTemplate = templateMapper.selectCheckTemplateById(templateId);
         if (checkTemplate != null) {
             Short examineCategory = checkTemplate.getExamineCategory();
             Short examineTag = checkTemplate.getExamineTag();
+            List<YwPointVO> pointVOS= pointMapper.selectToCount(examineCategory, examineTag);
             //鏌ユ潈閲�
             CheckTemplateRule checkTemplateRule = new CheckTemplateRule();
             checkTemplateRule.setCheckTemplateId(templateId);
@@ -65,7 +69,7 @@
                 //鏍规嵁妯℃澘鐨勮�冩牳鏍囩鏌ュ悇鍖哄幙瀵瑰簲鐪佸巺鎴栧競灞�鎴栧叕瀹夐儴瑙嗛鏁版嵁
                 List<CheckIndexVideo> checkIndexVideos = videoMapper.getCheckIndexVideoList(checkIndexVideo);
                 for (CheckIndexVideo indexVideo : checkIndexVideos) {
-                    addToList(templateId, checkTemplate, examineTag, templateRuleList, scoreList, indexVideo, CheckConstants.Rule_Category_Video);
+                    addToList(templateId, checkTemplate, examineTag, templateRuleList, scoreList, indexVideo, CheckConstants.Rule_Category_Video,pointVOS);
                 }
             } else if (CheckConstants.Rule_Category_Car.equals(examineCategory)) {
                 CheckIndexCar checkIndexCar = new CheckIndexCar();
@@ -75,7 +79,7 @@
                 //鏍规嵁妯℃澘鐨勮�冩牳鏍囩鏌ュ悇鍖哄幙瀵瑰簲鐪佸巺鎴栧競灞�鎴栧叕瀹夐儴杞﹁締鏁版嵁
                 List<CheckIndexCar> checkIndexCars = carMapper.getCheckIndexCarList(checkIndexCar);
                 for (CheckIndexCar indexCar : checkIndexCars) {
-                    addToList(templateId, checkTemplate, examineTag, templateRuleList, scoreList, indexCar, CheckConstants.Rule_Category_Car);
+                    addToList(templateId, checkTemplate, examineTag, templateRuleList, scoreList, indexCar, CheckConstants.Rule_Category_Car,pointVOS);
                 }
             } else if (CheckConstants.Rule_Category_Face.equals(examineCategory)) {
                 CheckIndexFace checkIndexFace = new CheckIndexFace();
@@ -85,7 +89,7 @@
                 //鏍规嵁妯℃澘鐨勮�冩牳鏍囩鏌ュ悇鍖哄幙瀵瑰簲鐪佸巺鎴栧競灞�鎴栧叕瀹夐儴浜鸿劯鏁版嵁
                 List<CheckIndexFace> checkIndexFaces = faceMapper.getCheckIndexFaceList(checkIndexFace);
                 for (CheckIndexFace indexFace : checkIndexFaces) {
-                    addToList(templateId, checkTemplate, examineTag, templateRuleList, scoreList, indexFace, CheckConstants.Rule_Category_Face);
+                    addToList(templateId, checkTemplate, examineTag, templateRuleList, scoreList, indexFace, CheckConstants.Rule_Category_Face,pointVOS);
                 }
             }
 
@@ -109,7 +113,7 @@
         }
     }
 
-    private <T extends CheckIndex> void addToList(Integer templateId, CheckTemplate checkTemplate, Short examineTag, List<CheckTemplateRule> templateRuleList, List<CheckScore> scoreList, T indexObject, Short checkCategory) {
+    private <T extends CheckIndex> void addToList(Integer templateId, CheckTemplate checkTemplate, Short examineTag, List<CheckTemplateRule> templateRuleList, List<CheckScore> scoreList, T indexObject, Short checkCategory, List<YwPointVO> pointVOS) {
         CheckScore checkScore = new CheckScore();
         checkScore.setIndexId(indexObject.getId());
         BigDecimal scoreFinal = BigDecimal.ZERO;
@@ -118,7 +122,7 @@
             scoreFinal = getScoreFinal(indexObject, scoreFinal, templateRule);
         }
         //琛ュ厖checkScore
-        fillCheckScore(templateId, checkTemplate, examineTag, indexObject, checkScore, scoreFinal, checkCategory);
+        fillCheckScore(templateId, checkTemplate, examineTag, indexObject, checkScore, scoreFinal, checkCategory,pointVOS);
         scoreList.add(checkScore);
     }
 
@@ -142,7 +146,7 @@
     }
 
     //璁剧疆checkScore瀵硅薄
-    private void fillCheckScore(Integer templateId, CheckTemplate checkTemplate, Short examineTag, CheckIndex checkIndex, CheckScore checkScore, BigDecimal scoreFinal, Short checkCategory) {
+    private void fillCheckScore(Integer templateId, CheckTemplate checkTemplate, Short examineTag, CheckIndex checkIndex, CheckScore checkScore, BigDecimal scoreFinal, Short checkCategory, List<YwPointVO> pointVOS) {
         //鏍规嵁璋冩暣绯绘暟璋冩暣鏈�缁堝垎鏁板ぇ灏�
         String adjustWay = checkTemplate.getAdjustWay();
         BigDecimal adjustCoefficient = checkTemplate.getAdjustCoefficient();
@@ -159,5 +163,9 @@
         checkScore.setTemplateId(templateId);
         checkScore.setScore(scoreFinal);
         checkScore.setPublish(PublishType.PUBLISHED.getCode());
+        if(!CollectionUtils.isEmpty(pointVOS)) {
+            long count = pointVOS.stream().filter(ywPointVO -> checkIndex.getDeptId().equals(ywPointVO.getDeptId())).count();
+            checkScore.setDeviceCount((int) count);
+        }
     }
 }
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml
index 3ec6730..8cedd23 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexCarMapper.xml
@@ -28,17 +28,13 @@
     </sql>
 
     <select id="selectCheckIndexCarList"  resultMap="CheckIndexCarResult">
-        select tcic.*,sd.dept_name,tcs.score,count(m.serial_number) as num
+        select tcic.*,sd.dept_name,tcs.score,IFNULL(tcs.device_count,0) as num
         from t_check_index_car tcic left join sys_dept sd on tcic.dept_id = sd.dept_id
         left join t_check_score tcs on tcic.id = tcs.index_id
-        left join t_yw_point p on p.dept_id = tcic.dept_id and p.examine_status = 1
-        left join t_monitor m on p.serial_number = m.serial_number
         <where>
-            tcs.examine_category = 2 and m.camera_fun_type like concat('%',2,'%')
+            tcs.examine_category = 2
             <if test="deptId != null "> and tcic.dept_id = #{deptId}</if>
             <if test="examineTag != null "> and tcic.examine_tag = #{examineTag}</if>
-            <if test="provinceTag != null "> and p.province_tag = #{provinceTag}</if>
-            <if test="deptTag != null "> and p.dept_tag = #{deptTag}</if>
             <if test="quarter != null and quarter.size > 0">
                 and date_format(tcs.create_time, '%Y-%m') between #{quarter[0]} and #{quarter[1]}
             </if>
@@ -51,7 +47,6 @@
                 </foreach>
             </if>
         </where>
-        group by tcic.id
         order by tcic.examine_tag desc,sd.area_code,tcic.create_time
     </select>
 
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml
index fad7608..e3e9c64 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexFaceMapper.xml
@@ -26,17 +26,13 @@
     </sql>
 
     <select id="selectCheckIndexFaceList"  resultMap="CheckIndexFaceResult">
-        select tcif.*,sd.dept_name,tcs.score,count(m.serial_number) as num
+        select tcif.*,sd.dept_name,tcs.score,IFNULL(tcs.device_count,0) as num
         from t_check_index_face tcif left join sys_dept sd on tcif.dept_id = sd.dept_id
         left join t_check_score tcs on tcif.id = tcs.index_id
-        left join t_yw_point p on p.dept_id = tcif.dept_id  and p.examine_status = 1
-        left join t_monitor m on p.serial_number = m.serial_number
         <where>
-            tcs.examine_category = 3 and m.camera_fun_type like concat('%',3,'%')
+            tcs.examine_category = 3
             <if test="deptId != null "> and tcif.dept_id = #{deptId}</if>
             <if test="examineTag != null "> and tcif.examine_tag = #{examineTag}</if>
-            <if test="provinceTag != null "> and p.province_tag = #{provinceTag}</if>
-            <if test="deptTag != null "> and p.dept_tag = #{deptTag}</if>
             <if test="quarter != null and quarter.size > 0">
                 and date_format(tcs.create_time, '%Y-%m') between #{quarter[0]} and #{quarter[1]}
             </if>
@@ -49,7 +45,6 @@
                 </foreach>
             </if>
         </where>
-        group by tcif.id
         order by tcif.examine_tag desc,sd.area_code,tcif.create_time
     </select>
 
diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml
index 07b9525..8a086c3 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CheckIndexVideoMapper.xml
@@ -32,17 +32,13 @@
     </sql>
 
     <select id="selectCheckIndexVideoList" parameterType="CheckIndexVideo" resultMap="CheckIndexVideoResult">
-        select tciv.*,sd.dept_name,tcs.score,count(m.serial_number) as num
+        select tciv.*,sd.dept_name,tcs.score,IFNULL(tcs.device_count,0) as num
         from t_check_index_video tciv left join sys_dept sd on tciv.dept_id = sd.dept_id
         left join t_check_score tcs on tciv.id = tcs.index_id
-        left join t_yw_point p on p.dept_id = tciv.dept_id  and p.examine_status = 1
-        left join t_monitor m on p.serial_number = m.serial_number
         <where>
-            tcs.examine_category = 1 and m.camera_fun_type like concat('%',1,'%')
+            tcs.examine_category = 1
             <if test="deptId != null "> and tciv.dept_id = #{deptId}</if>
             <if test="examineTag != null "> and tciv.examine_tag = #{examineTag}</if>
-            <if test="provinceTag != null "> and p.province_tag = #{provinceTag}</if>
-            <if test="deptTag != null "> and p.dept_tag = #{deptTag}</if>
             <if test="quarter != null and quarter.size > 0">
                 and date_format(tcs.create_time, '%Y-%m') between #{quarter[0]} and #{quarter[1]}
             </if>
@@ -56,7 +52,6 @@
             </foreach>
             </if>
         </where>
-        group by tciv.id
         order by tciv.examine_tag desc,sd.area_code,tciv.create_time
     </select>
     <select id="getCheckIndexVideoList" parameterType="CheckIndexVideo" resultMap="CheckIndexVideoResult">
diff --git a/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityMapper.xml
index 10404c6..1b67217 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/ImageResourceSecurityMapper.xml
@@ -103,7 +103,7 @@
     </delete>
     <select id="getLatest" resultType="com.ycl.platform.domain.entity.ImageResourceSecurity">
         select * from t_image_resource_security where dept_id = #{deptId}
-        where date_format(create_time,'%Y-%m')  = DATE_FORMAT(#{date}, '%Y-%m')
+        where date_format(create_time,'%Y-%m')  = date_format(#{date}, '%Y-%m')
         order by create_time desc
         limit 1
     </select>
diff --git a/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
index 2597489..655bd26 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
@@ -105,7 +105,7 @@
         camera_dept, hybm, lxbm,d.dept_id, d.dept_name from t_monitor m
         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
-        where m.serial_number in
+        where p.examine_status = 1 and  m.serial_number in
         <foreach collection="list" separator="," item="id" open="(" close=")">
             #{id}
         </foreach>
diff --git a/ycl-server/src/main/resources/mapper/zgyw/YwPointMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/YwPointMapper.xml
index cd9b458..37499af 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/YwPointMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/YwPointMapper.xml
@@ -358,5 +358,17 @@
         serial_number, province_tag, important_tag, important_command_image_tag, dept_tag
     </select>
 
-
+    <select id="selectToCount" resultType="com.ycl.platform.domain.vo.YwPointVO">
+        select p.* from t_yw_point p
+        left join t_monitor m on p.serial_number = m.serial_number
+        <where>
+            p.examine_status = 1 and m.camera_fun_type like concat('%',#{examineCategory},'%')
+            <if test="examineTag == 0">
+                and p.province_tag = 1
+            </if>
+            <if test="examineTag == 2">
+                and p.dept_tag = 1
+            </if>
+        </where>
+    </select>
 </mapper>

--
Gitblit v1.8.0