15928045575 2 years ago
parent
commit
b506a859e2
18 changed files with 198 additions and 22 deletions
  1. 2 1
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/DeviceController.java
  2. 5 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsDeviceModelPartMapper.java
  3. 5 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsDeviceRelationMapper.java
  4. 5 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsIntegrationMapper.java
  5. 1 1
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDevice.java
  6. 2 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDeviceModelPart.java
  7. 5 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDeviceRelation.java
  8. 23 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/DeviceModelVo.java
  9. 50 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/DevicePartModelVo.java
  10. 2 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/DeviceVo.java
  11. 15 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/IntegrationItemVO.java
  12. 5 4
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/CommonService.java
  13. 51 9
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/DeviceModelService.java
  14. 2 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/DeviceService.java
  15. 2 4
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceMapper.xml
  16. 13 1
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceModelPartMapper.xml
  17. 1 0
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceRelationMapper.xml
  18. 9 2
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsIntegrationMapper.xml

+ 2 - 1
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/controller/DeviceController.java

@@ -35,7 +35,8 @@ public class DeviceController {
     @RequestMapping(name = "设备删除", value = "/dels", method = RequestMethod.GET)
     @RequestMapping(name = "设备删除", value = "/dels", method = RequestMethod.GET)
     public HttpResult dels(@RequestParam("ids") @NotBlank(message = "设备id不能为空") String ids) {
     public HttpResult dels(@RequestParam("ids") @NotBlank(message = "设备id不能为空") String ids) {
         log.info("设备删除 delete param:{}", ids);
         log.info("设备删除 delete param:{}", ids);
-        return deviceService.dels(ids);
+        return deviceService.dels(ids
+        );
     }
     }
 
 
     @Log(description = "所属设备查询")
     @Log(description = "所属设备查询")

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsDeviceModelPartMapper.java

@@ -4,6 +4,8 @@ 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.KwsDeviceModelPart;
 import com.sckw.slope.detection.model.dos.mysql.KwsDeviceModelPart;
 import com.sckw.slope.detection.model.dto.DeviceElementDTO;
 import com.sckw.slope.detection.model.dto.DeviceElementDTO;
+import com.sckw.slope.detection.model.vo.DevicePartModelVo;
+import com.sckw.slope.detection.model.vo.DeviceVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
@@ -20,6 +22,9 @@ public interface KwsDeviceModelPartMapper extends BaseMapper<KwsDeviceModelPart>
 
 
     KwsDeviceModelPart selectByPrimaryKey(Long id);
     KwsDeviceModelPart selectByPrimaryKey(Long id);
 
 
+    List<DevicePartModelVo> selectByModelId(Long deviceModelId);
+
+
     int updateByPrimaryKeySelective(KwsDeviceModelPart record);
     int updateByPrimaryKeySelective(KwsDeviceModelPart record);
 
 
     int updateByPrimaryKey(KwsDeviceModelPart record);
     int updateByPrimaryKey(KwsDeviceModelPart record);

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsDeviceRelationMapper.java

@@ -3,8 +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.KwsDeviceRelation;
 import com.sckw.slope.detection.model.dos.mysql.KwsDeviceRelation;
+import com.sckw.slope.detection.model.vo.IntegrationItemVO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 
 
+import java.util.List;
+
 @Mapper
 @Mapper
 @DS("mysql")
 @DS("mysql")
 public interface KwsDeviceRelationMapper extends BaseMapper<KwsDeviceRelation> {
 public interface KwsDeviceRelationMapper extends BaseMapper<KwsDeviceRelation> {
@@ -19,4 +22,6 @@ public interface KwsDeviceRelationMapper extends BaseMapper<KwsDeviceRelation> {
     int updateByPrimaryKeySelective(KwsDeviceRelation record);
     int updateByPrimaryKeySelective(KwsDeviceRelation record);
 
 
     int updateByPrimaryKey(KwsDeviceRelation record);
     int updateByPrimaryKey(KwsDeviceRelation record);
+
+
 }
 }

+ 5 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsIntegrationMapper.java

@@ -3,8 +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.KwsIntegration;
 import com.sckw.slope.detection.model.dos.mysql.KwsIntegration;
+import com.sckw.slope.detection.model.vo.IntegrationItemVO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 
 
+import java.util.List;
+
 @Mapper
 @Mapper
 @DS("mysql")
 @DS("mysql")
 public interface KwsIntegrationMapper extends BaseMapper<KwsIntegration> {
 public interface KwsIntegrationMapper extends BaseMapper<KwsIntegration> {
@@ -19,4 +22,6 @@ public interface KwsIntegrationMapper extends BaseMapper<KwsIntegration> {
     int updateByPrimaryKeySelective(KwsIntegration record);
     int updateByPrimaryKeySelective(KwsIntegration record);
 
 
     int updateByPrimaryKey(KwsIntegration record);
     int updateByPrimaryKey(KwsIntegration record);
+
+    List<IntegrationItemVO> getDataByFindInSet(String partNames);
 }
 }

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

@@ -48,7 +48,7 @@ public class KwsDevice implements Serializable {
     /**
     /**
      * 质保日期
      * 质保日期
      */
      */
-    private DateTime validTime;
+    private Date validTime;
 
 
     /**
     /**
      * 秘钥
      * 秘钥

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

@@ -2,6 +2,7 @@ package com.sckw.slope.detection.model.dos.mysql;
 
 
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.Date;
@@ -11,6 +12,7 @@ import java.util.Date;
  * @description 设备-要素关联表
  * @description 设备-要素关联表
  * @date 2023-10-25 13:46:12
  * @date 2023-10-25 13:46:12
  */
  */
+@Data
 @TableName("kws_device_model_part")
 @TableName("kws_device_model_part")
 public class KwsDeviceModelPart implements Serializable {
 public class KwsDeviceModelPart implements Serializable {
     private Long id;
     private Long id;

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

@@ -21,6 +21,11 @@ public class KwsDeviceRelation implements Serializable {
      */
      */
     private Long deviceId;
     private Long deviceId;
 
 
+    /**
+     * 企业id
+     */
+    private String mountainId;
+
     /**
     /**
      * 企业id
      * 企业id
      */
      */

+ 23 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/DeviceModelVo.java

@@ -2,11 +2,14 @@ package com.sckw.slope.detection.model.vo;
 
 
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.date.DateTime;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.sckw.slope.detection.model.dto.SystemDict;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.util.Date;
 import java.util.Date;
+import java.util.List;
+import java.util.Map;
 
 
 /**
 /**
  * @author sky
  * @author sky
@@ -77,6 +80,26 @@ public class DeviceModelVo implements Serializable {
      */
      */
     private DateTime create_time;
     private DateTime create_time;
 
 
+    /**
+     * 要素
+     */
+    private List<String> part;
+
+    /**
+     * 集成要素
+     */
+    private List<IntegrationItemVO> integration;
+
+    /**
+     * 数据字典
+     */
+    private List<SystemDict>  systemDict;
+
+    /**
+     * 要素id
+     */
+    private List<String> partId;
+
 
 
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 }
 }

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

@@ -0,0 +1,50 @@
+package com.sckw.slope.detection.model.vo;
+
+import cn.hutool.core.date.DateTime;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author sky
+ * @description vo
+ * @date 2023-10-30 13:10:38
+ */
+@Data
+public class DevicePartModelVo implements Serializable {
+    private Long id;
+
+    /**
+     * 矿山id
+     */
+    private Integer mountainId;
+
+    /**
+     * 设备型号id
+     */
+    private Long deviceModelId;
+
+    /**
+     * 要素名
+     */
+    private String partName;
+
+    /**
+     * 状态
+     */
+    private Integer status;
+
+    private Integer createBy;
+
+    private Integer createTime;
+
+    private Integer updateBy;
+
+    private Integer updateTime;
+
+    private Integer delFlag;
+
+
+
+    private static final long serialVersionUID = 1L;
+}

+ 2 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/DeviceVo.java

@@ -1,6 +1,7 @@
 package com.sckw.slope.detection.model.vo;
 package com.sckw.slope.detection.model.vo;
 
 
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.Data;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
@@ -44,6 +45,7 @@ public class DeviceVo implements Serializable {
     /**
     /**
      * 质保日期
      * 质保日期
      */
      */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private Date validTime;
     private Date validTime;
 
 
     /**
     /**

+ 15 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/IntegrationItemVO.java

@@ -20,4 +20,19 @@ public class IntegrationItemVO implements Serializable {
      * 集成要素名
      * 集成要素名
      */
      */
     private String integrationName;
     private String integrationName;
+
+    /**
+     * 集成要素id
+     */
+    private String Id;
+
+    /**
+     * 要素名称字符串
+     */
+    private String partNames;
+
+    /**
+     * 备注
+     */
+    private String remark;
 }
 }

+ 5 - 4
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/CommonService.java

@@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.model.constant.NumberConstant;
+import com.sckw.core.model.enums.DictEnum;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.web.response.PhpResult;
 import com.sckw.core.web.response.PhpResult;
 import com.sckw.slope.detection.dao.mysql.KwsDictMapper;
 import com.sckw.slope.detection.dao.mysql.KwsDictMapper;
@@ -18,11 +19,9 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
 
-import java.util.Base64;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 
 /**
 /**
  * @author lfdc
  * @author lfdc
@@ -86,4 +85,6 @@ public class CommonService {
         }
         }
         return map;
         return map;
     }
     }
+
+
 }
 }

+ 51 - 9
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/DeviceModelService.java

@@ -1,5 +1,6 @@
 package com.sckw.slope.detection.service;
 package com.sckw.slope.detection.service;
 
 
+import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
@@ -7,20 +8,22 @@ import com.github.pagehelper.PageInfo;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.model.enums.DeviceEnum;
 import com.sckw.core.model.enums.DeviceEnum;
+import com.sckw.core.model.enums.DictEnum;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.model.page.PageRes;
 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.KwsDeviceModelMapper;
 import com.sckw.slope.detection.dao.mysql.KwsDeviceModelMapper;
-import com.sckw.slope.detection.model.dos.mysql.KwsDevice;
-import com.sckw.slope.detection.model.dos.mysql.KwsDeviceModel;
-import com.sckw.slope.detection.model.dos.mysql.KwsProjectArea;
-import com.sckw.slope.detection.model.dos.mysql.KwsProjectDevice;
+import com.sckw.slope.detection.dao.mysql.KwsDeviceModelPartMapper;
+import com.sckw.slope.detection.dao.mysql.KwsIntegrationMapper;
+import com.sckw.slope.detection.model.dos.mysql.*;
 import com.sckw.slope.detection.model.dto.HeaderData;
 import com.sckw.slope.detection.model.dto.HeaderData;
 import com.sckw.slope.detection.model.param.DeviceModelAdd;
 import com.sckw.slope.detection.model.param.DeviceModelAdd;
 import com.sckw.slope.detection.model.param.DeviceModelQuery;
 import com.sckw.slope.detection.model.param.DeviceModelQuery;
 import com.sckw.slope.detection.model.vo.DeviceModelVo;
 import com.sckw.slope.detection.model.vo.DeviceModelVo;
-import com.sckw.slope.detection.model.vo.DeviceVo;
-import com.sckw.slope.detection.model.vo.ProjectVo;
+import com.sckw.slope.detection.model.dos.mysql.KwsDeviceModelPart;
+import com.sckw.slope.detection.model.dto.SystemDict;
+import com.sckw.slope.detection.model.vo.DevicePartModelVo;
+import com.sckw.slope.detection.model.vo.IntegrationItemVO;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletRequest;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpResponse;
@@ -31,8 +34,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.List;
-import java.util.Map;
+import java.util.*;
 
 
 /**
 /**
  * @author sky
  * @author sky
@@ -49,6 +51,12 @@ public class DeviceModelService {
     @Autowired
     @Autowired
     KwsDeviceModelMapper kwsDeviceModelMapper;
     KwsDeviceModelMapper kwsDeviceModelMapper;
 
 
+    @Autowired
+    KwsDeviceModelPartMapper kwsDeviceModelPartMapper;
+
+    @Autowired
+    KwsIntegrationMapper kwsIntegrationMapper;
+
     /**
     /**
      * 项目管理分页查询
      * 项目管理分页查询
      *
      *
@@ -100,7 +108,41 @@ public class DeviceModelService {
         DeviceModelVo vo = new DeviceModelVo();
         DeviceModelVo vo = new DeviceModelVo();
         BeanUtils.copyProperties(device, vo);
         BeanUtils.copyProperties(device, vo);
         vo.setStatusText(DeviceEnum.getName(vo.getStatus()));
         vo.setStatusText(DeviceEnum.getName(vo.getStatus()));
-
+        //获取要数
+        List<DevicePartModelVo> deviceModelPart= kwsDeviceModelPartMapper.selectByModelId(vo.getId());
+        //获取字典
+        Map<String, SystemDict> dictList = commonService.getDictList(null, new HashMap<String, String>() {{
+            put("code", DictEnum.MODEL_PART.getCodeType());
+            put("type", "1");
+        }});
+        //获取集成要素-start
+        List<String> partData = new ArrayList<>();
+        List<String> intList = new ArrayList<>();
+        //Map<String,IntegrationItemVO> map = new HashMap<>();
+        List<IntegrationItemVO> dataList = new ArrayList<>();
+        for (DevicePartModelVo part : deviceModelPart) {
+            for(SystemDict value : dictList.values()){
+                if(part.getPartName().equals(value.getValue())){
+                    partData.add(value.getLabel());
+                    //查询对应的集成要素
+                    List<IntegrationItemVO> integrationItemVO = kwsIntegrationMapper.getDataByFindInSet(value.getValue());
+                    for (IntegrationItemVO intvo : integrationItemVO) {
+                        if(!intList.contains(intvo.getId())){//判断是否存在
+                            intList.add(intvo.getId());
+                            dataList.add(intvo);
+                        }
+                    }
+                }
+            }
+        }
+        //获取集成要素-end
+        List<SystemDict> systemDict = new ArrayList<>();
+        for(SystemDict value : dictList.values()){
+            systemDict.add((value));
+        }
+        vo.setPart(partData);
+        vo.setIntegration(dataList);
+        vo.setSystemDict(systemDict);
         return HttpResult.ok(vo);
         return HttpResult.ok(vo);
     }
     }
 
 

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

@@ -1,5 +1,6 @@
 package com.sckw.slope.detection.service;
 package com.sckw.slope.detection.service;
 
 
+import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
@@ -152,6 +153,7 @@ public class DeviceService {
         device.setUpdateTime(now);
         device.setUpdateTime(now);
         device.setMountainId(headerData.getCompanyId());
         device.setMountainId(headerData.getCompanyId());
         deviceMapper.insert(device);
         deviceMapper.insert(device);
+        //log.info("设备新增 add param:{}", JSONObject.toJSONString(a));
         return HttpResult.ok();
         return HttpResult.ok();
     }
     }
 
 

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

@@ -52,7 +52,6 @@
                left join kws_project as p on pd.project_id = p.id
                left join kws_project as p on pd.project_id = p.id
       WHERE d.del_flag = 0
       WHERE d.del_flag = 0
         and m.del_flag = 0
         and m.del_flag = 0
-      <where>
           <if test="deviceQuery.name != null and deviceQuery.name != ''">
           <if test="deviceQuery.name != null and deviceQuery.name != ''">
               and name like concat('%', #{deviceQuery.name}
               and name like concat('%', #{deviceQuery.name}
                    , '%')
                    , '%')
@@ -63,7 +62,6 @@
           <if test="deviceQuery.attribute != null and deviceQuery.attribute != ''">
           <if test="deviceQuery.attribute != null and deviceQuery.attribute != ''">
               and attribute = #{deviceQuery.attribute,jdbcType=TINYINT}
               and attribute = #{deviceQuery.attribute,jdbcType=TINYINT}
           </if>
           </if>
-      </where>
   </select>
   </select>
   <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDevice">
   <insert id="insert" parameterType="com.sckw.slope.detection.model.dos.mysql.KwsDevice">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
@@ -72,13 +70,13 @@
       valid_time, secret_key, inter_face,
       valid_time, secret_key, inter_face,
       remark, `status`, create_by, 
       remark, `status`, create_by, 
       create_time, update_by, update_time, 
       create_time, update_by, update_time, 
-      del_flag,related)
+      del_flag,related,mountain_id)
     values (#{id,jdbcType=BIGINT}, #{attribute,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, 
     values (#{id,jdbcType=BIGINT}, #{attribute,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, 
       #{alias,jdbcType=VARCHAR}, #{snCode,jdbcType=VARCHAR}, #{modelId,jdbcType=BIGINT}, 
       #{alias,jdbcType=VARCHAR}, #{snCode,jdbcType=VARCHAR}, #{modelId,jdbcType=BIGINT}, 
       #{validTime,jdbcType=TIMESTAMP}, #{secretKey,jdbcType=VARCHAR}, #{interFace,jdbcType=VARCHAR},
       #{validTime,jdbcType=TIMESTAMP}, #{secretKey,jdbcType=VARCHAR}, #{interFace,jdbcType=VARCHAR},
       #{remark,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, #{createBy,jdbcType=BIGINT}, 
       #{remark,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, #{createBy,jdbcType=BIGINT}, 
       #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, 
       #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, 
-      #{delFlag,jdbcType=TINYINT},#{related,jdbcType=BIGINT})
+      #{delFlag,jdbcType=TINYINT},#{related,jdbcType=BIGINT},#{mountainId,jdbcType=VARCHAR})
   </insert>
   </insert>
 
 
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">

+ 13 - 1
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceModelPartMapper.xml

@@ -21,11 +21,22 @@
   </sql>
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
-    select 
+    select
     <include refid="Base_Column_List" />
     <include refid="Base_Column_List" />
     from kws_device_model_part
     from kws_device_model_part
     where id = #{id,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}
   </select>
   </select>
+    <select id="selectByModelId" parameterType="java.lang.Long" resultType="com.sckw.slope.detection.model.vo.DevicePartModelVo">
+        <!--@mbg.generated-->
+        select
+        <include refid="Base_Column_List" />
+        from kws_device_model_part
+        where del_flag=0
+        <if test="deviceModelId != null">
+            and device_model_id = #{deviceModelId,jdbcType=BIGINT}
+        </if>
+        order by part_name
+    </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
     delete from kws_device_model_part
     delete from kws_device_model_part
@@ -209,4 +220,5 @@
       and a.mountain_id = #{mountainId}
       and a.mountain_id = #{mountainId}
       and a.project_id = #{projectId}
       and a.project_id = #{projectId}
     </select>
     </select>
+
 </mapper>
 </mapper>

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

@@ -27,6 +27,7 @@
     from kws_device_relation
     from kws_device_relation
     where id = #{id,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}
   </select>
   </select>
+
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
     delete from kws_device_relation
     delete from kws_device_relation

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

@@ -12,7 +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="mountain_id" jdbcType="VARCHAR" property="mountainId" />
     <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" />
@@ -21,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,company_id
+    update_by, update_time, del_flag,mountain_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-->
@@ -30,6 +30,13 @@
     from kws_integration
     from kws_integration
     where id = #{id,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}
   </select>
   </select>
+  <select id="getDataByFindInSet" resultType="com.sckw.slope.detection.model.vo.IntegrationItemVO">
+    <!--@mbg.generated-->
+    select
+    <include refid="Base_Column_List" />
+    from kws_integration
+    where FIND_IN_SET(#{partNames,jdbcType=VARCHAR},part_names)
+  </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
     <!--@mbg.generated-->
     <!--@mbg.generated-->
     delete from kws_integration
     delete from kws_integration