Selaa lähdekoodia

Merge branch 'JCB-FIRE' of http://47.111.81.118:3000/uskycloud/usky-modules into JCB-FIRE

guoenzhou 2 vuotta sitten
vanhempi
commit
f2b5ceecc7
28 muutettua tiedostoa jossa 496 lisäystä ja 78 poistoa
  1. 1 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/MybatisGeneratorUtils.java
  2. 22 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/AlarmDetectorController.java
  3. 7 6
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/AlarmFireController.java
  4. 9 5
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/AppPatrolInspectionController.java
  5. 21 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/BaseDeviceController.java
  6. 3 3
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionContentController.java
  7. 11 8
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionRecordController.java
  8. 4 4
      service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionSiteController.java
  9. 134 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/BaseDevice.java
  10. 10 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/PatrolInspectionRecordOption.java
  11. 26 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/PatrolInspectionSite.java
  12. 16 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/BaseDeviceMapper.java
  13. 6 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/PatrolInspectionPlanMapper.java
  14. 16 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/BaseDeviceService.java
  15. 1 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionContentService.java
  16. 2 2
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionPlanSonService.java
  17. 1 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionRecordService.java
  18. 1 1
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionSiteService.java
  19. 20 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BaseDeviceServiceImpl.java
  20. 15 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionAreaServiceImpl.java
  21. 12 6
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionContentServiceImpl.java
  22. 62 10
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPlanSonServiceImpl.java
  23. 14 5
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionRecordServiceImpl.java
  24. 11 4
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionSiteServiceImpl.java
  25. 6 0
      service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/ContentOptionVo.java
  26. 30 0
      service-fire/service-fire-biz/src/main/resources/mapper/fire/BaseDeviceMapper.xml
  27. 33 19
      service-fire/service-fire-biz/src/main/resources/mapper/fire/PatrolInspectionPlanMapper.xml
  28. 2 0
      service-fire/service-fire-biz/src/main/resources/mapper/fire/PatrolInspectionRecordOptionMapper.xml

+ 1 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/MybatisGeneratorUtils.java

