Просмотр исходного кода

1.新增项目管理模块代码
2.报表管理页面接口编写
3.项目管理中设备接口编写

lengfaqiang 2 лет назад
Родитель
Сommit
9b35a9f034
66 измененных файлов с 1423 добавлено и 751 удалено
  1. 0 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/common/EnvConstant.java
  2. 0 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/common/NumberConstant.java
  3. 0 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/common/StringConstant.java
  4. 0 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/AliyunOssFileTypeEnum.java
  5. 4 4
      slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/FileDisposeLayoutEnum.java
  6. 0 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/FileEnum.java
  7. 51 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/ReportEnum.java
  8. 51 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/ReportTypeEnum.java
  9. 0 116
      slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/enums/DictEnum.java
  10. 0 57
      slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/enums/DictTypeEnum.java
  11. 26 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/DeviceController.java
  12. 28 10
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/ProjectController.java
  13. 29 2
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/ReportController.java
  14. 7 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsDeviceMapper.java
  15. 2 2
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsProjectDeviceMapper.java
  16. 9 2
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsProjectMapper.java
  17. 12 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsReportTemplateMapper.java
  18. 5 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsAlarm.java
  19. 5 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDevice.java
  20. 5 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDeviceIntegration.java
  21. 5 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDeviceModel.java
  22. 5 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDeviceReference.java
  23. 10 5
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDeviceRelation.java
  24. 5 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsIntegration.java
  25. 5 40
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsLog.java
  26. 5 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsProject.java
  27. 5 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsProjectArea.java
  28. 12 77
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsProjectDevice.java
  29. 5 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsReportData.java
  30. 14 90
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsReportTemplate.java
  31. 5 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsThreshold.java
  32. 31 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/BindDevice.java
  33. 28 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/DeviceDataDTO.java
  34. 40 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/HeaderData.java
  35. 6 4
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/ProjectAddDTO.java
  36. 43 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/DeviceQuery.java
  37. 4 1
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/ProjectQuery.java
  38. 52 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/StatementQuery.java
  39. 2 2
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/IntegrationItemVO.java
  40. 67 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ProjectDeviceVO.java
  41. 46 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ReportDetailVO.java
  42. 50 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ReportStatementVO.java
  43. 31 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/CommonService.java
  44. 46 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/DeviceService.java
  45. 108 21
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ProjectService.java
  46. 62 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ReportService.java
  47. 7 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/repository/KwsDeviceRelationRepository.java
  48. 7 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/repository/KwsProjectDeviceRepository.java
  49. 17 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/repository/impl/KwsDeviceRelationImpl.java
  50. 17 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/repository/impl/KwsProjectDeviceImpl.java
  51. 4 4
      slope-modules/slope-detection/src/main/resources/bootstrap-lfdc.yml
  52. 1 1
      slope-modules/slope-detection/src/main/resources/bootstrap.yml
  53. 2 1
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsAlarmMapper.xml
  54. 147 139
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceIntegrationMapper.xml
  55. 7 2
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceMapper.xml
  56. 2 1
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceModelMapper.xml
  57. 2 1
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceReferenceMapper.xml
  58. 2 1
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceRelationMapper.xml
  59. 2 1
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsIntegrationMapper.xml
  60. 2 1
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsLogMapper.xml
  61. 2 1
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsProjectAreaMapper.xml
  62. 3 2
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsProjectDeviceMapper.xml
  63. 58 3
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsProjectMapper.xml
  64. 6 1
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsReportDataMapper.xml
  65. 207 158
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsReportTemplateMapper.xml
  66. 2 1
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsThresholdMapper.xml

+ 0 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/EnvConstant.java → slope-common/slope-common-core/src/main/java/com/sckw/core/common/EnvConstant.java


+ 0 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/NumberConstant.java → slope-common/slope-common-core/src/main/java/com/sckw/core/common/NumberConstant.java


+ 0 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/StringConstant.java → slope-common/slope-common-core/src/main/java/com/sckw/core/common/StringConstant.java


+ 0 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/enums/AliyunOssFileTypeEnum.java → slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/AliyunOssFileTypeEnum.java


+ 4 - 4
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/enums/FileDisposeLayoutEnum.java → slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/FileDisposeLayoutEnum.java

@@ -16,20 +16,20 @@ public enum FileDisposeLayoutEnum {
     /**
     /**
      * oss裁剪比例大小-左
      * oss裁剪比例大小-左
      */
      */
-    OSS_ABBREVIATE_LEFT(FileEnum.FILE_STORE_TYPE_OSS.getFileType(), "?x-oss-process=image/resize,m_lfit,h_", "OSS设置文件大小"),
+    OSS_ABBREVIATE_LEFT(com.sckw.core.common.enums.enums.FileEnum.FILE_STORE_TYPE_OSS.getFileType(), "?x-oss-process=image/resize,m_lfit,h_", "OSS设置文件大小"),
 
 
     /**
     /**
      * oss裁剪比例大小-右
      * oss裁剪比例大小-右
      */
      */
-    OSS_ABBREVIATE_RIGHT(FileEnum.FILE_STORE_TYPE_OSS.getFileType(), ",w_", "OSS设置文件大小"),
+    OSS_ABBREVIATE_RIGHT(com.sckw.core.common.enums.enums.FileEnum.FILE_STORE_TYPE_OSS.getFileType(), ",w_", "OSS设置文件大小"),
     /**
     /**
      * oss按照比例缩放
      * oss按照比例缩放
      */
      */
-    OSS_LESSEN(FileEnum.FILE_STORE_TYPE_OSS.getFileType(), "?x-oss-process=image/resize,p_", "按百分比缩放"),
+    OSS_LESSEN(com.sckw.core.common.enums.enums.FileEnum.FILE_STORE_TYPE_OSS.getFileType(), "?x-oss-process=image/resize,p_", "按百分比缩放"),
     /**
     /**
      * 七牛云缩略图
      * 七牛云缩略图
      */
      */
-    KODO_ABBREVIATE(FileEnum.FILE_STORE_TYPE_ALIYUN.getFileType(), "-indexthumb", "缩略图"),
+    KODO_ABBREVIATE(com.sckw.core.common.enums.enums.FileEnum.FILE_STORE_TYPE_ALIYUN.getFileType(), "-indexthumb", "缩略图"),
     ;
     ;
 
 
     private final String type;
     private final String type;

+ 0 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/enums/FileEnum.java → slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/FileEnum.java


+ 51 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/ReportEnum.java

@@ -0,0 +1,51 @@
+package com.sckw.core.common.enums;
+
+/**
+ * @author lfdc
+ * @description 报表枚举
+ * @date 2023-10-31 11:10:07
+ */
+public enum ReportEnum {
+    /**
+     * 未启用
+     */
+    NOT_ENABLED(1, "1", "未启用"),
+
+    /**
+     * 启用
+     */
+    ENABLED(2, "2", "启用"),
+
+    /**
+     * 禁用
+     */
+    FORBIDDEN(3, "3", "禁用");
+
+    private final String status;
+    private final Integer code;
+    private final String description;
+
+    ReportEnum(Integer code, String status, String description) {
+        this.code = code;
+        this.status = status;
+        this.description = description;
+    }
+
+    public static String getDescription(Integer code) {
+        for (ReportEnum value : ReportEnum.values()) {
+            if (value.code == code) {
+                return value.description;
+            }
+        }
+        return null;
+    }
+
+    public static String getDescription(String status) {
+        for (ReportEnum value : ReportEnum.values()) {
+            if (value.status.equals(status)) {
+                return value.description;
+            }
+        }
+        return null;
+    }
+}

+ 51 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/ReportTypeEnum.java

@@ -0,0 +1,51 @@
+package com.sckw.core.common.enums;
+
+/**
+ * @author lfdc
+ * @description 报表枚举
+ * @date 2023-10-31 11:10:07
+ */
+public enum ReportTypeEnum {
+    /**
+     * 日
+     */
+    DAY(1, "1", "日报表"),
+
+    /**
+     * 周
+     */
+    WEEK(2, "2", "周报表"),
+
+    /**
+     * 月
+     */
+    MONTH(3, "3", "月报表");
+
+    private final String status;
+    private final Integer code;
+    private final String description;
+
+    ReportTypeEnum(Integer code, String status, String description) {
+        this.code = code;
+        this.status = status;
+        this.description = description;
+    }
+
+    public static String getDescription(Integer code) {
+        for (ReportTypeEnum value : ReportTypeEnum.values()) {
+            if (value.code == code) {
+                return value.description;
+            }
+        }
+        return null;
+    }
+
+    public static String getDescription(String status) {
+        for (ReportTypeEnum value : ReportTypeEnum.values()) {
+            if (value.status.equals(status)) {
+                return value.description;
+            }
+        }
+        return null;
+    }
+}

+ 0 - 116
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/enums/DictEnum.java

@@ -1,116 +0,0 @@
-package com.sckw.core.common.enums.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * @author lfdc
- * @description 枚举字典
- * @date 2023-07-07 14:07:23
- */
-@Getter
-@AllArgsConstructor
-public enum DictEnum {
-    /**
-     *
-     */
-    SYSTEM_MSG("msg_category", "SYSTEM", "系统消息"),
-    BUSINESS_MSG("msg_category", "BUSINESS", "业务消息"),
-    SMS_REGISTER("send_sms_type", "register", "短信注册"),
-    SMS_LOGIN("send_sms_type", "login", "短信登录"),
-    SMS_UPDATE_PASSWORD("send_sms_type", "updatePassword", "短信修改密码"),
-    PRICE_TYPE_0("price_type", "0", "元/吨"),
-    PRICE_TYPE_1("price_type", "1", "元/车"),
-    WEIGHT_CAR_0("weight_car", "0", "吨/车"),
-    WEIGHT_CAR_1("weight_car", "1", "公斤/车"),
-    TRANSPORT_TYPE_0("transport_type", "0", "公斤/车"),
-    TRANSPORT_TYPE_1("transport_type", "1", "吨/车"),
-    UNIT_TYPE_0("unit_type","0", "吨"),
-    UNIT_TYPE_1("unit_type","1", "方"),
-    UNIT_TYPE_2("unit_type","2", "箱"),
-    UNIT_TYPE_3("unit_type","3", "件"),
-    UNIT_TYPE_4("unit_type","4", "其他"),
-    TAX_RATE_0("tax_rate","13", "13%"),
-    TAX_RATE_1("tax_rate","11", "11%"),
-    TAX_RATE_2("tax_rate","10", "10%"),
-    TRADE_TYPE_01("trade_type", "11", "预付款-汇付"),
-    TRADE_TYPE_02("trade_type", "12", "预付款-新生"),
-    TRADE_TYPE_03("trade_type", "13", "预付款-中信"),
-    TRADE_TYPE_1("trade_type", "2", "货到付款"),
-    TRADE_TYPE_2("trade_type", "3", "线下付款"),
-    PICKUP_TYPE_0("pickup_type", "0", "供应配送"),
-    PICKUP_TYPE_1("pickup_type", "1", "采方自提"),
-    DELIVERY_TYPE_0("delivery_type", "0", "签发交付"),
-    DELIVERY_TYPE_1("delivery_type", "1", "签收交付"),
-    TORDER_SOURCE_1("tOrder_source", "1", "采购下单"),
-    TORDER_SOURCE_2("tOrder_source", "2", "代客下单"),
-    TORDER_STATUS_0("tOrder_status", "0", "已保存"),
-    TORDER_STATUS_1("tOrder_status", "1", "待受理"),
-    TORDER_STATUS_2("tOrder_status", "2", "已退回"),
-    TORDER_STATUS_3("tOrder_status", "3", "待签约"),
-    TORDER_STATUS_4("tOrder_status", "4", "执行中"),
-    TORDER_STATUS_5("tOrder_status", "5", "已完结"),
-    TORDER_STATUS_6("tOrder_status", "6", "已对账"),
-    TORDER_STATUS_7("tOrder_status", "7", "已结算"),
-    CONTRACT_STATUS_0("contract_status", "1", "待签约"),
-    CONTRACT_STATUS_1("contract_status", "0", "已签约"),
-    SETTLEMENT_CYCLE_0("settlement_cycle", "0", "周结"),
-    SETTLEMENT_CYCLE_1("settlement_cycle", "1", "月结"),
-    SETTLEMENT_CYCLE_2("settlement_cycle", "2", "季结"),
-    SIGNING_TYPE_1("signing_type", "1", "线上签约"),
-    SIGNING_TYPE_2("signing_type", "2", "线下签约"),
-    TORDER_ADDRESS_TYPE_1("tOrder_address_type", "1", "装货地址"),
-    TORDER_ADDRESS_TYPE_2("tOrder_address_type", "2", "卸货地址"),
-    TORDER_UNIT_TYPE_1("tOrder_unit_type", "1", "采购单位"),
-    TORDER_UNIT_TYPE_2("tOrder_unit_type", "2", "销售单位"),
-    ADDRESS_TYPE_0("address_type", "0", "矿山"),
-    INDUSTRY_TYPE_0("industry_type", "0", "砂石"),
-    CLASSIFICATION_TYPE_0("classification_type", "0", "石料"),
-    CATEGORY_TYPE_0("category_type", "0", "山砂"),
-    PRODUCT_NAME_TYPE_0("product_name_type", "0", "毛石"),
-    GOODS_STATUS_0("goods_status", "0", "已保存"),
-    GOODS_STATUS_1("goods_status", "1", "上架中"),
-    GOODS_STATUS_2("goods_status", "2", "已下架"),
-    CHARGING_TYPE_1("charging_type", "1", "按装货量") ,
-    CHARGING_TYPE_2("charging_type", "2", "按卸货量") ,
-    CHARGING_TYPE_3("charging_type", "3", "按车次"),
-    SIGNING_WAY_1("signing_way", "1", "线上签约"),
-    SIGNING_WAY_2("signing_way", "2", "线下签约"),
-    TRANSPORT_DEMAND_STATUS_0("transport_demand_status", "0","已保存"),
-    TRANSPORT_DEMAND_STATUS_1("transport_demand_status", "1","上架中"),
-    TRANSPORT_DEMAND_STATUS_2("transport_demand_status", "2","已下架"),
-    WANT_BUY_STATUS_0("want_buy_status", "0","已保存"),
-    WANT_BUY_STATUS_1("want_buy_status", "1","上架中"),
-    WANT_BUY_STATUS_2("want_buy_status", "2","已下架"),
-    PREPAID_LIMIT_NO("prepaid_limit", "0","否"),
-    PREPAID_LIMIT_YES("prepaid_limit", "1","是"),
-    ;
-
-    private final String type;
-    private final String value;
-    private final String label;
-
-    public static String getLabel(String type, String value) {
-        for (DictEnum dict : DictEnum.values()) {
-            if (dict.getType().equals(type) && dict.getValue().equals(value)) {
-                return dict.getLabel();
-            }
-        }
-        return null;
-    }
-    public static List<DictEnum> getEnumsByType(String type) {
-        List<DictEnum> list = new ArrayList<>();
-        for (DictEnum dict : DictEnum.values()) {
-            if (dict.getType().equals(type) ) {
-                list.add(dict);
-            }
-        }
-        return list.stream().sorted(Comparator.comparing(DictEnum::getValue)).collect(Collectors.toList());
-    }
-
-}

+ 0 - 57
slope-common/slope-common-core/src/main/java/com/sckw/core/common/enums/enums/DictTypeEnum.java

@@ -1,57 +0,0 @@
-package com.sckw.core.common.enums.enums;
-
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-
-/**
- * @desc: 字典类型枚举
- * @author: yzc
- * @date: 2023-07-10 16:46
- */
-@Getter
-@AllArgsConstructor
-public enum DictTypeEnum {
-    MSG_CATEGORY("msg_category", "消息分类"),
-    MSG_STATUS("msg_status", "消息状态"),
-    SEND_SMS_TYPE("send_sms_type", "发送短信类型"),
-    INTEGRAL_TYPE("integral_type", "积分类型"),
-    UNIT_TYPE("unit_type", "商品单位类型"),
-    TAX_RATE("tax_rate", "商品税率"),
-    PRICE_TYPE("price_type", "运价方式"),
-    TRADE_TYPE("trade_type", "支付方式"),
-    PICKUP_TYPE("pickup_type", "提货方式"),
-    DELIVERY_TYPE("delivery_type", "交付类型"),
-    TORDER_SOURCE("tOrder_source", "交易订单来源"),
-    TRANSPORT_TYPE("transport_type", "运输方式"),
-    TORDER_STATUS("tOrder_status", "交易订单状态"),
-    CONTRACT_STATUS("contract_status", "合同状态"),
-    TORDER_ADDRESS_TYPE("tOrder_address_type", "交易订单地址类型"),
-    TORDER_UNIT_TYPE("tOrder_unit_type", "交易订单单位类型"),
-    ADDRESS_TYPE("address_type", "地址类型"),
-    INDUSTRY_TYPE("industry_type", "行业类型"),
-    SETTLEMENT_CYCLE("settlement_cycle", "结算周期"),
-    SIGNING_TYPE("signing_type", "签约方式"),
-    CLASSIFICATION_TYPE("classification_type", "分类类型"),
-    CATEGORY_TYPE("category_type", "类别类型"),
-    PRODUCT_NAME_TYPE("product_name_type", "品名类型"),
-    GOODS_STATUS("goods_status", "商品状态"),
-    CHARGING_TYPE("charging_type", "计费方式") ,
-    COLOR_TYPE("color_type", "车辆颜色"),
-    ENERGY_TYPE("energy_type", "能源类型"),
-    TRUCK_TYPE("truck_type", "车辆类型"),
-    USE_TYPE("use_type", "使用性质"),
-    APPROVED_DRIVING("approved_driving", "准驾车型"),
-    SIGNING_WAY("signing_way", "签约方式"),
-    WEIGHT_CAR("weight_car", "以车的限重"),
-    TAX_RATE_TYPE("tax_rate_type", "合理损耗单位"),
-    TRANSPORT_DEMAND_STATUS("transport_demand_status", "运需状态"),
-    PREPAID_LIMIT("prepaid_limit", "预付限额"),
-    WANT_BUY_STATUS("want_buy_status", "求购状态"),
-    ORDER_SOURCE("order_source", "订单来源"),
-    ;
-
-    private final String type;
-    private final String name;
-
-
-}

+ 26 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/DeviceController.java

@@ -1,7 +1,15 @@
 package com.sckw.slope.detection.controller;
 package com.sckw.slope.detection.controller;
 
 
+import com.sckw.core.annotation.Log;
+import com.sckw.core.annotation.RepeatSubmit;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.slope.detection.service.DeviceService;
+import jakarta.validation.constraints.NotBlank;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
 /**
 /**
@@ -14,4 +22,22 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/device")
 @RequestMapping("/device")
 public class DeviceController {
 public class DeviceController {
 
 
+    @Autowired
+    DeviceService deviceService;
+
+    @Log(description = "设备删除")
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "设备删除", value = "/dels", method = RequestMethod.DELETE)
+    public HttpResult dels(@RequestParam("ids") @NotBlank(message = "设备id不能为空") String ids) {
+        log.info("设备删除 delete param:{}", ids);
+        return deviceService.dels(ids);
+    }
+
+    @Log(description = "所属设备查询")
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "所属设备查询", value = "/deviceAll", method = RequestMethod.GET)
+    public HttpResult deviceAll(@RequestParam("projectId") String projectId) {
+        log.info("所属设备查询 deviceAll param :{}",projectId);
+        return deviceService.deviceAll(projectId);
+    }
 }
 }

+ 28 - 10
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/ProjectController.java

@@ -4,14 +4,16 @@ import com.alibaba.fastjson2.JSONObject;
 import com.sckw.core.annotation.Log;
 import com.sckw.core.annotation.Log;
 import com.sckw.core.annotation.RepeatSubmit;
 import com.sckw.core.annotation.RepeatSubmit;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.core.web.response.HttpResult;
+import com.sckw.slope.detection.model.dto.BindDevice;
 import com.sckw.slope.detection.model.dto.ProjectAddDTO;
 import com.sckw.slope.detection.model.dto.ProjectAddDTO;
 import com.sckw.slope.detection.model.dto.ProjectUpdateDTO;
 import com.sckw.slope.detection.model.dto.ProjectUpdateDTO;
-import com.sckw.slope.detection.model.param.ProjectQueryDto;
+import com.sckw.slope.detection.model.param.DeviceQuery;
+import com.sckw.slope.detection.model.param.ProjectQuery;
 import com.sckw.slope.detection.service.ProjectService;
 import com.sckw.slope.detection.service.ProjectService;
+import jakarta.servlet.http.HttpServletRequest;
 import jakarta.validation.Valid;
 import jakarta.validation.Valid;
 import jakarta.validation.constraints.NotBlank;
 import jakarta.validation.constraints.NotBlank;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.http.HttpResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
@@ -31,7 +33,7 @@ public class ProjectController {
     @Log(description = "项目查询-分页")
     @Log(description = "项目查询-分页")
     @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RequestMapping(name = "项目查询-分页", value = "/select", method = RequestMethod.POST)
     @RequestMapping(name = "项目查询-分页", value = "/select", method = RequestMethod.POST)
-    public HttpResult select(@Valid @RequestBody ProjectQueryDto projectQueryDto, HttpResponse response) {
+    public HttpResult select(@Valid @RequestBody ProjectQuery projectQueryDto, HttpServletRequest response) {
         log.info("项目新增 select param:{}", JSONObject.toJSONString(projectQueryDto));
         log.info("项目新增 select param:{}", JSONObject.toJSONString(projectQueryDto));
         return HttpResult.ok(projectService.select(projectQueryDto, response));
         return HttpResult.ok(projectService.select(projectQueryDto, response));
     }
     }
@@ -39,7 +41,7 @@ public class ProjectController {
     @Log(description = "项目新增")
     @Log(description = "项目新增")
     @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RequestMapping(name = "项目新增", value = "/add", method = RequestMethod.POST)
     @RequestMapping(name = "项目新增", value = "/add", method = RequestMethod.POST)
-    public HttpResult projectAdd(@Valid @RequestBody ProjectAddDTO projectAddDto, HttpResponse response) {
+    public HttpResult projectAdd(@Valid @RequestBody ProjectAddDTO projectAddDto, HttpServletRequest response) {
         log.info("项目新增 add param:{}", JSONObject.toJSONString(projectAddDto));
         log.info("项目新增 add param:{}", JSONObject.toJSONString(projectAddDto));
         return projectService.add(projectAddDto, response);
         return projectService.add(projectAddDto, response);
     }
     }
@@ -47,7 +49,7 @@ public class ProjectController {
     @Log(description = "项目详情")
     @Log(description = "项目详情")
     @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RequestMapping(name = "项目详情", value = "/detail", method = RequestMethod.GET)
     @RequestMapping(name = "项目详情", value = "/detail", method = RequestMethod.GET)
-    public HttpResult detail(@RequestParam("id") @NotBlank(message = "数据id不能为空") String id, HttpResponse response) {
+    public HttpResult detail(@RequestParam("id") @NotBlank(message = "数据id不能为空") String id, HttpServletRequest response) {
         log.info("项目详情 detail param:{}", id);
         log.info("项目详情 detail param:{}", id);
         return projectService.detail(id, response);
         return projectService.detail(id, response);
     }
     }
@@ -55,7 +57,7 @@ public class ProjectController {
     @Log(description = "项目编辑")
     @Log(description = "项目编辑")
     @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RequestMapping(name = "项目编辑", value = "/update", method = RequestMethod.POST)
     @RequestMapping(name = "项目编辑", value = "/update", method = RequestMethod.POST)
-    public HttpResult update(@Valid @RequestBody ProjectUpdateDTO projectAddDto, HttpResponse response) {
+    public HttpResult update(@Valid @RequestBody ProjectUpdateDTO projectAddDto, HttpServletRequest response) {
         log.info("项目编辑 update param:{}", JSONObject.toJSONString(projectAddDto));
         log.info("项目编辑 update param:{}", JSONObject.toJSONString(projectAddDto));
         return projectService.update(projectAddDto, response);
         return projectService.update(projectAddDto, response);
     }
     }
@@ -63,16 +65,32 @@ public class ProjectController {
     @Log(description = "项目删除")
     @Log(description = "项目删除")
     @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RequestMapping(name = "项目删除", value = "/dels", method = RequestMethod.DELETE)
     @RequestMapping(name = "项目删除", value = "/dels", method = RequestMethod.DELETE)
-    public HttpResult dels(@RequestParam("ids") @NotBlank(message = "数据id不能为空") String ids, HttpResponse response) {
+    public HttpResult dels(@RequestParam("ids") @NotBlank(message = "数据id不能为空") String ids, HttpServletRequest request) {
         log.info("项目删除 delete param:{}", ids);
         log.info("项目删除 delete param:{}", ids);
-        return projectService.dels(ids, response);
+        return projectService.dels(ids, request);
     }
     }
 
 
     @Log(description = "项目监测要素项")
     @Log(description = "项目监测要素项")
     @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
     @RequestMapping(name = "项目监测要素项", value = "/monitorItem", method = RequestMethod.GET)
     @RequestMapping(name = "项目监测要素项", value = "/monitorItem", method = RequestMethod.GET)
-    public HttpResult monitorItem(@RequestParam("id") @NotBlank(message = "数据id不能为空") String id, HttpResponse response) {
+    public HttpResult monitorItem(@RequestParam("id") @NotBlank(message = "数据id不能为空") String id, HttpServletRequest request) {
         log.info("项目监测要素项 select param:{}", id);
         log.info("项目监测要素项 select param:{}", id);
-        return projectService.monitorItem(id, response);
+        return projectService.monitorItem(id, request);
+    }
+
+    @Log(description = "设备组网查询")
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "设备组网查询", value = "/selectDevice", method = RequestMethod.POST)
+    public HttpResult selectDevice(@RequestBody @Valid  DeviceQuery deviceQuery) {
+        log.info("设备组网查询 select param:{}", JSONObject.toJSONString(deviceQuery));
+        return HttpResult.ok(projectService.selectDevice(deviceQuery));
+    }
+
+    @Log(description = "新增组网设备-关联设备")
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "新增组网设备-关联设备", value = "/deviceBind", method = RequestMethod.POST)
+    public HttpResult deviceBind(@RequestBody @Valid BindDevice bindDevice, HttpServletRequest request) {
+        log.info("新增组网设备-关联设备 deviceBind param:{}", JSONObject.toJSONString(bindDevice));
+        return projectService.deviceBind(bindDevice, request);
     }
     }
 }
 }

+ 29 - 2
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/ReportController.java

@@ -1,8 +1,17 @@
 package com.sckw.slope.detection.controller;
 package com.sckw.slope.detection.controller;
 
 
+import com.alibaba.fastjson2.JSONObject;
+import com.sckw.core.annotation.Log;
+import com.sckw.core.annotation.RepeatSubmit;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.slope.detection.model.param.StatementQuery;
+import com.sckw.slope.detection.service.ReportService;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotBlank;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
 
 
 /**
 /**
  * @author lfdc
  * @author lfdc
@@ -14,4 +23,22 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping("/report")
 @RequestMapping("/report")
 public class ReportController {
 public class ReportController {
 
 
+    @Autowired
+    ReportService reportService;
+
+    @Log(description = "报表查询")
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "报表查询", value = "/select", method = RequestMethod.POST)
+    public HttpResult select(@RequestBody @Valid StatementQuery query, HttpServletRequest request) {
+        log.info("报表查询 select param:{}", JSONObject.toJSONString(query));
+        return HttpResult.ok(reportService.select(query, request));
+    }
+
+    @Log(description = "模版详情")
+    @RepeatSubmit(interval = 3000, message = "两次请求间隔未超过3秒")
+    @RequestMapping(name = "模版详情", value = "/detail", method = RequestMethod.GET)
+    public HttpResult detail(@RequestParam("id") @NotBlank(message = "id不能为空") String id, HttpServletRequest request) {
+        log.info("模版详情 detail param:{}", id);
+        return reportService.detail(id, request);
+    }
 }
 }

+ 7 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsDeviceMapper.java

@@ -3,7 +3,11 @@ package com.sckw.slope.detection.dao.mysql;
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.slope.detection.model.dos.mysql.KwsDevice;
 import com.sckw.slope.detection.model.dos.mysql.KwsDevice;
+import com.sckw.slope.detection.model.dto.DeviceDataDTO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 
 @Mapper
 @Mapper
 @DS("mysql")
 @DS("mysql")
@@ -19,4 +23,7 @@ public interface KwsDeviceMapper extends BaseMapper<KwsDevice> {
     int updateByPrimaryKeySelective(KwsDevice record);
     int updateByPrimaryKeySelective(KwsDevice record);
 
 
     int updateByPrimaryKey(KwsDevice record);
     int updateByPrimaryKey(KwsDevice record);
+
+    List<DeviceDataDTO> selectDeviceAllNotDeviceRelation(@Param("projectId") String projectId);
+
 }
 }

+ 2 - 2
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsProjectDeviceMapper.java

@@ -4,7 +4,7 @@ import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.slope.detection.model.dos.mysql.KwsProjectDevice;
 import com.sckw.slope.detection.model.dos.mysql.KwsProjectDevice;
 import com.sckw.slope.detection.model.dto.BaseItemDTO;
 import com.sckw.slope.detection.model.dto.BaseItemDTO;
-import com.sckw.slope.detection.model.dto.IntegrationItemDTO;
+import com.sckw.slope.detection.model.vo.IntegrationItemVO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
@@ -27,5 +27,5 @@ public interface KwsProjectDeviceMapper extends BaseMapper<KwsProjectDevice> {
 
 
     List<BaseItemDTO> selectDataByProjectId(@Param("id") long id);
     List<BaseItemDTO> selectDataByProjectId(@Param("id") long id);
 
 
-    List<IntegrationItemDTO> selectIntegrationItemByProjectId(@Param("id") long id);
+    List<IntegrationItemVO> selectIntegrationItemByProjectId(@Param("id") long id);
 }
 }

+ 9 - 2
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsProjectMapper.java

@@ -3,9 +3,12 @@ package com.sckw.slope.detection.dao.mysql;
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.slope.detection.model.dos.mysql.KwsProject;
 import com.sckw.slope.detection.model.dos.mysql.KwsProject;
-import com.sckw.slope.detection.model.param.ProjectQueryDto;
+import com.sckw.slope.detection.model.param.DeviceQuery;
+import com.sckw.slope.detection.model.vo.ProjectDeviceVO;
+import com.sckw.slope.detection.model.param.ProjectQuery;
 import com.sckw.slope.detection.model.vo.ProjectVo;
 import com.sckw.slope.detection.model.vo.ProjectVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -15,9 +18,13 @@ public interface KwsProjectMapper extends BaseMapper<KwsProject> {
 
 
     /**
     /**
      * 分页查询
      * 分页查询
+     *
      * @param projectQueryDto
      * @param projectQueryDto
      * @return
      * @return
      */
      */
-    List<ProjectVo> selectByProjectParam(ProjectQueryDto projectQueryDto);
+    List<ProjectVo> selectByProjectParam(@Param("projectQueryDto") ProjectQuery projectQueryDto, @Param("companyId") String companyId);
 
 
+    List<ProjectDeviceVO> selectDeviceByProjectId(@Param("projectId") Long projectId);
+
+    List<ProjectDeviceVO> selectDeviceList(@Param("deviceQuery") DeviceQuery deviceQuery);
 }
 }