@@ -71,7 +71,7 @@ public class MybatisGeneratorUtils {
         // strategy.setTablePrefix("t_"); // 表名前缀
         strategy.setEntityLombokModel(true); //使用lombok
         //修改自己想要生成的表
-        strategy.setInclude("alarm_detector");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
+        strategy.setInclude("base_device");  // 逆向工程使用的表   如果要生成多个,这里可以传入String[]
         mpg.setStrategy(strategy);
 
         // 关闭默认 xml 生成,调整生成 至 根目录

+ 22 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/AlarmDetectorController.java

@@ -4,6 +4,7 @@ package com.usky.fire.controller.web;
 import com.ruoyi.common.core.utils.poi.ExcelUtil;
 import com.usky.common.core.bean.ApiResult;
 import com.usky.common.core.bean.CommonPage;
+import com.usky.common.core.util.HttpUtils;
 import com.usky.common.log.enums.BusinessType;
 import com.usky.fire.domain.AlarmDetector;
 import com.usky.fire.service.AlarmDetectorService;
@@ -87,7 +88,7 @@ public class AlarmDetectorController {
      * @return
      */
     @Log(title = "告警处理", businessType = BusinessType.UPDATE)
-    @PostMapping("updateAlarmDetector")
+    @PutMapping("updateAlarmDetector")
     public ApiResult<Void> updateAlarmDetector(@RequestBody AlarmDetector alarmDetector) {
         alarmDetectorService.updateAlarmDetector(alarmDetector);
         return ApiResult.success();
@@ -116,5 +117,25 @@ public class AlarmDetectorController {
         util.exportExcel(response, list, exportTitle, exportTitle);
     }
 
+//    @GetMapping("getData")
+//    public Object getData(){
+//        Request request = Request.Post("http://172.16.120.69:8086/query?db=USKTSDB&u=root&p=root");
+//        String body = "q=SELECT * FROM sp_d00000320040040&epoch=s";
+//        request.bodyString(body,ContentType.APPLICATION_FORM_URLENCODED);
+//        request.setHeader("User-Agent", "Apipost client Runtime/+https://www.apipost.cn/");
+//        request.setHeader("Content-Type", "application/x-www-form-urlencoded");
+//        HttpResponse httpResponse = request.execute().returnResponse();
+//        System.out.println(httpResponse.getStatusLine());
+//        if (httpResponse.getEntity() != null) {
+//            String html = EntityUtils.toString(httpResponse.getEntity());
+//            System.out.println(html);
+//        }
+//        String url = "http://172.16.120.69:8086/query?db=USKTSDB&u=root&p=root";
+//        String body = "q=SELECT * FROM sp_d00000320040040&epoch=s";
+//        HttpUtils.postForm(url, body,);
+//        return ApiResult.success();
+//    }
+
+
 }
 

+ 7 - 6
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/AlarmFireController.java

@@ -88,7 +88,7 @@ public class AlarmFireController {
      * @return
      */
     @Log(title = "告警处理", businessType = BusinessType.UPDATE)
-    @PostMapping("updateAlarmFire")
+    @PutMapping("updateAlarmFire")
     public ApiResult<Void> updateAlarmFire(@RequestBody AlarmFire alarmFire) {
         alarmFireService.updateAlarmFire(alarmFire);
         return ApiResult.success();
@@ -97,12 +97,13 @@ public class AlarmFireController {
 
     /**
      * 事件管理-/火警告警处置/故障告警处置/隐患报警处理-火灾报警处置/-导出
+     *
      * @param response
-     * @param handlingStatus    处理状态(0、未处理 1、已处理)
-     * @param alarmType         告警类型(2 火警、4 故障、16 监管等)
-     * @param startDate         开始时间 格式:yyyy-MM-dd HH:mm:ss
-     * @param endDate           结束时间 格式:yyyy-MM-dd HH:mm:ss
-     * @param exportTitle       导出标题
+     * @param handlingStatus 处理状态(0、未处理 1、已处理)
+     * @param alarmType      告警类型(2 火警、4 故障、16 监管等)
+     * @param startDate      开始时间 格式:yyyy-MM-dd HH:mm:ss
+     * @param endDate        结束时间 格式:yyyy-MM-dd HH:mm:ss
+     * @param exportTitle    导出标题
      * @throws IOException
      */
     @GetMapping("alarmFireLowerListExport")

+ 9 - 5
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/AppPatrolInspectionController.java

@@ -70,12 +70,14 @@ public class AppPatrolInspectionController {
      *
      * @param siteId      地点ID
      * @param siteNubmber 地点号码
+     * @param planSonId   子计划Id
      * @return
      */
     @GetMapping("siteDetails")
-    public ApiResult<Map<String, Object>> siteDetails(@RequestParam(value = "siteId") Integer siteId,
-                                                      @RequestParam(value = "siteNubmber") String siteNubmber) {
-        return ApiResult.success(patrolInspectionPlanSonService.siteDetails(siteId, siteNubmber));
+    public ApiResult<Map<String, Object>> siteDetails(@RequestParam(value = "siteId", required = false, defaultValue = "0") Integer siteId,
+                                                      @RequestParam(value = "siteNubmber", required = false) String siteNubmber,
+                                                      @RequestParam(value = "planSonId", required = false) Integer planSonId) {
+        return ApiResult.success(patrolInspectionPlanSonService.siteDetails(siteId, siteNubmber, planSonId));
     }
 
     /**
@@ -142,8 +144,10 @@ public class AppPatrolInspectionController {
     @GetMapping("recordList")
     public ApiResult<List<PatrolInspectionRecordVo>> recordList(@RequestParam(value = "currentDate", required = false) String currentDate,
                                                                 @RequestParam(value = "sort", required = false, defaultValue = "DESC") String sort,
-                                                                @RequestParam(value = "id", required = false, defaultValue = "0") Integer id) {
-        return ApiResult.success(patrolInspectionPlanSonService.recordList(currentDate, sort, id));
+                                                                @RequestParam(value = "id", required = false, defaultValue = "0") Integer id,
+                                                                @RequestParam(value = "planSonId", required = false, defaultValue = "0") Integer planSonId,
+                                                                @RequestParam(value = "siteId", required = false, defaultValue = "0") Integer siteId) {
+        return ApiResult.success(patrolInspectionPlanSonService.recordList(currentDate, sort, id, planSonId, siteId));
     }
 
 

+ 21 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/BaseDeviceController.java

@@ -0,0 +1,21 @@
+package com.usky.fire.controller.web;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.stereotype.Controller;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-08-15
+ */
+@Controller
+@RequestMapping("/baseDevice")
+public class BaseDeviceController {
+
+}
+

+ 3 - 3
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionContentController.java

@@ -89,14 +89,14 @@ public class PatrolInspectionContentController {
      * 巡查自检-巡检内容-导出
      * @param response
      * @param contentTitle 内容标题
-     * @param id 巡检内容ID
+     * @param idList 巡检内容ID
      * @throws IOException
      */
     @GetMapping("/contentListExport")
     public void export(HttpServletResponse response,
                        @RequestParam(value = "contentTitle",required = false) String contentTitle,
-                       @RequestParam(value = "id",required = false, defaultValue = "0") Integer id) throws IOException {
-        List<PatrolInspectionContentExportVo> list = patrolInspectionContentService.contentListExport(contentTitle, id);
+                       @RequestParam(value = "id",required = false) String idList) throws IOException {
+        List<PatrolInspectionContentExportVo> list = patrolInspectionContentService.contentListExport(contentTitle, idList);
         ExcelUtil<PatrolInspectionContentExportVo> util = new ExcelUtil<PatrolInspectionContentExportVo>(PatrolInspectionContentExportVo.class);
         util.exportExcel(response, list, "巡检内容列表", "巡检内容列表");
     }

+ 11 - 8
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionRecordController.java

@@ -84,13 +84,15 @@ public class PatrolInspectionRecordController {
 
     /**
      * 巡查自检-巡检记录-导出
+     *
      * @param response
-     * @param areaName        区域名称
-     * @param siteName        地点名称
-     * @param name            人员名称
-     * @param planType        计划类型
-     * @param startDateTime   开始时间
-     * @param endDateTime     结束时间
+     * @param areaName      区域名称
+     * @param siteName      地点名称
+     * @param name          人员名称
+     * @param planType      计划类型
+     * @param startDateTime 开始时间
+     * @param endDateTime   结束时间
+     * @param idList        记录ID
      * @throws IOException
      */
     @GetMapping("/recordLsitExport")
@@ -100,8 +102,9 @@ public class PatrolInspectionRecordController {
                        @RequestParam(value = "name", required = false) String name,
                        @RequestParam(value = "planType", required = false) Integer planType,
                        @RequestParam(value = "startDateTime", required = false) String startDateTime,
-                       @RequestParam(value = "endDateTime", required = false) String endDateTime) throws IOException {
-        List<PatrolInspectionRecordExportVo> list = patrolInspectionRecordService.recordLsitExport(areaName, siteName, name, planType, startDateTime, endDateTime);
+                       @RequestParam(value = "endDateTime", required = false) String endDateTime,
+                       @RequestParam(value = "idList", required = false) String idList) throws IOException {
+        List<PatrolInspectionRecordExportVo> list = patrolInspectionRecordService.recordLsitExport(areaName, siteName, name, planType, startDateTime, endDateTime,idList);
         ExcelUtil<PatrolInspectionRecordExportVo> util = new ExcelUtil<PatrolInspectionRecordExportVo>(PatrolInspectionRecordExportVo.class);
         util.exportExcel(response, list, "巡检记录", "巡检记录");
     }

+ 4 - 4
service-fire/service-fire-biz/src/main/java/com/usky/fire/controller/web/PatrolInspectionSiteController.java

@@ -143,14 +143,14 @@ public class PatrolInspectionSiteController {
      *
      * @param areaId   区域id
      * @param siteName 地点名称
-     * @param id       地点ID
+     * @param idList   地点ID
      * @return
      */
     @GetMapping("/patrolInspectionSiteListExport")
     public void export(HttpServletResponse response, @RequestParam(required = false) Integer areaId,
-                       @RequestParam(value = "id", required = false) String siteName,
-                       @RequestParam(value = "id", required = false, defaultValue = "0") Integer id) throws IOException {
-        List<PatrolInspectionSiteExportVo> list = patrolInspectionSiteService.patrolInspectionSiteListExport(areaId, siteName, id);
+                       @RequestParam(value = "siteName", required = false) String siteName,
+                       @RequestParam(value = "idList", required = false) String idList) throws IOException {
+        List<PatrolInspectionSiteExportVo> list = patrolInspectionSiteService.patrolInspectionSiteListExport(areaId, siteName, idList);
         ExcelUtil<PatrolInspectionSiteExportVo> util = new ExcelUtil<PatrolInspectionSiteExportVo>(PatrolInspectionSiteExportVo.class);
         util.exportExcel(response, list, "巡检地点列表", "巡检地点列表");
     }

+ 134 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/BaseDevice.java

@@ -0,0 +1,134 @@
+package com.usky.fire.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.time.LocalDate;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-08-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class BaseDevice implements Serializable {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 设备信息表主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 设备编号
+     */
+    private String deviceCode;
+
+    /**
+     * 设备名称
+     */
+    private String deviceName;
+
+    /**
+     * 安装位置
+     */
+    private String installAddress;
+
+    /**
+     * 设备类型
+     */
+    private Integer deviceType;
+
+    /**
+     * 产品ID
+     */
+    private Integer productId;
+
+    /**
+     * 所属楼层
+     */
+    private Integer floor;
+
+    /**
+     * 物联网卡号
+     */
+    private String simNum;
+
+    /**
+     * 通信方式
+     */
+    private Integer communicatMode;
+
+    /**
+     * 设备所属模型坐标
+     */
+    private String modelPosition;
+
+    /**
+     * 防火分区
+     */
+    private String fireZone;
+
+    /**
+     * 倍率
+     */
+    private Integer magnification;
+
+    /**
+     * 解析方法
+     */
+    private String analyticMethod;
+
+    /**
+     * 安装时间
+     */
+    private LocalDate installTime;
+
+    /**
+     * 安装人
+     */
+    private String installPerson;
+
+    /**
+     * 使能标识
+     */
+    private Integer enable;
+
+    /**
+     * 所属单位ID
+     */
+    private Integer companyId;
+
+    /**
+     * 创建时间
+     */
+    private LocalDateTime createTime;
+
+    /**
+     * 更新时间
+     */
+    private LocalDateTime updateTime;
+
+    /**
+     * 更新人
+     */
+    private String updatePerson;
+
+    /**
+     * 创建人
+     */
+    private String creator;
+
+
+}

+ 10 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/PatrolInspectionRecordOption.java

@@ -40,5 +40,15 @@ public class PatrolInspectionRecordOption implements Serializable {
      */
     private String remarks;
 
+    /**
+     * 内容
+     */
+    private String content;
+
+    /**
+     * 检查项ID
+     */
+    private Integer contentId;
+
 
 }

+ 26 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/domain/PatrolInspectionSite.java

@@ -1,9 +1,12 @@
 package com.usky.fire.domain;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
 import java.io.Serializable;
+import java.util.List;
+
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
@@ -109,6 +112,29 @@ public class PatrolInspectionSite implements Serializable {
      */
     private Integer companyId;
 
+    /**
+     * 地点内容总数
+     */
+    @TableField(exist = false)
+    private Integer contentCount;
+
+    /**
+     * 图片
+     */
+    @TableField(exist = false)
+    private List<PatrolInspectionRecordPicture> recordPictureList;
+
+    /**
+     * 备注
+     */
+    @TableField(exist = false)
+    private String remarks;
+
+    /**
+     * 子计划ID
+     */
+    @TableField(exist = false)
+    private Integer planSonId;
 
 
 }

+ 16 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/BaseDeviceMapper.java

@@ -0,0 +1,16 @@
+package com.usky.fire.mapper;
+
+import com.usky.fire.domain.BaseDevice;
+import com.usky.common.mybatis.core.CrudMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-08-15
+ */
+public interface BaseDeviceMapper extends CrudMapper<BaseDevice> {
+
+}

+ 6 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/mapper/PatrolInspectionPlanMapper.java

@@ -2,8 +2,11 @@ package com.usky.fire.mapper;
 
 import com.usky.common.mybatis.core.CrudMapper;
 import com.usky.fire.domain.PatrolInspectionPlan;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+
 /**
  * <p>
  * Mapper 接口
@@ -14,5 +17,7 @@ import org.springframework.stereotype.Repository;
  */
 @Repository
 public interface PatrolInspectionPlanMapper extends CrudMapper<PatrolInspectionPlan> {
-
+    int planSiteCount(@Param("personnelIdList") List<Integer> personnelIdList,
+                      @Param("siteId") Integer siteId,
+                      @Param("inspectionDate") String inspectionDate);
 }

+ 16 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/BaseDeviceService.java

@@ -0,0 +1,16 @@
+package com.usky.fire.service;
+
+import com.usky.fire.domain.BaseDevice;
+import com.usky.common.mybatis.core.CrudService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-08-15
+ */
+public interface BaseDeviceService extends CrudService<BaseDevice> {
+
+}

+ 1 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionContentService.java

@@ -26,5 +26,5 @@ public interface PatrolInspectionContentService extends CrudService<PatrolInspec
 
     CommonPage<PatrolInspectionContentVo> patrolInspectionContentList(String contentTitle, Integer pageNum, Integer pageSize, Integer id);
 
-    List<PatrolInspectionContentExportVo> contentListExport(String contentTitle, Integer id);
+    List<PatrolInspectionContentExportVo> contentListExport(String contentTitle, String idList);
 }

+ 2 - 2
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionPlanSonService.java

@@ -52,7 +52,7 @@ public interface PatrolInspectionPlanSonService extends CrudService<PatrolInspec
      * @param siteNubmber 地点号码
      * @return
      */
-    Map<String, Object> siteDetails(Integer siteId, String siteNubmber);
+    Map<String, Object> siteDetails(Integer siteId, String siteNubmber,Integer planSonId);
 
 
     /**
@@ -95,7 +95,7 @@ public interface PatrolInspectionPlanSonService extends CrudService<PatrolInspec
      * @param sort        排序 (正序:ASC 倒序:DESC)
      * @return
      */
-    List<PatrolInspectionRecordVo> recordList(String currentDate, String sort, Integer id);
+    List<PatrolInspectionRecordVo> recordList(String currentDate, String sort, Integer id,Integer planSonId,Integer siteId);
 
     /**
      * 手机端-巡检自检-巡检记录-查看巡检项

+ 1 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionRecordService.java

@@ -39,5 +39,5 @@ public interface PatrolInspectionRecordService extends CrudService<PatrolInspect
 
     List<PatrolInspectionRecordExportVo> recordLsitExport(String areaName, String siteName, String name,
                                                           Integer planType, String startDateTime,
-                                                          String endDateTime);
+                                                          String endDateTime,String idList);
 }

+ 1 - 1
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/PatrolInspectionSiteService.java

@@ -33,7 +33,7 @@ public interface PatrolInspectionSiteService extends CrudService<PatrolInspectio
 
     Integer[] siteContentList(Integer siteId);
 
-    List<PatrolInspectionSiteExportVo> patrolInspectionSiteListExport(Integer areaId, String siteName, Integer id);
+    List<PatrolInspectionSiteExportVo> patrolInspectionSiteListExport(Integer areaId, String siteName, String idList);
 //
 //    String correspondDeviceExport(Integer areaId, String siteName, Integer id);
 }

+ 20 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/BaseDeviceServiceImpl.java

@@ -0,0 +1,20 @@
+package com.usky.fire.service.impl;
+
+import com.usky.fire.domain.BaseDevice;
+import com.usky.fire.mapper.BaseDeviceMapper;
+import com.usky.fire.service.BaseDeviceService;
+import com.usky.common.mybatis.core.AbstractCrudService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author JCB
+ * @since 2022-08-15
+ */
+@Service
+public class BaseDeviceServiceImpl extends AbstractCrudService<BaseDeviceMapper, BaseDevice> implements BaseDeviceService {
+
+}

+ 15 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionAreaServiceImpl.java

@@ -36,6 +36,13 @@ public class PatrolInspectionAreaServiceImpl extends AbstractCrudService<PatrolI
     @Override
     @Transactional
     public void addPatrolInspectionArea(PatrolInspectionAreaVo patrolInspectionAreaVo) {
+        LambdaQueryWrapper<PatrolInspectionArea> queryWrapper = Wrappers.lambdaQuery();
+        queryWrapper.eq(PatrolInspectionArea::getEnable, 1)
+                .eq(PatrolInspectionArea::getAreaName, patrolInspectionAreaVo.getAreaName());
+        List<PatrolInspectionArea> list = this.list(queryWrapper);
+        if (list.size() > 0) {
+            throw new BusinessException("区域不可以重复");
+        }
         PatrolInspectionArea patrolInspectionArea = new PatrolInspectionArea();
         patrolInspectionArea.setAreaName(patrolInspectionAreaVo.getAreaName());
         patrolInspectionArea.setAreaFid(0);
@@ -68,6 +75,14 @@ public class PatrolInspectionAreaServiceImpl extends AbstractCrudService<PatrolI
         if (list.size() <= 0) {
             throw new BusinessException("父级ID不存在");
         }
+        LambdaQueryWrapper<PatrolInspectionArea> queryWrapperOne = Wrappers.lambdaQuery();
+        queryWrapperOne.eq(PatrolInspectionArea::getEnable, 1)
+                .eq(PatrolInspectionArea::getAreaFid, patrolInspectionArea.getAreaFid())
+                .eq(PatrolInspectionArea::getAreaName, patrolInspectionArea.getAreaName());
+        List<PatrolInspectionArea> list2 = this.list(queryWrapperOne);
+        if (list2.size() > 0) {
+            throw new BusinessException("区域名称不可重复");
+        }
         patrolInspectionArea.setCompanyId(list.get(0).getCompanyId());
         patrolInspectionArea.setCreator(SecurityUtils.getUsername());
         patrolInspectionArea.setCreateTime(LocalDateTime.now());

+ 12 - 6
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionContentServiceImpl.java

@@ -1,6 +1,7 @@
 package com.usky.fire.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.common.core.exception.BusinessException;
@@ -211,7 +212,7 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
 
 
     @Override
-    public List<PatrolInspectionContentExportVo> contentListExport(String contentTitle, Integer id) {
+    public List<PatrolInspectionContentExportVo> contentListExport(String contentTitle, String idList) {
         DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         LoginUser loginUser = SecurityUtils.getLoginUser();
         String userType = null;
@@ -227,20 +228,25 @@ public class PatrolInspectionContentServiceImpl extends AbstractCrudService<Patr
         if (contentTitle != null && !"".equals(contentTitle)) {
             queryWrapper.like(PatrolInspectionContent::getContentTitle, contentTitle);
         }
-        if (id != 0 && id != null) {
-            queryWrapper.eq(PatrolInspectionContent::getId, id);
+        if (StringUtils.isNotBlank(idList)) {
+            List<Integer> listId = new ArrayList<>();
+            String[] idArray = idList.split(",");
+            for (int i = 0; i < idArray.length; i++) {
+                listId.add(Integer.parseInt(idArray[i]));
+            }
+            queryWrapper.in(PatrolInspectionContent::getId, listId);
         }
         queryWrapper.orderByDesc(PatrolInspectionContent::getId);
         List<PatrolInspectionContent> patrolInspectionContentList = this.list(queryWrapper);
         List<PatrolInspectionContentExportVo> patrolInspectionContentVoList = new ArrayList<>();
         if (patrolInspectionContentList.size() > 0) {
-            List<Integer> idList = new ArrayList<>();
+            List<Integer> contentIdList = new ArrayList<>();
             for (int i = 0; i < patrolInspectionContentList.size(); i++) {
-                idList.add(patrolInspectionContentList.get(i).getId());
+                contentIdList.add(patrolInspectionContentList.get(i).getId());
             }
             LambdaQueryWrapper<PatrolInspectionContentOption> queryWrapperOne = Wrappers.lambdaQuery();
             queryWrapperOne.eq(PatrolInspectionContentOption::getEnable, 1)
-                    .in(PatrolInspectionContentOption::getContentId, idList);
+                    .in(PatrolInspectionContentOption::getContentId, contentIdList);
             List<PatrolInspectionContentOption> contentOptionList = contentOptionService.list(queryWrapperOne);
             for (int i = 0; i < patrolInspectionContentList.size(); i++) {
                 PatrolInspectionContentExportVo patrolInspectionContentVo = new PatrolInspectionContentExportVo();

+ 62 - 10
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionPlanSonServiceImpl.java

@@ -3,6 +3,7 @@ package com.usky.fire.service.impl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.usky.common.core.exception.BusinessException;
+import com.usky.common.core.util.StringUtils;
 import com.usky.common.mybatis.core.AbstractCrudService;
 import com.usky.common.security.utils.SecurityUtils;
 import com.usky.fire.domain.*;
@@ -104,7 +105,7 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
     public List<PatrolInspectionPlanSonVo> patrolInspectionPlan(String currentDate, String sort) {
         List<PatrolInspectionPlanSonVo> planList = new ArrayList<>();
         List<Integer> personnelIdList = this.getpersonId();
-        if (personnelIdList.size()>0){
+        if (personnelIdList.size() > 0) {
             LambdaQueryWrapper<PatrolInspectionPlanSchedule> queryWrapper = Wrappers.lambdaQuery();
             queryWrapper.select(PatrolInspectionPlanSchedule::getPlanId)
                     .in(PatrolInspectionPlanSchedule::getPersonnelId, personnelIdList)
@@ -127,11 +128,10 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
         SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
         List<PatrolInspectionPlanSonVo> list = new ArrayList<>();
         List<Integer> personnelIdList = this.getpersonId();
-        if (personnelIdList.size()>0){
+        if (personnelIdList.size() > 0) {
             LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
             queryWrapper.eq(PatrolInspectionSite::getEnable, 1);
-            queryWrapper
-                    .eq(PatrolInspectionSite::getTenantId, SecurityUtils.getTenantId())
+            queryWrapper.eq(PatrolInspectionSite::getTenantId, SecurityUtils.getTenantId())
                     .eq(PatrolInspectionSite::getSiteNubmber, siteNubmber);
             List<PatrolInspectionSite> siteList = patrolInspectionSiteService.list(queryWrapper);
             if (siteList.size() <= 0) {
@@ -174,25 +174,51 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
 
 
     @Override
-    public Map<String, Object> siteDetails(Integer siteId, String siteNubmber) {
+    public Map<String, Object> siteDetails(Integer siteId, String siteNubmber, Integer planSonId) {
+        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        List<Integer> personnelIdList = this.getpersonId();
+        if (personnelIdList.size() <= 0) {
+            throw new BusinessException("该地点不在计划中");
+        }
         LambdaQueryWrapper<PatrolInspectionSite> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.eq(PatrolInspectionSite::getTenantId, SecurityUtils.getTenantId());
         queryWrapper.eq(PatrolInspectionSite::getEnable, 1);
         if (siteId != 0 && siteId != null) {
             queryWrapper.eq(PatrolInspectionSite::getId, siteId);
         }
-        if (siteNubmber != null && !"".equals(siteNubmber)) {
+        if (StringUtils.isNotBlank(siteNubmber)) {
             queryWrapper.eq(PatrolInspectionSite::getSiteNubmber, siteNubmber);
         }
         List<PatrolInspectionSite> siteList = patrolInspectionSiteService.list(queryWrapper);
         if (siteList.size() <= 0) {
             throw new BusinessException("无效地点,请联系管理人员添加点位");
         }
+        int planSonSiteCount = patrolInspectionPlanMapper.planSiteCount(personnelIdList, siteList.get(0).getId(), dateFormat.format(new Date()));
+        if (planSonSiteCount <= 0) {
+            throw new BusinessException("此地点尚未采集,请采集该点位");
+        }
+//        List<PatrolInspectionRecordPicture> recordPictureList = new ArrayList<>();
+//        if (planSonId != null && planSonId != 0) {
+//            LambdaQueryWrapper<PatrolInspectionRecord> query = Wrappers.lambdaQuery();
+//            query.eq(PatrolInspectionRecord::getSiteId, siteId)
+//                    .eq(PatrolInspectionRecord::getPlanSonId, planSonId);
+//            List<PatrolInspectionRecord> recordList = patrolInspectionRecordMapper.selectList(query);
+//            if (CollectionUtils.isNotEmpty(recordList)) {
+//                siteList.get(0).setRemarks(recordList.get(0).getRemarks());
+//                LambdaQueryWrapper<PatrolInspectionRecordPicture> queryOne = Wrappers.lambdaQuery();
+//                queryOne.eq(PatrolInspectionRecordPicture::getRecordId, recordList.get(0).getId());
+//                recordPictureList = patrolInspectionRecordPictureService.list(queryOne);
+//            }
+//        }
+
+//        siteList.get(0).setRecordPictureList(recordPictureList);
         List<PatrolInspectionContentVo> contentList = this.contentList(siteList.get(0).getId());
+        siteList.get(0).setContentCount(contentList.size());
+        siteList.get(0).setPlanSonId(planSonId);
+
         Map<String, Object> map = new HashMap<>();
         map.put("siteList", siteList);
         map.put("contentList", contentList);
-        map.put("contentCount", contentList.size());
         return map;
     }
 
@@ -350,7 +376,7 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
     }
 
     @Override
-    public List<PatrolInspectionRecordVo> recordList(String currentDate, String sort, Integer id) {
+    public List<PatrolInspectionRecordVo> recordList(String currentDate, String sort, Integer id,Integer planSonId,Integer siteId) {
         List<Integer> personnelIdList = this.getpersonId();
         LambdaQueryWrapper<PatrolInspectionPlanSchedule> queryWrapper = Wrappers.lambdaQuery();
         queryWrapper.select(PatrolInspectionPlanSchedule::getPlanId)
@@ -369,6 +395,12 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
             if (id != null && id != 0) {
                 queryWrapperOne.eq(PatrolInspectionRecord::getId, id);
             }
+            if (planSonId != null && planSonId != 0) {
+                queryWrapperOne.eq(PatrolInspectionRecord::getPlanSonId, planSonId);
+            }
+            if (siteId != null && siteId != 0) {
+                queryWrapperOne.eq(PatrolInspectionRecord::getSiteId, siteId);
+            }
             if (sort.equals("ASC")) {
                 queryWrapperOne.orderByAsc(PatrolInspectionRecord::getId);
             } else {
@@ -377,9 +409,15 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
             List<PatrolInspectionRecord> recordList = patrolInspectionRecordMapper.selectList(queryWrapperOne);
             if (recordList.size() > 0) {
                 List<Integer> siteIdList = new ArrayList<>();
+                List<Integer> recordIdList = new ArrayList<>();
                 for (int i = 0; i < recordList.size(); i++) {
                     siteIdList.add(recordList.get(i).getSiteId());
+                    recordIdList.add(recordList.get(i).getId());
                 }
+                LambdaQueryWrapper<PatrolInspectionRecordPicture> queryOne = Wrappers.lambdaQuery();
+                queryOne.in(PatrolInspectionRecordPicture::getRecordId, recordIdList);
+                List<PatrolInspectionRecordPicture> recordPictureList = patrolInspectionRecordPictureService.list(queryOne);
+
                 LambdaQueryWrapper<PatrolInspectionSiteContent> queryWrapperTwo = Wrappers.lambdaQuery();
                 queryWrapperTwo.in(PatrolInspectionSiteContent::getSiteId, siteIdList);
                 List<PatrolInspectionSiteContent> siteContentLsit = patrolInspectionSiteContentService.list(queryWrapperTwo);
@@ -418,6 +456,17 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
                     record.setCreator(recordList.get(i).getCreator());
                     record.setRemarks(recordList.get(i).getRemarks());
                     record.setContentCount(0);
+                    List<PatrolInspectionRecordPicture> PatrolInspectionRecordPictureList = new ArrayList<>();
+                    for (int j = 0; j < recordPictureList.size(); j++) {
+                        PatrolInspectionRecordPicture patrolInspectionRecordPicture = new PatrolInspectionRecordPicture();
+                        if (recordList.get(i).getId() == recordPictureList.get(j).getRecordId()) {
+                            patrolInspectionRecordPicture.setRecordId(recordPictureList.get(j).getRecordId());
+                            patrolInspectionRecordPicture.setPictureUrl(recordPictureList.get(j).getPictureUrl());
+                            patrolInspectionRecordPicture.setId(recordPictureList.get(j).getId());
+                        }
+                        PatrolInspectionRecordPictureList.add(patrolInspectionRecordPicture);
+                    }
+                    record.setRecordPictureList(PatrolInspectionRecordPictureList);
                     for (int j = 0; j < dataCountVoList.size(); j++) {
                         if (recordList.get(i).getSiteId() == dataCountVoList.get(i).getId()) {
                             record.setContentCount(dataCountVoList.get(i).getListCount());
@@ -475,6 +524,9 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
                             contentOptionVo.setSelectStatus(true);
                             contentOptionVo.setRemarks(recordOptionList.get(j).getRemarks());
                         }
+                        if (contentOptionList.get(i).getContentId()==recordOptionList.get(j).getContentId()){
+                            contentOptionVo.setContent(recordOptionList.get(i).getContent());
+                        }
                     }
                     contentOptionVoList.add(contentOptionVo);
                 }
@@ -624,8 +676,8 @@ public class PatrolInspectionPlanSonServiceImpl extends AbstractCrudService<Patr
             }
             //巡检计划名称查询
             LambdaQueryWrapper<PatrolInspectionPlan> queryWrapperOne = Wrappers.lambdaQuery();
-            queryWrapperOne.eq(PatrolInspectionPlan::getTenantId, SecurityUtils.getTenantId());
-            queryWrapperOne.eq(PatrolInspectionPlan::getEnable, 1);
+//            queryWrapperOne.eq(PatrolInspectionPlan::getTenantId, SecurityUtils.getTenantId());
+//            queryWrapperOne.eq(PatrolInspectionPlan::getEnable, 1);
             queryWrapperOne.select(PatrolInspectionPlan::getId, PatrolInspectionPlan::getPlanName);
             if (planIdList != null && planIdList.size() > 0) {
                 queryWrapperOne.in(PatrolInspectionPlan::getId, planIdList);

+ 14 - 5
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionRecordServiceImpl.java

@@ -1,6 +1,7 @@
 package com.usky.fire.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.usky.common.core.bean.CommonPage;
 import com.usky.common.mybatis.core.AbstractCrudService;
@@ -315,7 +316,7 @@ public class PatrolInspectionRecordServiceImpl extends AbstractCrudService<Patro
     @Override
     public List<PatrolInspectionRecordExportVo> recordLsitExport(String areaName, String siteName, String name,
                                                                  Integer planType, String startDateTime,
-                                                                 String endDateTime) {
+                                                                 String endDateTime, String idList) {
         DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         LoginUser loginUser = SecurityUtils.getLoginUser();
         String userType = null;
@@ -327,21 +328,29 @@ public class PatrolInspectionRecordServiceImpl extends AbstractCrudService<Patro
         if ("00".equals(userType)) {
             queryWrapper.eq(PatrolInspectionRecord::getCreator, SecurityUtils.getUsername());
         }
-        if (areaName != null && "".equals(areaName)) {
+        if (StringUtils.isNotBlank(areaName)) {
             queryWrapper.like(PatrolInspectionRecord::getAreaName, areaName);
         }
-        if (siteName != null && "".equals(siteName)) {
+        if (StringUtils.isNotBlank(siteName)) {
             queryWrapper.like(PatrolInspectionRecord::getSiteName, siteName);
         }
-        if (name != null && "".equals(name)) {
+        if (StringUtils.isNotBlank(name)) {
             queryWrapper.like(PatrolInspectionRecord::getName, name);
         }
         if (planType != null && planType != 0) {
             queryWrapper.eq(PatrolInspectionRecord::getPlanType, planType);
         }
-        if (startDateTime != null && "".equals(startDateTime) && endDateTime != null && "".equals(endDateTime)) {
+        if (StringUtils.isNotBlank(startDateTime) && StringUtils.isNotBlank(endDateTime)) {
             queryWrapper.between(PatrolInspectionRecord::getCreateTime, startDateTime, endDateTime);
         }
+        if (StringUtils.isNotBlank(idList)) {
+            List<Integer> listId = new ArrayList<>();
+            String[] idArray = idList.split(",");
+            for (int i = 0; i < idArray.length; i++) {
+                listId.add(Integer.parseInt(idArray[i]));
+            }
+            queryWrapper.in(PatrolInspectionRecord::getId, listId);
+        }
         queryWrapper.orderByDesc(PatrolInspectionRecord::getId);
         List<PatrolInspectionRecord> patrolInspectionRecordList = this.list(queryWrapper);
         List<PatrolInspectionRecordExportVo> list = new ArrayList<>();

+ 11 - 4
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/impl/PatrolInspectionSiteServiceImpl.java

@@ -1,5 +1,6 @@
 package com.usky.fire.service.impl;
 
+import com.alibaba.nacos.common.utils.CollectionUtils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.usky.common.core.bean.CommonPage;
@@ -17,6 +18,7 @@ import com.usky.fire.service.vo.DataCountVo;
 import com.usky.fire.service.vo.PatrolInspectionAreaVo;
 import com.usky.fire.service.vo.PatrolInspectionSiteExportVo;
 import com.usky.system.model.LoginUser;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -222,7 +224,7 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
 
 
     @Override
-    public List<PatrolInspectionSiteExportVo> patrolInspectionSiteListExport(Integer areaId, String siteName, Integer id) {
+    public List<PatrolInspectionSiteExportVo> patrolInspectionSiteListExport(Integer areaId, String siteName, String idList) {
         DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         LoginUser loginUser = SecurityUtils.getLoginUser();
         String userType = null;
@@ -238,10 +240,15 @@ public class PatrolInspectionSiteServiceImpl extends AbstractCrudService<PatrolI
         if (areaId != null) {
             queryWrapper.eq(PatrolInspectionSite::getAreaId, areaId);
         }
-        if (id != null && id != 0) {
-            queryWrapper.eq(PatrolInspectionSite::getId, id);
+        if (StringUtils.isNotBlank(idList)) {
+            List<Integer> siteidList = new ArrayList<>();
+            String[] siteIdArray = idList.split(",");
+            for (int i = 0; i < siteIdArray.length; i++) {
+                siteidList.add(Integer.parseInt(siteIdArray[i]));
+            }
+            queryWrapper.in(PatrolInspectionSite::getId, siteidList);
         }
-        if (siteName != null && !"".equals(siteName)) {
+        if (StringUtils.isNotBlank(siteName)) {
             queryWrapper.like(PatrolInspectionSite::getSiteName, siteName);
         }
         queryWrapper.orderByDesc(PatrolInspectionSite::getId);

+ 6 - 0
service-fire/service-fire-biz/src/main/java/com/usky/fire/service/vo/ContentOptionVo.java

@@ -66,4 +66,10 @@ public class ContentOptionVo implements Serializable {
     private String remarks;
 
 
+    /**
+     * 内容
+     */
+    private String content;
+
+
 }

+ 30 - 0
service-fire/service-fire-biz/src/main/resources/mapper/fire/BaseDeviceMapper.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.usky.fire.mapper.BaseDeviceMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.usky.fire.domain.BaseDevice">
+        <id column="id" property="id" />
+        <result column="device_code" property="deviceCode" />
+        <result column="device_name" property="deviceName" />
+        <result column="install_address" property="installAddress" />
+        <result column="device_type" property="deviceType" />
+        <result column="product_id" property="productId" />
+        <result column="floor" property="floor" />
+        <result column="sim_num" property="simNum" />
+        <result column="communicat_mode" property="communicatMode" />
+        <result column="model_position" property="modelPosition" />
+        <result column="fire_zone" property="fireZone" />
+        <result column="magnification" property="magnification" />
+        <result column="analytic_method" property="analyticMethod" />
+        <result column="install_time" property="installTime" />
+        <result column="install_person" property="installPerson" />
+        <result column="enable" property="enable" />
+        <result column="company_id" property="companyId" />
+        <result column="create_time" property="createTime" />
+        <result column="update_time" property="updateTime" />
+        <result column="update_person" property="updatePerson" />
+        <result column="creator" property="creator" />
+    </resultMap>
+
+</mapper>

+ 33 - 19
service-fire/service-fire-biz/src/main/resources/mapper/fire/PatrolInspectionPlanMapper.xml

@@ -4,24 +4,38 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.usky.fire.domain.PatrolInspectionPlan">
-        <id column="id" property="id" />
-        <result column="plan_name" property="planName" />
-        <result column="start_date" property="startDate" />
-        <result column="end_date" property="endDate" />
-        <result column="area_id" property="areaId" />
-        <result column="plan_type" property="planType" />
-        <result column="plan_cycle" property="planCycle" />
-        <result column="plan_frequency" property="planFrequency" />
-        <result column="lap_time" property="lapTime" />
-        <result column="interval_time" property="intervalTime" />
-        <result column="plan_describe" property="planDescribe" />
-        <result column="create_time" property="createTime" />
-        <result column="creator" property="creator" />
-        <result column="enable" property="enable" />
-        <result column="tenant_id" property="tenantId" />
-        <result column="company_id" property="companyId" />
-        <result column="rest_day" property="restDay" />
-        <result column="week_count" property="weekCount" />
+        <id column="id" property="id"/>
+        <result column="plan_name" property="planName"/>
+        <result column="start_date" property="startDate"/>
+        <result column="end_date" property="endDate"/>
+        <result column="area_id" property="areaId"/>
+        <result column="plan_type" property="planType"/>
+        <result column="plan_cycle" property="planCycle"/>
+        <result column="plan_frequency" property="planFrequency"/>
+        <result column="lap_time" property="lapTime"/>
+        <result column="interval_time" property="intervalTime"/>
+        <result column="plan_describe" property="planDescribe"/>
+        <result column="create_time" property="createTime"/>
+        <result column="creator" property="creator"/>
+        <result column="enable" property="enable"/>
+        <result column="tenant_id" property="tenantId"/>
+        <result column="company_id" property="companyId"/>
+        <result column="rest_day" property="restDay"/>
+        <result column="week_count" property="weekCount"/>
     </resultMap>
-
+    <select id="planSiteCount" resultType="int">
+        SELECT
+        count(1)
+        FROM
+        patrol_inspection_plan_son AS p
+        JOIN patrol_inspection_plan_site_son AS ps ON p.id = ps.plan_id
+        <where>
+            ps.site_id =#{siteId}
+            AND p.inspection_date = #{inspectionDate}
+            AND p.personnel_id in
+            <foreach item="item" collection="personnelIdList" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </where>
+    </select>
 </mapper>

+ 2 - 0
service-fire/service-fire-biz/src/main/resources/mapper/fire/PatrolInspectionRecordOptionMapper.xml

@@ -8,6 +8,8 @@
         <result column="record_id" property="recordId" />
         <result column="content_option_id" property="contentOptionId" />
         <result column="remarks" property="remarks" />
+        <result column="content" property="content" />
+        <result column="content_id" property="contentId" />
     </resultMap>
 
 </mapper>