+ 12 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsReportTemplateMapper.java

@@ -3,7 +3,13 @@ package com.sckw.slope.detection.dao.mysql;
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate;
 import com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate;
+import com.sckw.slope.detection.model.param.StatementQuery;
+import com.sckw.slope.detection.model.vo.ReportDetailVO;
+import com.sckw.slope.detection.model.vo.ReportStatementVO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 
 @Mapper
 @Mapper
 @DS("mysql")
 @DS("mysql")
@@ -19,4 +25,10 @@ public interface KwsReportTemplateMapper extends BaseMapper<KwsReportTemplate> {
     int updateByPrimaryKeySelective(KwsReportTemplate record);
     int updateByPrimaryKeySelective(KwsReportTemplate record);
 
 
     int updateByPrimaryKey(KwsReportTemplate record);
     int updateByPrimaryKey(KwsReportTemplate record);
+
+    List<ReportStatementVO> selectListByReportNameAndProjectIdAndCompany(@Param("query") StatementQuery query, @Param("companyId") String companyId);
+
+    List<ReportStatementVO> selectListByReportNameAndProjectId(@Param("query") StatementQuery query, @Param("companyId") String companyId);
+
+    ReportDetailVO selectDataAndTemplate(@Param("id") Long id);
 }
 }

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsAlarm.java

@@ -21,6 +21,11 @@ public class KwsAlarm implements Serializable {
      */
      */
     private Long pid;
     private Long pid;
 
 
+    /**
+     * 企业id
+     */
+    private String companyId;
+
     /**
     /**
      * 告警标题
      * 告警标题
      */
      */

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDevice.java

@@ -23,6 +23,11 @@ public class KwsDevice implements Serializable {
      */
      */
     private Integer attribute;
     private Integer attribute;
 
 
+    /**
+     * 企业id
+     */
+    private String companyId;
+
     /**
     /**
      * 设备名
      * 设备名
      */
      */

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDeviceIntegration.java

@@ -20,6 +20,11 @@ public class KwsDeviceIntegration implements Serializable {
     */
     */
     private Long deviceId;
     private Long deviceId;
 
 
+    /**
+     * 企业id
+     */
+    private String companyId;
+
     /**
     /**
     * 集成要素id
     * 集成要素id
     */
     */

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDeviceModel.java

@@ -21,6 +21,11 @@ public class KwsDeviceModel implements Serializable {
      */
      */
     private String identifyCode;
     private String identifyCode;
 
 
+    /**
+     * 企业id
+     */
+    private String companyId;
+
     /**
     /**
      * 设备类型(字典表value)
      * 设备类型(字典表value)
      */
      */

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDeviceReference.java

@@ -24,6 +24,11 @@ public class KwsDeviceReference implements Serializable {
     */
     */
     private Long deviceId;
     private Long deviceId;
 
 
+    /**
+     * 企业id
+     */
+    private String companyId;
+
     /**
     /**
     * 基准项
     * 基准项
     */
     */

+ 10 - 5
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDeviceRelation.java

@@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
-import java.util.Date;
+import java.time.LocalDateTime;
 
 
 /**
 /**
  * @author lfdc
  * @author lfdc
@@ -21,6 +21,11 @@ public class KwsDeviceRelation implements Serializable {
      */
      */
     private Long deviceId;
     private Long deviceId;
 
 
+    /**
+     * 企业id
+     */
+    private String companyId;
+
     /**
     /**
      * 关联的设备id
      * 关联的设备id
      */
      */
@@ -29,7 +34,7 @@ public class KwsDeviceRelation implements Serializable {
     /**
     /**
      * 状态
      * 状态
      */
      */
-    private Byte status;
+    private int status;
 
 
     /**
     /**
      * 创建人
      * 创建人
@@ -39,7 +44,7 @@ public class KwsDeviceRelation implements Serializable {
     /**
     /**
      * 创建时间
      * 创建时间
      */
      */
-    private Date createTime;
+    private LocalDateTime createTime;
 
 
     /**
     /**
      * 修改人
      * 修改人
@@ -49,12 +54,12 @@ public class KwsDeviceRelation implements Serializable {
     /**
     /**
      * 修改时间
      * 修改时间
      */
      */
-    private Date updateTime;
+    private LocalDateTime updateTime;
 
 
     /**
     /**
      * 删除标识
      * 删除标识
      */
      */
-    private Byte delFlag;
+    private int delFlag;
 
 
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsIntegration.java

@@ -19,6 +19,11 @@ public class KwsIntegration implements Serializable {
      */
      */
     private String integrationName;
     private String integrationName;
 
 
+    /**
+     * 企业id
+     */
+    private String companyId;
+
     /**
     /**
      * 要素名称字符串
      * 要素名称字符串
      */
      */

+ 5 - 40
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsLog.java

@@ -21,6 +21,11 @@ public class KwsLog implements Serializable {
      */
      */
     private String type;
     private String type;
 
 
+    /**
+     * 企业id
+     */
+    private String companyId;
+
     /**
     /**
      * 操作内容
      * 操作内容
      */
      */
@@ -37,44 +42,4 @@ public class KwsLog implements Serializable {
     private Date createTime;
     private Date createTime;
 
 
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getType() {
-        return type;
-    }
-
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    public String getContent() {
-        return content;
-    }
-
-    public void setContent(String content) {
-        this.content = content;
-    }
-
-    public Long getCreateBy() {
-        return createBy;
-    }
-
-    public void setCreateBy(Long createBy) {
-        this.createBy = createBy;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
 }
 }

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsProject.java

@@ -22,6 +22,11 @@ public class KwsProject implements Serializable {
      */
      */
     private String name;
     private String name;
 
 
+    /**
+     * 企业id
+     */
+    private String companyId;
+
     /**
     /**
      * 所属矿山id
      * 所属矿山id
      */
      */

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsProjectArea.java

@@ -22,6 +22,11 @@ public class KwsProjectArea implements Serializable {
      */
      */
     private Long projectId;
     private Long projectId;
 
 
+    /**
+     * 企业id
+     */
+    private String companyId;
+
     /**
     /**
      * 选中区域
      * 选中区域
      */
      */

+ 12 - 77
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsProjectDevice.java

@@ -1,10 +1,11 @@
 package com.sckw.slope.detection.model.dos.mysql;
 package com.sckw.slope.detection.model.dos.mysql;
 
 
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
-import java.util.Date;
+import java.time.LocalDateTime;
 
 
 
 
 /**
 /**
@@ -22,6 +23,11 @@ public class KwsProjectDevice implements Serializable {
      */
      */
     private Long projectId;
     private Long projectId;
 
 
+    /**
+     * 企业id
+     */
+    private String companyId;
+
     /**
     /**
      * 设备id
      * 设备id
      */
      */
@@ -30,7 +36,7 @@ public class KwsProjectDevice implements Serializable {
     /**
     /**
      * 状态
      * 状态
      */
      */
-    private Byte status;
+    private int status;
 
 
     /**
     /**
      * 创建人
      * 创建人
@@ -40,7 +46,7 @@ public class KwsProjectDevice implements Serializable {
     /**
     /**
      * 创建时间
      * 创建时间
      */
      */
-    private Date createTime;
+    private LocalDateTime createTime;
 
 
     /**
     /**
      * 修改人
      * 修改人
@@ -50,84 +56,13 @@ public class KwsProjectDevice implements Serializable {
     /**
     /**
      * 修改时间
      * 修改时间
      */
      */
-    private Date updateTime;
+    private LocalDateTime updateTime;
 
 
     /**
     /**
      * 删除标识
      * 删除标识
      */
      */
-    private Byte delFlag;
+    @TableLogic(value = "0")
+    private int delFlag;
 
 
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getProjectId() {
-        return projectId;
-    }
-
-    public void setProjectId(Long projectId) {
-        this.projectId = projectId;
-    }
-
-    public Long getDeviceId() {
-        return deviceId;
-    }
-
-    public void setDeviceId(Long deviceId) {
-        this.deviceId = deviceId;
-    }
-
-    public Byte getStatus() {
-        return status;
-    }
-
-    public void setStatus(Byte status) {
-        this.status = status;
-    }
-
-    public Long getCreateBy() {
-        return createBy;
-    }
-
-    public void setCreateBy(Long createBy) {
-        this.createBy = createBy;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public Long getUpdateBy() {
-        return updateBy;
-    }
-
-    public void setUpdateBy(Long updateBy) {
-        this.updateBy = updateBy;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public Byte getDelFlag() {
-        return delFlag;
-    }
-
-    public void setDelFlag(Byte delFlag) {
-        this.delFlag = delFlag;
-    }
 }
 }

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsReportData.java

@@ -22,6 +22,11 @@ public class KwsReportData implements Serializable {
      */
      */
     private Long templateId;
     private Long templateId;
 
 
+    /**
+     * 企业id
+     */
+    private String companyId;
+
     /**
     /**
      * 矿山项目id
      * 矿山项目id
      */
      */

+ 14 - 90
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsReportTemplate.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
+import java.time.LocalDateTime;
 import java.util.Date;
 import java.util.Date;
 
 
 
 
@@ -22,6 +23,16 @@ public class KwsReportTemplate implements Serializable {
      */
      */
     private String name;
     private String name;
 
 
+    /**
+     * 企业id
+     */
+    private String companyId;
+
+    /**
+     * 制表时间
+     */
+    private String tabulationTime;
+
     /**
     /**
      * 模版类型
      * 模版类型
      */
      */
@@ -40,7 +51,7 @@ public class KwsReportTemplate implements Serializable {
     /**
     /**
      * 状态
      * 状态
      */
      */
-    private Byte status;
+    private int status;
 
 
     /**
     /**
      * 创建人
      * 创建人
@@ -50,7 +61,7 @@ public class KwsReportTemplate implements Serializable {
     /**
     /**
      * 创建时间
      * 创建时间
      */
      */
-    private Date createTime;
+    private LocalDateTime createTime;
 
 
     /**
     /**
      * 修改人
      * 修改人
@@ -65,95 +76,8 @@ public class KwsReportTemplate implements Serializable {
     /**
     /**
      * 删除标识
      * 删除标识
      */
      */
-    private Byte delFlag;
+    private int delFlag;
 
 
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public Integer getType() {
-        return type;
-    }
-
-    public void setType(Integer type) {
-        this.type = type;
-    }
-
-    public String getPartNames() {
-        return partNames;
-    }
-
-    public void setPartNames(String partNames) {
-        this.partNames = partNames;
-    }
-
-    public String getIntergrationNames() {
-        return intergrationNames;
-    }
-
-    public void setIntergrationNames(String intergrationNames) {
-        this.intergrationNames = intergrationNames;
-    }
-
-    public Byte getStatus() {
-        return status;
-    }
-
-    public void setStatus(Byte status) {
-        this.status = status;
-    }
-
-    public Long getCreateBy() {
-        return createBy;
-    }
-
-    public void setCreateBy(Long createBy) {
-        this.createBy = createBy;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public Long getUpdateBy() {
-        return updateBy;
-    }
-
-    public void setUpdateBy(Long updateBy) {
-        this.updateBy = updateBy;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public Byte getDelFlag() {
-        return delFlag;
-    }
-
-    public void setDelFlag(Byte delFlag) {
-        this.delFlag = delFlag;
-    }
 }
 }

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsThreshold.java

@@ -26,6 +26,11 @@ public class KwsThreshold implements Serializable {
      */
      */
     private String itemName;
     private String itemName;
 
 
+    /**
+     * 企业id
+     */
+    private String companyId;
+
     /**
     /**
      * 阈值等级
      * 阈值等级
      */
      */

+ 31 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/BindDevice.java

@@ -0,0 +1,31 @@
+package com.sckw.slope.detection.model.dto;
+
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author lfdc
+ * @description 绑定设备
+ * @date 2023-10-31 14:10:20
+ */
+@Data
+public class BindDevice implements Serializable {
+
+    /**
+     * 项目ID
+     */
+    @NotBlank(message = "项目id不能为空")
+    private String projectId;
+    /**
+     * 设备id集,多个ID以逗号隔开
+     */
+    @NotBlank(message = "设备id集不能为空")
+    private String deviceIds;
+    /**
+     * 所属设备ID
+     */
+//    @NotBlank(message = "所属设备ID不能为空")
+    private String bindDeviceId;
+}

+ 28 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/DeviceDataDTO.java

@@ -0,0 +1,28 @@
+package com.sckw.slope.detection.model.dto;
+
+import lombok.Data;
+
+/**
+ * @author lfdc
+ * @description 设备信息
+ * @date 2023-10-31 16:10:55
+ */
+@Data
+public class DeviceDataDTO {
+
+    /**
+     * 设备id
+     */
+    private String deviceId;
+
+    /**
+     * 设备名称
+     */
+    private String deviceName;
+
+    /**
+     * 别名
+     */
+    private String deviceAlias;
+
+}

+ 40 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/HeaderData.java

@@ -0,0 +1,40 @@
+package com.sckw.slope.detection.model.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author lfdc
+ * @description 请求头数据
+ * @date 2023-10-31 09:10:02
+ */
+@Data
+public class HeaderData implements Serializable {
+    /**
+     * 企业id
+     */
+    private String companyId;
+    /**
+     * 企业名称
+     */
+    private String companyName;
+    /**
+     * 创建人-userid
+     */
+    private String createBy;
+    /**
+     * 创建人-姓名
+     */
+    private String createName;
+    /**
+     * 修改人-userid
+     */
+    private String updateBy;
+    /**
+     * 修改人-姓名
+     */
+    private String updateName;
+
+
+}

+ 6 - 4
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/ProjectAddDTO.java

@@ -1,6 +1,7 @@
 package com.sckw.slope.detection.model.dto;
 package com.sckw.slope.detection.model.dto;
 
 
 import jakarta.validation.constraints.NotBlank;
 import jakarta.validation.constraints.NotBlank;
+import lombok.Builder;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
@@ -11,6 +12,7 @@ import java.io.Serializable;
  * @date 2023-10-30 13:10:38
  * @date 2023-10-30 13:10:38
  */
  */
 @Data
 @Data
+@Builder
 public class ProjectAddDTO implements Serializable {
 public class ProjectAddDTO implements Serializable {
 
 
     /**
     /**
@@ -28,25 +30,25 @@ public class ProjectAddDTO implements Serializable {
     /**
     /**
      * 所属矿山id
      * 所属矿山id
      */
      */
-    @NotBlank(message = "项目区域不能为空")
+    @NotBlank(message = "所属矿山id不能为空")
     private String mountainId;
     private String mountainId;
 
 
     /**
     /**
      * 所属矿山名
      * 所属矿山名
      */
      */
-    @NotBlank(message = "项目区域不能为空")
+    @NotBlank(message = "所属矿山名不能为空")
     private String mountainName;
     private String mountainName;
 
 
     /**
     /**
      * 省级平台名
      * 省级平台名
      */
      */
-    @NotBlank(message = "项目区域不能为空")
+    @NotBlank(message = "省级平台名不能为空")
     private String platformName;
     private String platformName;
 
 
     /**
     /**
      * 省级平台地址(url)
      * 省级平台地址(url)
      */
      */
-    @NotBlank(message = "项目区域不能为空")
+    @NotBlank(message = "省级平台地址不能为空")
     private String platformAddress;
     private String platformAddress;
 
 
     /**
     /**

+ 43 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/DeviceQuery.java

@@ -0,0 +1,43 @@
+package com.sckw.slope.detection.model.param;
+
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+
+/**
+ * @author lfdc
+ * @description 设备查询
+ * @date 2023-10-31 15:10:14
+ */
+@Data
+public class DeviceQuery {
+
+    /**
+     * 项目名称
+     */
+    @NotBlank(message = "项目id不能为空")
+    private String projectId;
+
+    /**
+     * 项目名称
+     */
+    private String projectName;
+
+    /**
+     * 厂商
+     */
+    private String manufacturer;
+
+    /**
+     * 设备名称
+     */
+    private String name;
+
+    /**
+     * 设备类型
+     */
+    private String deviceType;
+
+    private int page;
+
+    private int pageSize;
+}

+ 4 - 1
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/ProjectQueryDto.java → slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/ProjectQuery.java

@@ -10,9 +10,12 @@ import java.io.Serializable;
  * @date 2023-10-30 13:10:38
  * @date 2023-10-30 13:10:38
  */
  */
 @Data
 @Data
-public class ProjectQueryDto implements Serializable {
+public class ProjectQuery implements Serializable {
 
 
 
 
+    /**
+     * 项目名称
+     */
     private String name;
     private String name;
 
 
     private int page;
     private int page;

+ 52 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/param/StatementQuery.java

@@ -0,0 +1,52 @@
+package com.sckw.slope.detection.model.param;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+/**
+ * @author lfdc
+ * @description 报表查询
+ * @date 2023-10-31 10:10:34
+ */
+@Data
+public class StatementQuery {
+    /**
+     * 报表名称
+     */
+    private String reportName;
+    /**
+     * 项目id
+     */
+    @NotBlank(message = "项目id不能为空")
+    private String projectId;
+    /**
+     * 项目名称
+     */
+    @NotBlank(message = "项目名称不能为空")
+    private String projectName;
+
+    /**
+     * 报表类型
+     */
+    private String reportType;
+
+    private int page;
+
+    private int pageSize;
+
+    /**
+     * 开始时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private String startTime;
+
+    /**
+     * 结束时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private String endTime;
+}

+ 2 - 2
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/IntegrationItemDTO.java → slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/IntegrationItemVO.java

@@ -1,4 +1,4 @@
-package com.sckw.slope.detection.model.dto;
+package com.sckw.slope.detection.model.vo;
 
 
 import lombok.Data;
 import lombok.Data;
 
 
@@ -10,7 +10,7 @@ import java.io.Serializable;
  * @date 2023-10-30 17:10:10
  * @date 2023-10-30 17:10:10
  */
  */
 @Data
 @Data
-public class IntegrationItemDTO implements Serializable {
+public class IntegrationItemVO implements Serializable {
     /**
     /**
      * 集成要素id
      * 集成要素id
      */
      */

+ 67 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ProjectDeviceVO.java

@@ -0,0 +1,67 @@
+package com.sckw.slope.detection.model.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * @author lfdc
+ * @description 项目关联的设备信息
+ * @date 2023-10-31 09:10:54
+ */
+@NoArgsConstructor
+@Data
+public class ProjectDeviceVO implements Serializable {
+
+    /**
+     * 设备型号主键ID
+     */
+    private String id;
+    /**
+     * 设备名称
+     */
+    private String name;
+
+    /**
+     * 项目ID
+     */
+    private String projectId;
+    /**
+     * 项目名称
+     */
+    private String projectName;
+
+    /**
+     * 产品类型
+     */
+    private String deviceType;
+
+    /**
+     * 厂商
+     */
+    private String manufacturer;
+
+    /**
+     * 型号
+     */
+    private String modelName;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime createTime;
+
+    /**
+     * 所属主设备id
+     */
+    private String parentId;
+
+    /**
+     * 所属主设备名称
+     */
+    private String parentName;
+}

+ 46 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ReportDetailVO.java

@@ -0,0 +1,46 @@
+package com.sckw.slope.detection.model.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * @author lfdc
+ * @description 模板详情
+ * @date 2023-10-31 11:10:30
+ */
+@NoArgsConstructor
+@Data
+public class ReportDetailVO implements Serializable {
+
+    /**
+     * 项目名
+     */
+    private String name;
+    /**
+     * 类型
+     */
+    private String type;
+    /**
+     * 集成分析方案名字符串
+     */
+    private String intergrationNames;
+    /**
+     * 生效状态
+     */
+    private String status;
+    /**
+     * 要素名字符串
+     */
+    private String partNames;
+    /**
+     * 模版ID
+     */
+    private String id;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime createTime;
+}

+ 50 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ReportStatementVO.java

@@ -0,0 +1,50 @@
+package com.sckw.slope.detection.model.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * @author lfdc
+ * @description 报表查询返回vo
+ * @date 2023-10-31 10:10:52
+ */
+@NoArgsConstructor
+@Data
+public class ReportStatementVO implements Serializable {
+
+    /**
+     * 项目主键ID
+     */
+    private String id;
+    /**
+     * 状态
+     */
+    private String status;
+    /**
+     * 报表名称
+     */
+    private String reportName;
+    /**
+     * 报表类型
+     */
+    private String reportType;
+    /**
+     * 项目名称
+     */
+    private String projectName;
+    /**
+     * 制表时间
+     */
+    private String tabulationTime;
+    /**
+     * 项目ID
+     */
+    private String projectId;
+
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private LocalDateTime createTime;
+}

+ 31 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/CommonService.java

@@ -0,0 +1,31 @@
+package com.sckw.slope.detection.service;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.sckw.core.exception.BusinessException;
+import com.sckw.slope.detection.model.dto.HeaderData;
+import jakarta.servlet.http.HttpServletRequest;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.Base64;
+
+/**
+ * @author lfdc
+ * @description 公共CommonService
+ * @date 2023-10-31 09:10:00
+ */
+@Slf4j
+@Service
+public class CommonService {
+
+    public HeaderData getHeaderData(HttpServletRequest request) {
+        String uInfo = request.getHeader("u_info");
+        if (StringUtils.isBlank(uInfo)) {
+            throw new BusinessException("数据请求异常!");
+        }
+        String message = new String(Base64.getDecoder().decode(uInfo));
+        HeaderData headerData = JSONObject.parseObject(message, HeaderData.class);
+        return headerData;
+    }
+}

+ 46 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/DeviceService.java

@@ -0,0 +1,46 @@
+package com.sckw.slope.detection.service;
+
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.sckw.core.exception.BusinessException;
+import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.slope.detection.dao.mysql.KwsDeviceMapper;
+import com.sckw.slope.detection.model.dos.mysql.KwsDevice;
+import com.sckw.slope.detection.model.dto.DeviceDataDTO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * @author lfdc
+ * @description 设备service
+ * @date 2023-10-31 10:10:27
+ */
+@Slf4j
+@Service
+public class DeviceService {
+
+    @Autowired
+    KwsDeviceMapper deviceMapper;
+
+    @Transactional
+    public HttpResult dels(String ids) {
+        List<Long> list = StringUtils.splitStrToList(ids, Long.class);
+        int update = deviceMapper.update(null, new LambdaUpdateWrapper<KwsDevice>()
+                .in(KwsDevice::getId, list)
+                .set(KwsDevice::getDelFlag, "1"));
+        if (update < 1) {
+            throw new BusinessException("删除设备异常");
+        }
+        return HttpResult.ok("删除设备成功");
+    }
+
+    public HttpResult deviceAll(String projectId) {
+        //设备至关联多只支持两层结构,因此子级设备不能在【所属设备名称】中被查询出来
+        List<DeviceDataDTO> list = deviceMapper.selectDeviceAllNotDeviceRelation(projectId);
+        return HttpResult.ok(list);
+    }
+}

+ 108 - 21
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ProjectService.java

@@ -11,18 +11,23 @@ import com.sckw.core.model.page.PageRes;
 import com.sckw.core.utils.IdWorker;
 import com.sckw.core.utils.IdWorker;
 import com.sckw.core.utils.StringUtils;
 import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.core.web.response.HttpResult;
+import com.sckw.slope.detection.dao.mysql.KwsDeviceReferenceMapper;
+import com.sckw.slope.detection.dao.mysql.KwsDeviceRelationMapper;
 import com.sckw.slope.detection.dao.mysql.KwsProjectDeviceMapper;
 import com.sckw.slope.detection.dao.mysql.KwsProjectDeviceMapper;
 import com.sckw.slope.detection.dao.mysql.KwsProjectMapper;
 import com.sckw.slope.detection.dao.mysql.KwsProjectMapper;
+import com.sckw.slope.detection.model.dos.mysql.KwsDeviceRelation;
 import com.sckw.slope.detection.model.dos.mysql.KwsProject;
 import com.sckw.slope.detection.model.dos.mysql.KwsProject;
 import com.sckw.slope.detection.model.dos.mysql.KwsProjectDevice;
 import com.sckw.slope.detection.model.dos.mysql.KwsProjectDevice;
-import com.sckw.slope.detection.model.dto.BaseItemDTO;
-import com.sckw.slope.detection.model.dto.IntegrationItemDTO;
-import com.sckw.slope.detection.model.dto.ProjectAddDTO;
-import com.sckw.slope.detection.model.dto.ProjectUpdateDTO;
-import com.sckw.slope.detection.model.param.ProjectQueryDto;
+import com.sckw.slope.detection.model.dto.*;
+import com.sckw.slope.detection.model.param.DeviceQuery;
+import com.sckw.slope.detection.model.param.ProjectQuery;
+import com.sckw.slope.detection.model.vo.IntegrationItemVO;
+import com.sckw.slope.detection.model.vo.ProjectDeviceVO;
 import com.sckw.slope.detection.model.vo.ProjectVo;
 import com.sckw.slope.detection.model.vo.ProjectVo;
+import com.sckw.slope.detection.service.repository.KwsDeviceRelationRepository;
+import com.sckw.slope.detection.service.repository.KwsProjectDeviceRepository;
+import jakarta.servlet.http.HttpServletRequest;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.http.HttpResponse;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -30,6 +35,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.CollectionUtils;
 
 
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -41,30 +47,47 @@ import java.util.List;
 @Service
 @Service
 public class ProjectService {
 public class ProjectService {
 
 
+    @Autowired
+    CommonService commonService;
+
     @Autowired
     @Autowired
     KwsProjectMapper projectMapper;
     KwsProjectMapper projectMapper;
 
 
     @Autowired
     @Autowired
     KwsProjectDeviceMapper projectDeviceMapper;
     KwsProjectDeviceMapper projectDeviceMapper;
 
 
+    @Autowired
+    KwsProjectDeviceRepository projectDeviceRepository;
+
+    @Autowired
+    KwsDeviceReferenceMapper deviceReferenceMapper;
+
+    @Autowired
+    KwsDeviceRelationMapper deviceRelationMapper;
+
+    @Autowired
+    KwsDeviceRelationRepository deviceRelationRepository;
+
     /**
     /**
      * 新增项目
      * 新增项目
      *
      *
      * @param projectAddDto 请求参数
      * @param projectAddDto 请求参数
-     * @param response      http流
+     * @param request       http流
      * @return 返回值
      * @return 返回值
      */
      */
     @Transactional
     @Transactional
-    public HttpResult add(ProjectAddDTO projectAddDto, HttpResponse response) {
+    public HttpResult add(ProjectAddDTO projectAddDto, HttpServletRequest request) {
+        HeaderData headerData = commonService.getHeaderData(request);
         KwsProject project = new KwsProject();
         KwsProject project = new KwsProject();
         BeanUtils.copyProperties(projectAddDto, project);
         BeanUtils.copyProperties(projectAddDto, project);
         project.setId(new IdWorker(NumberConstant.ONE).nextId());
         project.setId(new IdWorker(NumberConstant.ONE).nextId());
         project.setStatus(NumberConstant.ZERO);
         project.setStatus(NumberConstant.ZERO);
-        project.setCreateBy(0L);
+        project.setCreateBy(Long.parseLong(headerData.getCreateBy()));
         LocalDateTime now = LocalDateTime.now();
         LocalDateTime now = LocalDateTime.now();
         project.setCreateTime(now);
         project.setCreateTime(now);
-        project.setUpdateBy(0L);
+        project.setUpdateBy(Long.parseLong(headerData.getUpdateBy()));
         project.setUpdateTime(now);
         project.setUpdateTime(now);
+        project.setCompanyId(headerData.getCompanyId());
         projectMapper.insert(project);
         projectMapper.insert(project);
         return HttpResult.ok();
         return HttpResult.ok();
     }
     }
@@ -76,9 +99,9 @@ public class ProjectService {
      * @param response        http流
      * @param response        http流
      * @return 返回值
      * @return 返回值
      */
      */
-    public PageRes select(ProjectQueryDto projectQueryDto, HttpResponse response) {
+    public PageRes select(ProjectQuery projectQueryDto, HttpServletRequest response) {
         PageHelper.startPage(projectQueryDto.getPage(), projectQueryDto.getPageSize());
         PageHelper.startPage(projectQueryDto.getPage(), projectQueryDto.getPageSize());
-        List<ProjectVo> list = projectMapper.selectByProjectParam(projectQueryDto);
+        List<ProjectVo> list = projectMapper.selectByProjectParam(projectQueryDto, commonService.getHeaderData(response).getCompanyId());
         PageInfo<ProjectVo> pageInfo = new PageInfo<>(list);
         PageInfo<ProjectVo> pageInfo = new PageInfo<>(list);
         if (CollectionUtils.isEmpty(list)) {
         if (CollectionUtils.isEmpty(list)) {
             return PageRes.build(pageInfo, list);
             return PageRes.build(pageInfo, list);
@@ -89,16 +112,17 @@ public class ProjectService {
         return PageRes.build(pageInfo, list);
         return PageRes.build(pageInfo, list);
     }
     }
 
 
-    public HttpResult detail(String id, HttpResponse response) {
+    public HttpResult detail(String id, HttpServletRequest response) {
         KwsProject project = projectMapper.selectOne(new LambdaQueryWrapper<KwsProject>()
         KwsProject project = projectMapper.selectOne(new LambdaQueryWrapper<KwsProject>()
-                .eq(KwsProject::getId, id));
+                .eq(KwsProject::getId, id)
+                .eq(KwsProject::getCompanyId, commonService.getHeaderData(response).getCompanyId()));
         ProjectVo vo = new ProjectVo();
         ProjectVo vo = new ProjectVo();
         BeanUtils.copyProperties(project, vo);
         BeanUtils.copyProperties(project, vo);
         return HttpResult.ok(vo);
         return HttpResult.ok(vo);
     }
     }
 
 
     @Transactional
     @Transactional
-    public HttpResult update(ProjectUpdateDTO projectAddDto, HttpResponse response) {
+    public HttpResult update(ProjectUpdateDTO projectAddDto, HttpServletRequest response) {
         KwsProject project = new KwsProject();
         KwsProject project = new KwsProject();
         BeanUtils.copyProperties(projectAddDto, project);
         BeanUtils.copyProperties(projectAddDto, project);
         project.setId(new IdWorker(NumberConstant.ONE).nextId());
         project.setId(new IdWorker(NumberConstant.ONE).nextId());
@@ -106,14 +130,14 @@ public class ProjectService {
         project.setCreateBy(0L);
         project.setCreateBy(0L);
         LocalDateTime now = LocalDateTime.now();
         LocalDateTime now = LocalDateTime.now();
         project.setCreateTime(now);
         project.setCreateTime(now);
-        project.setUpdateBy(0L);
+        project.setUpdateBy(Long.parseLong(commonService.getHeaderData(response).getUpdateBy()));
         project.setUpdateTime(now);
         project.setUpdateTime(now);
         projectMapper.updateById(project);
         projectMapper.updateById(project);
         return HttpResult.ok();
         return HttpResult.ok();
     }
     }
 
 
     @Transactional
     @Transactional
-    public HttpResult dels(String ids, HttpResponse response) {
+    public HttpResult dels(String ids, HttpServletRequest request) {
         List<Long> list = StringUtils.splitStrToList(ids, Long.class);
         List<Long> list = StringUtils.splitStrToList(ids, Long.class);
         int update = projectMapper.update(null, new LambdaUpdateWrapper<KwsProject>().in(KwsProject::getId, list).set(KwsProject::getDelFlag, "1"));
         int update = projectMapper.update(null, new LambdaUpdateWrapper<KwsProject>().in(KwsProject::getId, list).set(KwsProject::getDelFlag, "1"));
         if (update < 1) {
         if (update < 1) {
@@ -122,13 +146,76 @@ public class ProjectService {
         return HttpResult.ok();
         return HttpResult.ok();
     }
     }
 
 
-    public HttpResult monitorItem(String id, HttpResponse response) {
+    public HttpResult monitorItem(String id, HttpServletRequest request) {
+        String companyId = commonService.getHeaderData(request).getCompanyId();
         //查询基本要素
         //查询基本要素
         List<BaseItemDTO> baseItem = projectDeviceMapper.selectDataByProjectId(Long.parseLong(id));
         List<BaseItemDTO> baseItem = projectDeviceMapper.selectDataByProjectId(Long.parseLong(id));
-        List<IntegrationItemDTO> integrationItem = projectDeviceMapper.selectIntegrationItemByProjectId(Long.parseLong(id));
+        List<IntegrationItemVO> integrationItem = projectDeviceMapper.selectIntegrationItemByProjectId(Long.parseLong(id));
         JSONObject jsonObject = new JSONObject();
         JSONObject jsonObject = new JSONObject();
-        jsonObject.put("baseItem",baseItem);
-        jsonObject.put("integrationItem",integrationItem);
+        jsonObject.put("baseItem", baseItem);
+        jsonObject.put("integrationItem", integrationItem);
         return HttpResult.ok(jsonObject);
         return HttpResult.ok(jsonObject);
     }
     }
+
+    public PageRes selectDevice(DeviceQuery deviceQuery) {
+        PageHelper.startPage(deviceQuery.getPage(), deviceQuery.getPageSize());
+//        List<ProjectDeviceVO> list = projectMapper.selectDeviceByProjectId(Long.parseLong(deviceQuery.getProjectId()));
+        List<ProjectDeviceVO> list = projectMapper.selectDeviceList(deviceQuery);
+        PageInfo<ProjectDeviceVO> info = new PageInfo<>(list);
+        if (CollectionUtils.isEmpty(list)) {
+            return PageRes.build(info, list);
+        }
+//        后期要数据翻译产品类型
+//        for (ProjectDeviceDTO projectDeviceDTO : list) {
+//
+//        }
+        return PageRes.build(info, list);
+    }
+
+    @Transactional
+    public HttpResult deviceBind(BindDevice bindDevice, HttpServletRequest request) {
+        HeaderData headerData = commonService.getHeaderData(request);
+        Long projectId = Long.parseLong(bindDevice.getProjectId());
+        KwsProject project = projectMapper.selectOne(new LambdaQueryWrapper<KwsProject>().eq(KwsProject::getId, projectId));
+        String companyId = project.getCompanyId();
+        List<Long> list = StringUtils.splitStrToList(bindDevice.getDeviceIds(), Long.class);
+        String bindDeviceId = bindDevice.getBindDeviceId();
+        //设备主从绑定
+        if (org.apache.commons.lang3.StringUtils.isNotBlank(bindDeviceId)) {
+            List<KwsDeviceRelation> saveList = new ArrayList<>();
+            list.forEach(id -> {
+                KwsDeviceRelation deviceRelation = new KwsDeviceRelation();
+                deviceRelation.setId(new IdWorker(NumberConstant.ONE).nextId());
+                deviceRelation.setDeviceId(Long.parseLong(bindDeviceId));
+                deviceRelation.setCompanyId(companyId);
+                deviceRelation.setRelateDeviceId(id);
+                deviceRelation.setStatus(NumberConstant.ZERO);
+                deviceRelation.setCreateBy(headerData.getCreateBy() == null ? null : Long.parseLong(headerData.getCreateBy()));
+                LocalDateTime now = LocalDateTime.now();
+                deviceRelation.setCreateTime(now);
+                deviceRelation.setUpdateBy(headerData.getCreateBy() == null ? null : Long.parseLong(headerData.getCreateBy()));
+                deviceRelation.setUpdateTime(now);
+                deviceRelation.setDelFlag(NumberConstant.ZERO);
+                saveList.add(deviceRelation);
+            });
+            deviceRelationRepository.saveBatch(saveList);
+        }
+        //矿山与设备绑定
+        if (!CollectionUtils.isEmpty(list)) {
+            list.forEach(id -> {
+                KwsProjectDevice device = new KwsProjectDevice();
+                device.setId(new IdWorker(NumberConstant.ONE).nextId());
+                device.setProjectId(projectId);
+                device.setDeviceId(id);
+                device.setStatus(NumberConstant.ONE);
+                device.setCreateBy(headerData.getCreateBy() == null ? null : Long.parseLong(headerData.getCreateBy()));
+                LocalDateTime now = LocalDateTime.now();
+                device.setCreateTime(now);
+                device.setUpdateBy(headerData.getUpdateBy() == null ? Long.parseLong(headerData.getCreateBy()) : Long.parseLong(headerData.getUpdateBy()));
+                device.setUpdateTime(now);
+                device.setCompanyId(headerData.getCompanyId());
+            });
+        }
+        return HttpResult.ok();
+    }
 }
 }

+ 62 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ReportService.java

@@ -0,0 +1,62 @@
+package com.sckw.slope.detection.service;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.sckw.core.common.enums.ReportEnum;
+import com.sckw.core.common.enums.ReportTypeEnum;
+import com.sckw.core.model.page.PageRes;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.slope.detection.dao.mysql.KwsReportDataMapper;
+import com.sckw.slope.detection.dao.mysql.KwsReportTemplateMapper;
+import com.sckw.slope.detection.model.param.StatementQuery;
+import com.sckw.slope.detection.model.vo.ReportDetailVO;
+import com.sckw.slope.detection.model.vo.ReportStatementVO;
+import jakarta.servlet.http.HttpServletRequest;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+
+/**
+ * @author lfdc
+ * @description 报表service
+ * @date 2023-10-31 10:10:39
+ */
+@Slf4j
+@Service
+public class ReportService {
+
+    @Autowired
+    CommonService commonService;
+
+    @Autowired
+    KwsReportDataMapper reportDataMapper;
+
+    @Autowired
+    KwsReportTemplateMapper reportTemplateMapper;
+
+    public PageRes select(StatementQuery query, HttpServletRequest request) {
+        PageHelper.startPage(query.getPage(), query.getPageSize());
+        String companyId = commonService.getHeaderData(request).getCompanyId();
+        List<ReportStatementVO> list = reportTemplateMapper.selectListByReportNameAndProjectIdAndCompany(query, companyId);
+        PageInfo<ReportStatementVO> info = new PageInfo<>(list);
+        if (CollectionUtils.isEmpty(list)) {
+            return PageRes.build(info, list);
+        }
+        for (ReportStatementVO reportStatementVO : list) {
+            reportStatementVO.setStatus(ReportEnum.getDescription(reportStatementVO.getStatus()));
+            reportStatementVO.setReportType(ReportTypeEnum.getDescription(reportStatementVO.getReportType()));
+        }
+        return PageRes.build(info, list);
+    }
+
+    public HttpResult detail(String id, HttpServletRequest request) {
+        ReportDetailVO vo = reportTemplateMapper.selectDataAndTemplate(Long.parseLong(id));
+        if (vo != null) {
+            vo.setType(ReportTypeEnum.getDescription(vo.getType()));
+        }
+        return HttpResult.ok(vo);
+    }
+}

+ 7 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/repository/KwsDeviceRelationRepository.java

@@ -0,0 +1,7 @@
+package com.sckw.slope.detection.service.repository;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sckw.slope.detection.model.dos.mysql.KwsDeviceRelation;
+
+public interface KwsDeviceRelationRepository extends IService<KwsDeviceRelation> {
+}

+ 7 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/repository/KwsProjectDeviceRepository.java

@@ -0,0 +1,7 @@
+package com.sckw.slope.detection.service.repository;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.sckw.slope.detection.model.dos.mysql.KwsProjectDevice;
+
+public interface KwsProjectDeviceRepository extends IService<KwsProjectDevice> {
+}

+ 17 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/repository/impl/KwsDeviceRelationImpl.java

@@ -0,0 +1,17 @@
+package com.sckw.slope.detection.service.repository.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sckw.slope.detection.dao.mysql.KwsDeviceRelationMapper;
+import com.sckw.slope.detection.model.dos.mysql.KwsDeviceRelation;
+import com.sckw.slope.detection.service.repository.KwsDeviceRelationRepository;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author lfdc
+ * @description
+ * @date 2023-10-31 14:10:49
+ */
+@Service
+public class KwsDeviceRelationImpl extends ServiceImpl<KwsDeviceRelationMapper, KwsDeviceRelation> implements KwsDeviceRelationRepository {
+
+}

+ 17 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/repository/impl/KwsProjectDeviceImpl.java

@@ -0,0 +1,17 @@
+package com.sckw.slope.detection.service.repository.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.sckw.slope.detection.dao.mysql.KwsProjectDeviceMapper;
+import com.sckw.slope.detection.model.dos.mysql.KwsProjectDevice;
+import com.sckw.slope.detection.service.repository.KwsProjectDeviceRepository;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author lfdc
+ * @description
+ * @date 2023-10-31 17:10:16
+ */
+@Service
+public class KwsProjectDeviceImpl extends ServiceImpl<KwsProjectDeviceMapper, KwsProjectDevice> implements KwsProjectDeviceRepository {
+
+}

+ 4 - 4
slope-modules/slope-detection/src/main/resources/bootstrap-lfdc.yml

@@ -28,13 +28,13 @@ mqtt:
     #完成超时时间
     #完成超时时间
     completionTimeout: 3000
     completionTimeout: 3000
     #通过mqtt发送消息验证所需用户名
     #通过mqtt发送消息验证所需用户名
-    username: test
+    username: sckw
     #通过mqtt发送消息验证所需密码
     #通过mqtt发送消息验证所需密码
-    password: test
+    password: sckw123456
     #连接的mqtt地址
     #连接的mqtt地址
-    url: tcp://10.10.10.225:1883
+    url: tcp://47.108.205.7:1883
     #客户端id
     #客户端id
-    clientId: mqttx_12411c5cec
+    clientId: mqttx_12411c5cec1
     #推送主题  后面跟着#是监控下面所有的话题
     #推送主题  后面跟着#是监控下面所有的话题
     topic: slope
     topic: slope
     #topic: my-test
     #topic: my-test

+ 1 - 1
slope-modules/slope-detection/src/main/resources/bootstrap.yml

@@ -6,7 +6,7 @@ spring:
     name: slope-detection
     name: slope-detection
 #    name: slope-detection
 #    name: slope-detection
   profiles:
   profiles:
-    active: dev
+    active: lfdc
   main:
   main:
     allow-bean-definition-overriding: true
     allow-bean-definition-overriding: true
     allow-circular-references: true
     allow-circular-references: true

+ 2 - 1
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsAlarmMapper.xml

@@ -9,6 +9,7 @@
     <result column="title" jdbcType="VARCHAR" property="title" />
     <result column="title" jdbcType="VARCHAR" property="title" />
     <result column="val" jdbcType="VARCHAR" property="val" />
     <result column="val" jdbcType="VARCHAR" property="val" />
     <result column="content" jdbcType="VARCHAR" property="content" />
     <result column="content" jdbcType="VARCHAR" property="content" />
+    <result column="company_id" jdbcType="VARCHAR" property="companyId" />
     <result column="level" jdbcType="INTEGER" property="level" />
     <result column="level" jdbcType="INTEGER" property="level" />
     <result column="type" jdbcType="INTEGER" property="type" />
     <result column="type" jdbcType="INTEGER" property="type" />
     <result column="lat" jdbcType="VARCHAR" property="lat" />
     <result column="lat" jdbcType="VARCHAR" property="lat" />
@@ -21,7 +22,7 @@
   <sql id="Base_Column_List">
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
     id, pid, title, val, content, `level`, `type`, lat, lng, alt, create_time, trigger_times, 
     id, pid, title, val, content, `level`, `type`, lat, lng, alt, create_time, trigger_times, 
-    `status`
+    `status`,company_id
   </sql>
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
     <!--@mbg.generated-->

+ 147 - 139
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceIntegrationMapper.xml

@@ -1,151 +1,159 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?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">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.sckw.slope.detection.dao.KwsDeviceIntegrationMapper">
 <mapper namespace="com.sckw.slope.detection.dao.KwsDeviceIntegrationMapper">
-  <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsDeviceIntegration">
-    <!--@mbg.generated-->
-    <!--@Table kws_device_integration-->
-    <id column="id" jdbcType="BIGINT" property="id" />
-    <result column="device_id" jdbcType="BIGINT" property="deviceId" />
-    <result column="integration_id" jdbcType="BIGINT" property="integrationId" />
-    <result column="status" jdbcType="TINYINT" property="status" />
-    <result column="create_by" jdbcType="BIGINT" property="createBy" />
-    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="update_by" jdbcType="BIGINT" property="updateBy" />
-    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
-    <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
-  </resultMap>
-  <sql id="Base_Column_List">
-    <!--@mbg.generated-->
-    id, device_id, integration_id, `status`, create_by, create_time, update_by, update_time, 
-    del_flag
-  </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
-    <!--@mbg.generated-->
-    select 
-    <include refid="Base_Column_List" />
-    from kws_device_integration
-    where id = #{id,jdbcType=BIGINT}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
-    <!--@mbg.generated-->
-    delete from kws_device_integration
-    where id = #{id,jdbcType=BIGINT}
-  </delete>
-  <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceIntegration">
-    <!--@mbg.generated-->
-    insert into kws_device_integration (id, device_id, integration_id, 
-      `status`, create_by, create_time, 
-      update_by, update_time, del_flag
-      )
-    values (#{id,jdbcType=BIGINT}, #{deviceId,jdbcType=BIGINT}, #{integrationId,jdbcType=BIGINT}, 
-      #{status,jdbcType=TINYINT}, #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{updateBy,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}
-      )
-  </insert>
-  <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceIntegration">
-    <!--@mbg.generated-->
-    insert into kws_device_integration
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
+    <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsDeviceIntegration">
+        <!--@mbg.generated-->
+        <!--@Table kws_device_integration-->
+        <id column="id" jdbcType="BIGINT" property="id"/>
+        <result column="device_id" jdbcType="BIGINT" property="deviceId"/>
+        <result column="integration_id" jdbcType="BIGINT" property="integrationId"/>
+        <result column="status" jdbcType="TINYINT" property="status"/>
+        <result column="company_id" jdbcType="VARCHAR" property="companyId"/>
+        <result column="create_by" jdbcType="BIGINT" property="createBy"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_by" jdbcType="BIGINT" property="updateBy"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+        <result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
         id,
         id,
-      </if>
-      <if test="deviceId != null">
         device_id,
         device_id,
-      </if>
-      <if test="integrationId != null">
         integration_id,
         integration_id,
-      </if>
-      <if test="status != null">
         `status`,
         `status`,
-      </if>
-      <if test="createBy != null">
         create_by,
         create_by,
-      </if>
-      <if test="createTime != null">
         create_time,
         create_time,
-      </if>
-      <if test="updateBy != null">
         update_by,
         update_by,
-      </if>
-      <if test="updateTime != null">
         update_time,
         update_time,
-      </if>
-      <if test="delFlag != null">
-        del_flag,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=BIGINT},
-      </if>
-      <if test="deviceId != null">
-        #{deviceId,jdbcType=BIGINT},
-      </if>
-      <if test="integrationId != null">
-        #{integrationId,jdbcType=BIGINT},
-      </if>
-      <if test="status != null">
-        #{status,jdbcType=TINYINT},
-      </if>
-      <if test="createBy != null">
-        #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        #{delFlag,jdbcType=TINYINT},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceIntegration">
-    <!--@mbg.generated-->
-    update kws_device_integration
-    <set>
-      <if test="deviceId != null">
-        device_id = #{deviceId,jdbcType=BIGINT},
-      </if>
-      <if test="integrationId != null">
-        integration_id = #{integrationId,jdbcType=BIGINT},
-      </if>
-      <if test="status != null">
-        `status` = #{status,jdbcType=TINYINT},
-      </if>
-      <if test="createBy != null">
-        create_by = #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        update_by = #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        del_flag = #{delFlag,jdbcType=TINYINT},
-      </if>
-    </set>
-    where id = #{id,jdbcType=BIGINT}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceIntegration">
-    <!--@mbg.generated-->
-    update kws_device_integration
-    set device_id = #{deviceId,jdbcType=BIGINT},
-      integration_id = #{integrationId,jdbcType=BIGINT},
-      `status` = #{status,jdbcType=TINYINT},
-      create_by = #{createBy,jdbcType=BIGINT},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      update_by = #{updateBy,jdbcType=BIGINT},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      del_flag = #{delFlag,jdbcType=TINYINT}
-    where id = #{id,jdbcType=BIGINT}
-  </update>
+        del_flag,company_id
+    </sql>
+    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+        <!--@mbg.generated-->
+        select
+        <include refid="Base_Column_List"/>
+        from kws_device_integration
+        where id = #{id,jdbcType=BIGINT}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+        <!--@mbg.generated-->
+        delete
+        from kws_device_integration
+        where id = #{id,jdbcType=BIGINT}
+    </delete>
+    <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceIntegration">
+        <!--@mbg.generated-->
+        insert into kws_device_integration (id, device_id, integration_id,
+                                            `status`, create_by, create_time,
+                                            update_by, update_time, del_flag)
+        values (#{id,jdbcType=BIGINT}, #{deviceId,jdbcType=BIGINT}, #{integrationId,jdbcType=BIGINT},
+                #{status,jdbcType=TINYINT}, #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
+                #{updateBy,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT})
+    </insert>
+    <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceIntegration">
+        <!--@mbg.generated-->
+        insert into kws_device_integration
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="deviceId != null">
+                device_id,
+            </if>
+            <if test="integrationId != null">
+                integration_id,
+            </if>
+            <if test="status != null">
+                `status`,
+            </if>
+            <if test="createBy != null">
+                create_by,
+            </if>
+            <if test="createTime != null">
+                create_time,
+            </if>
+            <if test="updateBy != null">
+                update_by,
+            </if>
+            <if test="updateTime != null">
+                update_time,
+            </if>
+            <if test="delFlag != null">
+                del_flag,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=BIGINT},
+            </if>
+            <if test="deviceId != null">
+                #{deviceId,jdbcType=BIGINT},
+            </if>
+            <if test="integrationId != null">
+                #{integrationId,jdbcType=BIGINT},
+            </if>
+            <if test="status != null">
+                #{status,jdbcType=TINYINT},
+            </if>
+            <if test="createBy != null">
+                #{createBy,jdbcType=BIGINT},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateBy != null">
+                #{updateBy,jdbcType=BIGINT},
+            </if>
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="delFlag != null">
+                #{delFlag,jdbcType=TINYINT},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective"
+            parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceIntegration">
+        <!--@mbg.generated-->
+        update kws_device_integration
+        <set>
+            <if test="deviceId != null">
+                device_id = #{deviceId,jdbcType=BIGINT},
+            </if>
+            <if test="integrationId != null">
+                integration_id = #{integrationId,jdbcType=BIGINT},
+            </if>
+            <if test="status != null">
+                `status` = #{status,jdbcType=TINYINT},
+            </if>
+            <if test="createBy != null">
+                create_by = #{createBy,jdbcType=BIGINT},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateBy != null">
+                update_by = #{updateBy,jdbcType=BIGINT},
+            </if>
+            <if test="updateTime != null">
+                update_time = #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="delFlag != null">
+                del_flag = #{delFlag,jdbcType=TINYINT},
+            </if>
+        </set>
+        where id = #{id,jdbcType=BIGINT}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDeviceIntegration">
+        <!--@mbg.generated-->
+        update kws_device_integration
+        set device_id      = #{deviceId,jdbcType=BIGINT},
+            integration_id = #{integrationId,jdbcType=BIGINT},
+            `status`       = #{status,jdbcType=TINYINT},
+            create_by      = #{createBy,jdbcType=BIGINT},
+            create_time    = #{createTime,jdbcType=TIMESTAMP},
+            update_by      = #{updateBy,jdbcType=BIGINT},
+            update_time    = #{updateTime,jdbcType=TIMESTAMP},
+            del_flag       = #{delFlag,jdbcType=TINYINT}
+        where id = #{id,jdbcType=BIGINT}
+    </update>
 </mapper>
 </mapper>

+ 7 - 2
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceMapper.xml

@@ -10,9 +10,10 @@
     <result column="alias" jdbcType="VARCHAR" property="alias" />
     <result column="alias" jdbcType="VARCHAR" property="alias" />
     <result column="sn_code" jdbcType="VARCHAR" property="snCode" />
     <result column="sn_code" jdbcType="VARCHAR" property="snCode" />
     <result column="model_id" jdbcType="BIGINT" property="modelId" />
     <result column="model_id" jdbcType="BIGINT" property="modelId" />
+      <result column="company_id" jdbcType="VARCHAR" property="companyId" />
     <result column="valid_time" jdbcType="TIMESTAMP" property="validTime" />
     <result column="valid_time" jdbcType="TIMESTAMP" property="validTime" />
     <result column="secret_key" jdbcType="VARCHAR" property="secretKey" />
     <result column="secret_key" jdbcType="VARCHAR" property="secretKey" />
-    <result column="interface" jdbcType="VARCHAR" property="interFace" />
+    <result column="inter_face" jdbcType="VARCHAR" property="interFace" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
     <result column="status" jdbcType="TINYINT" property="status" />
     <result column="status" jdbcType="TINYINT" property="status" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
@@ -24,7 +25,7 @@
   <sql id="Base_Column_List">
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
     id, `attribute`, `name`, `alias`, sn_code, model_id, valid_time, secret_key, inter_face,
     id, `attribute`, `name`, `alias`, sn_code, model_id, valid_time, secret_key, inter_face,
-    remark, `status`, create_by, create_time, update_by, update_time, del_flag
+    remark, `status`, create_by, create_time, update_by, update_time, del_flag,company_id
   </sql>
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
@@ -229,4 +230,8 @@
       del_flag = #{delFlag,jdbcType=TINYINT}
       del_flag = #{delFlag,jdbcType=TINYINT}
     where id = #{id,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}
   </update>
   </update>
+
+  <select id="selectDeviceAllNotDeviceRelation" resultType="com.sckw.slope.detection.model.dto.DeviceDataDTO">
+  
+  </select>
 </mapper>
 </mapper>

+ 2 - 1
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceModelMapper.xml

@@ -12,6 +12,7 @@
     <result column="manufacturer_contacts" jdbcType="VARCHAR" property="manufacturerContacts" />
     <result column="manufacturer_contacts" jdbcType="VARCHAR" property="manufacturerContacts" />
     <result column="manufacturer_phone" jdbcType="VARCHAR" property="manufacturerPhone" />
     <result column="manufacturer_phone" jdbcType="VARCHAR" property="manufacturerPhone" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
+      <result column="company_id" jdbcType="VARCHAR" property="companyId" />
     <result column="status" jdbcType="TINYINT" property="status" />
     <result column="status" jdbcType="TINYINT" property="status" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
@@ -22,7 +23,7 @@
   <sql id="Base_Column_List">
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
     id, identify_code, device_type, `name`, manufacturer, manufacturer_contacts, manufacturer_phone, 
     id, identify_code, device_type, `name`, manufacturer, manufacturer_contacts, manufacturer_phone, 
-    remark, `status`, create_by, create_time, update_by, update_time, del_flag
+    remark, `status`, create_by, create_time, update_by, update_time, del_flag,company_id
   </sql>
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
     <!--@mbg.generated-->

+ 2 - 1
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceReferenceMapper.xml

@@ -10,6 +10,7 @@
     <result column="value" jdbcType="DECIMAL" property="value" />
     <result column="value" jdbcType="DECIMAL" property="value" />
     <result column="offset" jdbcType="DECIMAL" property="offset" />
     <result column="offset" jdbcType="DECIMAL" property="offset" />
     <result column="status" jdbcType="TINYINT" property="status" />
     <result column="status" jdbcType="TINYINT" property="status" />
+      <result column="company_id" jdbcType="VARCHAR" property="companyId" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_by" jdbcType="BIGINT" property="updateBy" />
     <result column="update_by" jdbcType="BIGINT" property="updateBy" />
@@ -19,7 +20,7 @@
   <sql id="Base_Column_List">
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
     id, device_id, item, `value`, `offset`, `status`, create_by, create_time, update_by, 
     id, device_id, item, `value`, `offset`, `status`, create_by, create_time, update_by, 
-    update_time, del_flag
+    update_time, del_flag,company_id
   </sql>
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
     <!--@mbg.generated-->

+ 2 - 1
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceRelationMapper.xml

@@ -11,13 +11,14 @@
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_by" jdbcType="BIGINT" property="updateBy" />
     <result column="update_by" jdbcType="BIGINT" property="updateBy" />
+      <result column="company_id" jdbcType="VARCHAR" property="companyId" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
     <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
   </resultMap>
   </resultMap>
   <sql id="Base_Column_List">
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
     id, device_id, relate_device_id, `status`, create_by, create_time, update_by, update_time, 
     id, device_id, relate_device_id, `status`, create_by, create_time, update_by, update_time, 
-    del_flag
+    del_flag,company_id
   </sql>
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
     <!--@mbg.generated-->

+ 2 - 1
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsIntegrationMapper.xml

@@ -12,6 +12,7 @@
     <result column="remark" jdbcType="VARCHAR" property="remark" />
     <result column="remark" jdbcType="VARCHAR" property="remark" />
     <result column="status" jdbcType="TINYINT" property="status" />
     <result column="status" jdbcType="TINYINT" property="status" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
+      <result column="company_id" jdbcType="VARCHAR" property="companyId" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_by" jdbcType="BIGINT" property="updateBy" />
     <result column="update_by" jdbcType="BIGINT" property="updateBy" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
@@ -20,7 +21,7 @@
   <sql id="Base_Column_List">
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
     id, integration_name, part_names, unit, formula, remark, `status`, create_by, create_time, 
     id, integration_name, part_names, unit, formula, remark, `status`, create_by, create_time, 
-    update_by, update_time, del_flag
+    update_by, update_time, del_flag,company_id
   </sql>
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
     <!--@mbg.generated-->

+ 2 - 1
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsLogMapper.xml

@@ -7,12 +7,13 @@
     <id column="id" jdbcType="BIGINT" property="id" />
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="type" jdbcType="VARCHAR" property="type" />
     <result column="type" jdbcType="VARCHAR" property="type" />
     <result column="content" jdbcType="VARCHAR" property="content" />
     <result column="content" jdbcType="VARCHAR" property="content" />
+      <result column="company_id" jdbcType="VARCHAR" property="companyId" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
   </resultMap>
   </resultMap>
   <sql id="Base_Column_List">
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
-    id, `type`, content, create_by, create_time
+    id, `type`, content, create_by, create_time,company_id
   </sql>
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
     <!--@mbg.generated-->

+ 2 - 1
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsProjectAreaMapper.xml

@@ -11,12 +11,13 @@
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_by" jdbcType="BIGINT" property="updateBy" />
     <result column="update_by" jdbcType="BIGINT" property="updateBy" />
+      <result column="company_id" jdbcType="VARCHAR" property="companyId" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
     <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
   </resultMap>
   </resultMap>
   <sql id="Base_Column_List">
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
-    id, project_id, fence, area, create_by, create_time, update_by, update_time, del_flag
+    id, project_id, fence, area, create_by, create_time, update_by, update_time, del_flag,company_id
   </sql>
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
     <!--@mbg.generated-->

+ 3 - 2
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsProjectDeviceMapper.xml

@@ -9,6 +9,7 @@
     <result column="device_id" jdbcType="BIGINT" property="deviceId" />
     <result column="device_id" jdbcType="BIGINT" property="deviceId" />
     <result column="status" jdbcType="TINYINT" property="status" />
     <result column="status" jdbcType="TINYINT" property="status" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
     <result column="create_by" jdbcType="BIGINT" property="createBy" />
+      <result column="company_id" jdbcType="VARCHAR" property="companyId" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_by" jdbcType="BIGINT" property="updateBy" />
     <result column="update_by" jdbcType="BIGINT" property="updateBy" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
@@ -17,7 +18,7 @@
   <sql id="Base_Column_List">
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
     id, project_id, device_id, `status`, create_by, create_time, update_by, update_time, 
     id, project_id, device_id, `status`, create_by, create_time, update_by, update_time, 
-    del_flag
+    del_flag,company_id
   </sql>
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
@@ -190,7 +191,7 @@ WHERE
         and a.project_id = #{id}
         and a.project_id = #{id}
     </select>
     </select>
 
 
-  <select id="selectIntegrationItemByProjectId" resultType="com.sckw.slope.detection.model.dto.IntegrationItemDTO">
+  <select id="selectIntegrationItemByProjectId" resultType="com.sckw.slope.detection.model.vo.IntegrationItemVO">
       SELECT c.integration_id   AS integrationId,
       SELECT c.integration_id   AS integrationId,
              d.integration_name AS integrationName
              d.integration_name AS integrationName
       FROM kws_project_device a
       FROM kws_project_device a

+ 58 - 3
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsProjectMapper.xml

@@ -7,6 +7,7 @@
     <id column="id" jdbcType="BIGINT" property="id" />
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="name" jdbcType="VARCHAR" property="name" />
     <result column="name" jdbcType="VARCHAR" property="name" />
     <result column="mountain_id" jdbcType="VARCHAR" property="mountainId" />
     <result column="mountain_id" jdbcType="VARCHAR" property="mountainId" />
+      <result column="company_id" jdbcType="VARCHAR" property="companyId" />
     <result column="mountain_name" jdbcType="VARCHAR" property="mountainName" />
     <result column="mountain_name" jdbcType="VARCHAR" property="mountainName" />
     <result column="platform_name" jdbcType="VARCHAR" property="platformName" />
     <result column="platform_name" jdbcType="VARCHAR" property="platformName" />
     <result column="platform_address" jdbcType="VARCHAR" property="platformAddress" />
     <result column="platform_address" jdbcType="VARCHAR" property="platformAddress" />
@@ -28,7 +29,7 @@
     <!--@mbg.generated-->
     <!--@mbg.generated-->
     id, `name`, mountain_id, mountain_name, platform_name, platform_address, design_company,
     id, `name`, mountain_id, mountain_name, platform_name, platform_address, design_company,
     design_contacts, design_phone, build_company, build_contacts, build_phone, remark,
     design_contacts, design_phone, build_company, build_contacts, build_phone, remark,
-    `status`, create_by, create_time, update_by, update_time, del_flag
+    `status`, create_by, create_time, update_by, update_time, del_flag,company_id
   </sql>
   </sql>
   <select id="selectByProjectParam" resultType="com.sckw.slope.detection.model.vo.ProjectVo">
   <select id="selectByProjectParam" resultType="com.sckw.slope.detection.model.vo.ProjectVo">
       select
       select
@@ -36,9 +37,63 @@
       </include>
       </include>
       from kws_project
       from kws_project
       <where>
       <where>
-          <if test="name != null and name != ''">
-              and name like concat('%', #{name}, '%')
+          <if test="companyId != null and companyId !=''">
+              and company_id=#{companyId,jdbcType=VARCHAR}
+          </if>
+          <if test="projectQueryDto.name != null and projectQueryDto.name != ''">
+              and name like concat('%', #{projectQueryDto.name}, '%')
           </if>
           </if>
       </where>
       </where>
   </select>
   </select>
+
+  <select id="selectDeviceByProjectId" resultType="com.sckw.slope.detection.model.vo.ProjectDeviceVO">
+      SELECT a.id           AS projectId,
+             a.`name`       AS projectName,
+             c.id           AS id,
+             c.`name`       AS NAME,
+             d.device_type  AS deviceType,
+             d.manufacturer AS manufacturer,
+             d.`name`       AS modelName,
+             c.create_time  AS createTime
+      FROM kws_project a
+               LEFT JOIN kws_project_device b ON a.id = b.project_id
+               LEFT JOIN kws_device c ON b.device_id = c.id
+               LEFT JOIN kws_device_model d ON c.model_id = d.id
+      WHERE a.del_flag = 0
+        AND b.del_flag = 0
+        AND c.del_flag = 0
+        AND d.del_flag = 0
+        AND a.id = #{projectId,jdbcType=BIGINT}
+  </select>
+
+  <select id="selectDeviceList" resultType="com.sckw.slope.detection.model.vo.ProjectDeviceVO">
+      SELECT a.id           AS projectId,
+             a.`name`       AS projectName,
+             c.id           AS id,
+             c.`name`       AS NAME,
+             d.device_type  AS deviceType,
+             d.manufacturer AS manufacturer,
+             d.`name`       AS modelName,
+             c.create_time  AS createTime
+      FROM kws_project a
+               LEFT JOIN kws_project_device b ON a.id = b.project_id
+               LEFT JOIN kws_device c ON b.device_id = c.id
+               LEFT JOIN kws_device_model d ON c.model_id = d.id
+      WHERE a.del_flag = 0
+        AND b.del_flag = 0
+        AND c.del_flag = 0
+        AND d.del_flag = 0
+      <if test="deviceQuery.projectId != null and deviceQuery.projectId != ''">
+          AND a.id = #{deviceQuery.projectId,jdbcType=BIGINT}
+      </if>
+      <if test="deviceQuery.manufacturer != null and deviceQuery.manufacturer != ''">
+          and d.manufacturer like concat('%', #{deviceQuery.manufacturer}, '%')
+      </if>
+      <if test="deviceQuery.deviceType != null and deviceQuery.deviceType != ''">
+          and d.device_type like concat('%', #{deviceQuery.deviceType}, '%')
+      </if>
+      <if test="deviceQuery.name  != null and deviceQuery.name != ''">
+          and d.name like concat('%', #{deviceQuery.name}, '%')
+      </if>
+  </select>
 </mapper>
 </mapper>

+ 6 - 1
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsReportDataMapper.xml

@@ -6,6 +6,7 @@
     <!--@Table kws_report_data-->
     <!--@Table kws_report_data-->
     <id column="id" jdbcType="BIGINT" property="id" />
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="template_id" jdbcType="BIGINT" property="templateId" />
     <result column="template_id" jdbcType="BIGINT" property="templateId" />
+      <result column="company_id" jdbcType="VARCHAR" property="companyId" />
     <result column="project_id" jdbcType="BIGINT" property="projectId" />
     <result column="project_id" jdbcType="BIGINT" property="projectId" />
     <result column="project_name" jdbcType="VARCHAR" property="projectName" />
     <result column="project_name" jdbcType="VARCHAR" property="projectName" />
     <result column="device_id" jdbcType="BIGINT" property="deviceId" />
     <result column="device_id" jdbcType="BIGINT" property="deviceId" />
@@ -30,7 +31,7 @@
     <!--@mbg.generated-->
     <!--@mbg.generated-->
     id, template_id, project_id, project_name, device_id, device_name, sn_code, `alias`, 
     id, template_id, project_id, project_name, device_id, device_name, sn_code, `alias`, 
     model_id, model_name, device_type, device_label, lat, lng, alt, alarm_type, alarm_title, 
     model_id, model_name, device_type, device_label, lat, lng, alt, alarm_type, alarm_title, 
-    content, items, alarm_time, create_time
+    content, items, alarm_time, create_time,company_id
   </sql>
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
@@ -287,4 +288,8 @@
       create_time = #{createTime,jdbcType=TIMESTAMP}
       create_time = #{createTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}
   </update>
   </update>
+
+  <select id="selectDataAndTemplate" resultType="com.sckw.slope.detection.model.vo.ReportDetailVO">
+
+    </select>
 </mapper>
 </mapper>

+ 207 - 158
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsReportTemplateMapper.xml

@@ -1,173 +1,222 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?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">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.sckw.slope.detection.dao.mysql.KwsReportTemplateMapper">
 <mapper namespace="com.sckw.slope.detection.dao.mysql.KwsReportTemplateMapper">
-  <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate">
-    <!--@mbg.generated-->
-    <!--@Table kws_report_template-->
-    <id column="id" jdbcType="BIGINT" property="id" />
-    <result column="name" jdbcType="VARCHAR" property="name" />
-    <result column="type" jdbcType="INTEGER" property="type" />
-    <result column="part_names" jdbcType="VARCHAR" property="partNames" />
-    <result column="intergration_names" jdbcType="VARCHAR" property="intergrationNames" />
-    <result column="status" jdbcType="TINYINT" property="status" />
-    <result column="create_by" jdbcType="BIGINT" property="createBy" />
-    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
-    <result column="update_by" jdbcType="BIGINT" property="updateBy" />
-    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
-    <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
-  </resultMap>
-  <sql id="Base_Column_List">
-    <!--@mbg.generated-->
-    id, `name`, `type`, part_names, intergration_names, `status`, create_by, create_time, 
-    update_by, update_time, del_flag
-  </sql>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
-    <!--@mbg.generated-->
-    select 
-    <include refid="Base_Column_List" />
-    from kws_report_template
-    where id = #{id,jdbcType=BIGINT}
-  </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
-    <!--@mbg.generated-->
-    delete from kws_report_template
-    where id = #{id,jdbcType=BIGINT}
-  </delete>
-  <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate">
-    <!--@mbg.generated-->
-    insert into kws_report_template (id, `name`, `type`, 
-      part_names, intergration_names, `status`, 
-      create_by, create_time, update_by, 
-      update_time, del_flag)
-    values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, 
-      #{partNames,jdbcType=VARCHAR}, #{intergrationNames,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, 
-      #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT}, 
-      #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT})
-  </insert>
-  <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate">
-    <!--@mbg.generated-->
-    insert into kws_report_template
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
+    <resultMap id="BaseResultMap" type="com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate">
+        <!--@mbg.generated-->
+        <!--@Table kws_report_template-->
+        <id column="id" jdbcType="BIGINT" property="id"/>
+        <result column="name" jdbcType="VARCHAR" property="name"/>
+        <result column="type" jdbcType="INTEGER" property="type"/>
+        <result column="company_id" jdbcType="VARCHAR" property="companyId"/>
+        <result column="part_names" jdbcType="VARCHAR" property="partNames"/>
+        <result column="tabulation_time" jdbcType="VARCHAR" property="tabulationTime"/>
+        <result column="intergration_names" jdbcType="VARCHAR" property="intergrationNames"/>
+        <result column="status" jdbcType="INTEGER" property="status"/>
+        <result column="create_by" jdbcType="BIGINT" property="createBy"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="update_by" jdbcType="BIGINT" property="updateBy"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+        <result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <!--@mbg.generated-->
         id,
         id,
-      </if>
-      <if test="name != null">
         `name`,
         `name`,
-      </if>
-      <if test="type != null">
         `type`,
         `type`,
-      </if>
-      <if test="partNames != null">
         part_names,
         part_names,
-      </if>
-      <if test="intergrationNames != null">
         intergration_names,
         intergration_names,
-      </if>
-      <if test="status != null">
         `status`,
         `status`,
-      </if>
-      <if test="createBy != null">
         create_by,
         create_by,
-      </if>
-      <if test="createTime != null">
         create_time,
         create_time,
-      </if>
-      <if test="updateBy != null">
         update_by,
         update_by,
-      </if>
-      <if test="updateTime != null">
         update_time,
         update_time,
-      </if>
-      <if test="delFlag != null">
         del_flag,
         del_flag,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=BIGINT},
-      </if>
-      <if test="name != null">
-        #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="type != null">
-        #{type,jdbcType=INTEGER},
-      </if>
-      <if test="partNames != null">
-        #{partNames,jdbcType=VARCHAR},
-      </if>
-      <if test="intergrationNames != null">
-        #{intergrationNames,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        #{status,jdbcType=TINYINT},
-      </if>
-      <if test="createBy != null">
-        #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        #{delFlag,jdbcType=TINYINT},
-      </if>
-    </trim>
-  </insert>
-  <update id="updateByPrimaryKeySelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate">
-    <!--@mbg.generated-->
-    update kws_report_template
-    <set>
-      <if test="name != null">
-        `name` = #{name,jdbcType=VARCHAR},
-      </if>
-      <if test="type != null">
-        `type` = #{type,jdbcType=INTEGER},
-      </if>
-      <if test="partNames != null">
-        part_names = #{partNames,jdbcType=VARCHAR},
-      </if>
-      <if test="intergrationNames != null">
-        intergration_names = #{intergrationNames,jdbcType=VARCHAR},
-      </if>
-      <if test="status != null">
-        `status` = #{status,jdbcType=TINYINT},
-      </if>
-      <if test="createBy != null">
-        create_by = #{createBy,jdbcType=BIGINT},
-      </if>
-      <if test="createTime != null">
-        create_time = #{createTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="updateBy != null">
-        update_by = #{updateBy,jdbcType=BIGINT},
-      </if>
-      <if test="updateTime != null">
-        update_time = #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="delFlag != null">
-        del_flag = #{delFlag,jdbcType=TINYINT},
-      </if>
-    </set>
-    where id = #{id,jdbcType=BIGINT}
-  </update>
-  <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate">
-    <!--@mbg.generated-->
-    update kws_report_template
-    set `name` = #{name,jdbcType=VARCHAR},
-      `type` = #{type,jdbcType=INTEGER},
-      part_names = #{partNames,jdbcType=VARCHAR},
-      intergration_names = #{intergrationNames,jdbcType=VARCHAR},
-      `status` = #{status,jdbcType=TINYINT},
-      create_by = #{createBy,jdbcType=BIGINT},
-      create_time = #{createTime,jdbcType=TIMESTAMP},
-      update_by = #{updateBy,jdbcType=BIGINT},
-      update_time = #{updateTime,jdbcType=TIMESTAMP},
-      del_flag = #{delFlag,jdbcType=TINYINT}
-    where id = #{id,jdbcType=BIGINT}
-  </update>
+        company_id,
+        tabulation_time
+    </sql>
+    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+        <!--@mbg.generated-->
+        select
+        <include refid="Base_Column_List"/>
+        from kws_report_template
+        where id = #{id,jdbcType=BIGINT}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+        <!--@mbg.generated-->
+        delete
+        from kws_report_template
+        where id = #{id,jdbcType=BIGINT}
+    </delete>
+    <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate">
+        <!--@mbg.generated-->
+        insert into kws_report_template (id, `name`, `type`,
+                                         part_names, intergration_names, `status`,
+                                         create_by, create_time, update_by,
+                                         update_time, del_flag)
+        values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
+                #{partNames,jdbcType=VARCHAR}, #{intergrationNames,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT},
+                #{createBy,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT},
+                #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT})
+    </insert>
+    <insert id="insertSelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate">
+        <!--@mbg.generated-->
+        insert into kws_report_template
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                id,
+            </if>
+            <if test="name != null">
+                `name`,
+            </if>
+            <if test="type != null">
+                `type`,
+            </if>
+            <if test="partNames != null">
+                part_names,
+            </if>
+            <if test="intergrationNames != null">
+                intergration_names,
+            </if>
+            <if test="status != null">
+                `status`,
+            </if>
+            <if test="createBy != null">
+                create_by,
+            </if>
+            <if test="createTime != null">
+                create_time,
+            </if>
+            <if test="updateBy != null">
+                update_by,
+            </if>
+            <if test="updateTime != null">
+                update_time,
+            </if>
+            <if test="delFlag != null">
+                del_flag,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=BIGINT},
+            </if>
+            <if test="name != null">
+                #{name,jdbcType=VARCHAR},
+            </if>
+            <if test="type != null">
+                #{type,jdbcType=INTEGER},
+            </if>
+            <if test="partNames != null">
+                #{partNames,jdbcType=VARCHAR},
+            </if>
+            <if test="intergrationNames != null">
+                #{intergrationNames,jdbcType=VARCHAR},
+            </if>
+            <if test="status != null">
+                #{status,jdbcType=TINYINT},
+            </if>
+            <if test="createBy != null">
+                #{createBy,jdbcType=BIGINT},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateBy != null">
+                #{updateBy,jdbcType=BIGINT},
+            </if>
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="delFlag != null">
+                #{delFlag,jdbcType=TINYINT},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate">
+        <!--@mbg.generated-->
+        update kws_report_template
+        <set>
+            <if test="name != null">
+                `name` = #{name,jdbcType=VARCHAR},
+            </if>
+            <if test="type != null">
+                `type` = #{type,jdbcType=INTEGER},
+            </if>
+            <if test="partNames != null">
+                part_names = #{partNames,jdbcType=VARCHAR},
+            </if>
+            <if test="intergrationNames != null">
+                intergration_names = #{intergrationNames,jdbcType=VARCHAR},
+            </if>
+            <if test="status != null">
+                `status` = #{status,jdbcType=TINYINT},
+            </if>
+            <if test="createBy != null">
+                create_by = #{createBy,jdbcType=BIGINT},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateBy != null">
+                update_by = #{updateBy,jdbcType=BIGINT},
+            </if>
+            <if test="updateTime != null">
+                update_time = #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="delFlag != null">
+                del_flag = #{delFlag,jdbcType=TINYINT},
+            </if>
+        </set>
+        where id = #{id,jdbcType=BIGINT}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsReportTemplate">
+        <!--@mbg.generated-->
+        update kws_report_template
+        set `name`             = #{name,jdbcType=VARCHAR},
+            `type`             = #{type,jdbcType=INTEGER},
+            part_names         = #{partNames,jdbcType=VARCHAR},
+            intergration_names = #{intergrationNames,jdbcType=VARCHAR},
+            `status`           = #{status,jdbcType=TINYINT},
+            create_by          = #{createBy,jdbcType=BIGINT},
+            create_time        = #{createTime,jdbcType=TIMESTAMP},
+            update_by          = #{updateBy,jdbcType=BIGINT},
+            update_time        = #{updateTime,jdbcType=TIMESTAMP},
+            del_flag           = #{delFlag,jdbcType=TINYINT}
+        where id = #{id,jdbcType=BIGINT}
+    </update>
+
+    <select id="selectListByReportNameAndProjectIdAndCompany"
+            resultType="com.sckw.slope.detection.model.vo.ReportStatementVO">
+        SELECT
+            STATUS,
+            `name` AS reportName,
+            type AS reportType,
+            project_id AS projectId,
+            create_time AS createTime
+        FROM
+            kws_report_template
+        WHERE
+        <if test="query.projectId != null and query.projectId != ''">
+            and project_id =#{query.projectId}
+        </if>
+        <if test="companyId != null and companyId != ''">
+            and company_id=#{companyId,jdbcType=VARCHAR}
+        </if>
+    </select>
+
+    <select id="selectListByReportNameAndProjectId" resultType="com.sckw.slope.detection.model.vo.ReportStatementVO">
+    </select>
+
+    <select id="selectDataAndTemplate" resultType="com.sckw.slope.detection.model.vo.ReportDetailVO">
+        SELECT a.id,
+               a.part_names         AS partNames,
+               a.intergration_names AS intergrationNames,
+               a.type               AS type,
+               a.`status`           AS STATUS,
+               b.NAME               AS NAME,
+
+        FROM kws_report_template a
+                 LEFT JOIN kws_report_data b ON a.id = b.template_id
+        WHERE id = #{id,jdbcType=BIGINT}
+    </select>
 </mapper>
 </mapper>

+ 2 - 1
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsThresholdMapper.xml

@@ -8,6 +8,7 @@
     <result column="device_id" jdbcType="BIGINT" property="deviceId" />
     <result column="device_id" jdbcType="BIGINT" property="deviceId" />
     <result column="item_name" jdbcType="VARCHAR" property="itemName" />
     <result column="item_name" jdbcType="VARCHAR" property="itemName" />
     <result column="level" jdbcType="INTEGER" property="level" />
     <result column="level" jdbcType="INTEGER" property="level" />
+      <result column="company_id" jdbcType="VARCHAR" property="companyId" />
     <result column="max" jdbcType="VARCHAR" property="max" />
     <result column="max" jdbcType="VARCHAR" property="max" />
     <result column="min" jdbcType="VARCHAR" property="min" />
     <result column="min" jdbcType="VARCHAR" property="min" />
     <result column="phones" jdbcType="VARCHAR" property="phones" />
     <result column="phones" jdbcType="VARCHAR" property="phones" />
@@ -21,7 +22,7 @@
   <sql id="Base_Column_List">
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
     id, device_id, item_name, `level`, `max`, `min`, phones, `status`, create_by, create_time, 
     id, device_id, item_name, `level`, `max`, `min`, phones, `status`, create_by, create_time, 
-    update_by, update_time, del_flag
+    update_by, update_time, del_flag,company_id
   </sql>
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
     <!--@mbg.generated-->