Răsfoiți Sursa

Merge branch 'dev' into sky_v2

15928045575 2 ani în urmă
părinte
comite
9d62361267
15 a modificat fișierele cu 185 adăugiri și 19 ștergeri
  1. 1 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/DictEnum.java
  2. 28 0
      slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ProjectTypeEnum.java
  3. 2 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/dao/mysql/KwsProjectMapper.java
  4. 6 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsDevice.java
  5. 10 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dos/mysql/KwsProject.java
  6. 9 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/BindDevice.java
  7. 12 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/ProjectAddDTO.java
  8. 12 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/ProjectUpdateDTO.java
  9. 14 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ProjectVo.java
  10. 4 0
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/UpdateDeviceBindSelectVO.java
  11. 55 6
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ProjectService.java
  12. 3 1
      slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/task/DeviceAlarmTaskService.java
  13. 1 1
      slope-modules/slope-detection/src/main/resources/bootstrap-lfdc.yml
  14. 2 1
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsDeviceMapper.xml
  15. 26 10
      slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsProjectMapper.xml

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

@@ -16,6 +16,7 @@ public enum DictEnum {
     ALARM_DETAIL_TYPE("alarm_detail_type", "告警明细类型"),
     REPORT_TEMPLATE_TYPE("report_template_type", "报表模板"),
     INTEGRATION_UNIT("integration_unit", "集成要素单位"),
+    PROJECT_TYPE("project_type", "项目类型"),
     COMPANY("company", "厂商"),
     ;
     private final String codeType;

+ 28 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/ProjectTypeEnum.java

@@ -0,0 +1,28 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+/**
+ * @author lfdc
+ * @desc 边坡类型
+ * @date 2023/6/15
+ */
+@Getter
+public enum ProjectTypeEnum {
+    /**
+     * AA 为边坡类型:01 为采场边坡,02 为排土场边坡,03 为采场出入口,04 为尾矿库坝体边坡,05 为其他。BB 为边坡编号。见表 A-3。
+     */
+    PROJECT_TYPE_ONE("01", "采场边坡"),
+    PROJECT_TYPE_TWO("02", "排土场边坡"),
+    PROJECT_TYPE_THREE("03", "采场出入口"),
+    PROJECT_TYPE_FOUR("04", "尾矿库坝体边坡"),
+    PROJECT_TYPE_FIVE("05", "其他"),
+    ;
+    private final String status;
+    private final String name;
+    ProjectTypeEnum(String status, String name) {
+        this.status = status;
+        this.name = name;
+
+    }
+}

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

@@ -34,4 +34,6 @@ public interface KwsProjectMapper extends BaseMapper<KwsProject> {
     List<ProjectDeviceVO> selectNotBindDeviceList(@Param("deviceQuery") DeviceQuery deviceQuery);
 
     List<KwsProject> selectListData(@Param("ids") List<String> ids, @Param("delFlag") Integer delFlag);
+
+    List<KwsProject> selectListByType(@Param("projectType") String projectType);
 }

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

@@ -52,6 +52,12 @@ public class KwsDevice implements Serializable {
 
     private LocalDateTime validTime;
 
+    /**
+     * 安装时间
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private LocalDateTime installTime;
+
     /**
      * 秘钥
      */

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

@@ -79,6 +79,16 @@ public class KwsProject implements Serializable {
      */
     private String buildPhone;
 
+    /**
+     * 项目类型
+     */
+    private String projectType;
+
+    /**
+     * 项目编号
+     */
+    private String projectNo;
+
     /**
      * 备注
      */

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

@@ -1,7 +1,9 @@
 package com.sckw.slope.detection.model.dto;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import jakarta.validation.constraints.NotBlank;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.io.Serializable;
 
@@ -31,4 +33,11 @@ public class BindDevice implements Serializable {
     private String bindDeviceId;
 
     private String alias;
+
+    /**
+     * 安装设备时间
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private String installTime;
 }

+ 12 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/ProjectAddDTO.java

@@ -67,6 +67,18 @@ public class ProjectAddDTO implements Serializable {
      */
     private String designContacts;
 
+
+    /**
+     * 项目类型
+     */
+    @NotBlank(message = "项目类型不能为空")
+    private String projectType;
+
+    /**
+     * 项目编号
+     */
+    private String projectNo;
+
     /**
      * 设计单位联系人电话
      */

+ 12 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/dto/ProjectUpdateDTO.java

@@ -15,6 +15,18 @@ import java.math.BigDecimal;
 @Data
 public class ProjectUpdateDTO implements Serializable {
 
+    /**
+     * 项目类型
+     */
+    @NotBlank(message = "项目类型不能为空")
+    private String projectType;
+
+    /**
+     * 项目编号
+     */
+    @NotBlank(message = "项目编号不能为空")
+    private String projectNo;
+
     /**
      * 项目id
      */

+ 14 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/ProjectVo.java

@@ -124,6 +124,20 @@ public class ProjectVo implements Serializable {
      * 项目名称
      */
     private String projectName;
+    /**
+     * 项目类型
+     */
+    private String projectType;
+
+    /**
+     * 项目类型
+     */
+    private String projectTypeLabel;
+
+    /**
+     * 项目编号
+     */
+    private String projectNo;
 
     /**
      * 删除标识

+ 4 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/UpdateDeviceBindSelectVO.java

@@ -35,4 +35,8 @@ public class UpdateDeviceBindSelectVO implements Serializable {
      */
     private String relateDeviceAlias;
 
+    /**
+     * 按照时间
+     */
+    private String installTime;
 }

+ 55 - 6
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ProjectService.java

@@ -45,6 +45,7 @@ import java.math.RoundingMode;
 import java.text.SimpleDateFormat;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -139,6 +140,18 @@ public class ProjectService {
         project.setUpdateBy(Long.parseLong(headerData.getUpdateBy()));
         project.setUpdateTime(now);
         project.setCompanyId(headerData.getCompanyId());
+        project.setProjectType(projectAddDto.getProjectType());
+        List<KwsProject> projectList = projectMapper.selectListByType(projectAddDto.getProjectType());
+        if (projectList.size() > 99) {
+            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, "当前类型项目已经增加上限!");
+        }
+        String projectNo = "1";
+        if (Objects.isNull(projectList)) {
+            projectNo = StringUtils.addZeroForNum(projectNo, 2);
+        } else {
+            projectNo = StringUtils.addZeroForNum(String.valueOf(projectList.size() + 1), 2);
+        }
+        project.setProjectNo(projectAddDto.getProjectType() + projectNo);
         projectMapper.insert(project);
         KwsProjectArea area = new KwsProjectArea();
         area.setId(new IdWorker(NumberConstant.ONE).nextId());
@@ -177,7 +190,11 @@ public class ProjectService {
         if (CollectionUtils.isEmpty(list)) {
             return PageRes.build(pageInfo, list);
         }
+        Map<String, SystemDict> projectType = commonService.getDictByDictCode(DictEnum.PROJECT_TYPE);
         for (ProjectVo vo : list) {
+            vo.setProjectTypeLabel(vo.getProjectType() == null ? null :
+                    (projectType.get(vo.getProjectType()) == null ? vo.getProjectType() :
+                            projectType.get(vo.getProjectType()).getLabel()));
             vo.setDeviceTotal(projectDeviceMapper.selectCount(new LambdaQueryWrapper<KwsProjectDevice>().eq(KwsProjectDevice::getProjectId, vo.getId())).intValue());
             KwsProjectArea area = projectAreaMapper.selectOne(new LambdaQueryWrapper<KwsProjectArea>().eq(KwsProjectArea::getProjectId, vo.getId()));
             vo.setFence(area == null ? null : area.getFence());
@@ -187,6 +204,7 @@ public class ProjectService {
     }
 
     public HttpResult detail(String id, HttpServletRequest response) {
+        Map<String, SystemDict> projectType = commonService.getDictByDictCode(DictEnum.PROJECT_TYPE);
         KwsProject project = projectMapper.selectOne(new LambdaQueryWrapper<KwsProject>()
                         .eq(KwsProject::getId, id)
                 /**.eq(KwsProject::getCompanyId, commonService.getHeaderData(response).getCompanyId())*/);
@@ -195,6 +213,9 @@ public class ProjectService {
         KwsProjectArea area = projectAreaMapper.selectOne(new LambdaQueryWrapper<KwsProjectArea>().eq(KwsProjectArea::getProjectId, vo.getId()));
         vo.setFence(area == null ? null : area.getFence());
         vo.setArea(area == null ? null : area.getArea());
+        vo.setProjectTypeLabel(vo.getProjectType() == null ? null :
+                (projectType.get(vo.getProjectType()) == null ? vo.getProjectType() :
+                        projectType.get(vo.getProjectType()).getLabel()));
         return HttpResult.ok(vo);
     }
 
@@ -240,7 +261,7 @@ public class ProjectService {
             throw new BusinessException("项目存在关联设备,不允许删除!");
         }
         int update = projectMapper.update(null, new LambdaUpdateWrapper<KwsProject>().in(KwsProject::getId, list).set(KwsProject::getDelFlag, "1"));
-        projectAreaMapper.update(null,new LambdaUpdateWrapper<KwsProjectArea>().in(KwsProjectArea::getProjectId,list).set(KwsProjectArea::getDelFlag,1));
+        projectAreaMapper.update(null, new LambdaUpdateWrapper<KwsProjectArea>().in(KwsProjectArea::getProjectId, list).set(KwsProjectArea::getDelFlag, 1));
         Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
         logMap.put("projectName", project.getName());
         logMap.put("mountainName", project.getMountainName());
@@ -315,6 +336,9 @@ public class ProjectService {
 
     @Transactional
     public HttpResult deviceBind(BindDevice bindDevice, HttpServletRequest request) {
+//        if (org.apache.commons.lang3.StringUtils.isBlank(bindDevice.getInstallTime())) {
+//            return HttpResult.error("安装设备时间不能为空");
+//        }
         HeaderData headerData = commonService.getHeaderData(request);
         Long projectId = Long.parseLong(bindDevice.getProjectId());
         KwsProject project = projectMapper.selectOne(new LambdaQueryWrapper<KwsProject>().eq(KwsProject::getId, projectId));
@@ -378,6 +402,13 @@ public class ProjectService {
                 projectDeviceMapper.insert(device);
             });
         }
+        LocalDateTime localDateTime;
+        if (StringUtils.isNotBlank(bindDevice.getInstallTime())) {
+            String installTime = bindDevice.getInstallTime();
+            localDateTime = DateUtil.strToLocalDateTime(installTime);
+        } else {
+            localDateTime = null;
+        }
         //设备修改状态
         if (!CollectionUtils.isEmpty(list)) {
             list.forEach(id -> {
@@ -387,6 +418,7 @@ public class ProjectService {
                     if (kwsDevice == null) {
                         throw new BusinessException("所属主设备id错误!");
                     }
+                    kwsDevice.setInstallTime(localDateTime);
                     kwsDevice.setRelevanceLevel(level);
                     kwsDevice.setUpdateTime(LocalDateTime.now());
                     kwsDevice.setUpdateBy(headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
@@ -396,6 +428,7 @@ public class ProjectService {
                 deviceMapper.update(null, new LambdaUpdateWrapper<KwsDevice>()
                         .eq(KwsDevice::getId, id)
                         .set(KwsDevice::getRelevanceLevel, level)
+                        .set(KwsDevice::getInstallTime,localDateTime)
                         .set(KwsDevice::getStatus, DeviceEnum.BE_CHECKING.getCode())
                         .set(KwsDevice::getOnline, 1)
                         .set(KwsDevice::getAlias, bindDevice.getAlias() == null ? kwsDevice.getName() : bindDevice.getAlias())
@@ -1216,7 +1249,7 @@ public class ProjectService {
                             .ne(KwsDeviceRelation::getRelateDeviceId, deviceId)
             );
             //主设备数据
-            KwsDeviceRelation deviceRelation = deviceRelationMapper.selectOne(
+            List<KwsDeviceRelation> deviceRelation = deviceRelationMapper.selectList(
                     new LambdaQueryWrapper<KwsDeviceRelation>()
                             .eq(KwsDeviceRelation::getDeviceId, deviceId)
                             .eq(KwsDeviceRelation::getDelFlag, 0)
@@ -1224,7 +1257,7 @@ public class ProjectService {
                             .eq(KwsDeviceRelation::getRelateDeviceId, deviceId)
             );
             if (deviceRelation != null) {
-                deleteList.add(deviceRelation.getId());
+                deleteList.addAll(deviceRelation.stream().map(KwsDeviceRelation::getId).distinct().collect(Collectors.toList()));
             }
             if (!CollectionUtils.isEmpty(deviceRelationList) && deviceRelationList.size() > 0) {
                 deleteList = deviceRelationList.stream().map(KwsDeviceRelation::getId).collect(Collectors.toList());
@@ -1272,6 +1305,7 @@ public class ProjectService {
                     .eq(KwsDevice::getMountainId, headerData.getMountainId())
                     .eq(KwsDevice::getDelFlag, 0)
                     .set(KwsDevice::getRelevanceLevel, 0)
+                    .set(KwsDevice::getInstallTime, null)
                     .set(KwsDevice::getLogicAlt, null)
                     .set(KwsDevice::getLogicLat, null)
                     .set(KwsDevice::getLogicLng, null)
@@ -1494,9 +1528,9 @@ public class ProjectService {
                                     if (alarmStatus.equals(String.valueOf(threshold.getLevel()))) {
                                         List<KwsAlarmDetail> alarmDetails = alarmDetailMapper.selectList(
                                                 new LambdaQueryWrapper<KwsAlarmDetail>()
-                                                .eq(KwsAlarmDetail::getPid, threshold.getId())
-                                                .eq(KwsAlarmDetail::getStatus, 0)
-                                                .eq(KwsAlarmDetail::getDelFlag, 0)
+                                                        .eq(KwsAlarmDetail::getPid, threshold.getId())
+                                                        .eq(KwsAlarmDetail::getStatus, 0)
+                                                        .eq(KwsAlarmDetail::getDelFlag, 0)
                                         );
                                         if (!CollectionUtils.isEmpty(alarmDetails) && alarmDetails.size() > 0) {
                                             thresholdId = alarmDetails.get(0).getAlarmId().toString();
@@ -1539,12 +1573,17 @@ public class ProjectService {
             bindSelectVO.setRelateDeviceId(relateDeviceId);
             bindSelectVO.setRelateDeviceName(relateDevice == null ? null : relateDevice.getName());
             bindSelectVO.setRelateDeviceAlias(relateDevice == null ? null : relateDevice.getAlias());
+            bindSelectVO.setInstallTime(kwsDevice.getInstallTime() == null ? null :
+                    cn.hutool.core.date.DateUtil.format(kwsDevice.getInstallTime(), "yyyy-MM-dd"));
         }
         return HttpResult.ok(bindSelectVO);
     }
 
     @Transactional
     public HttpResult updateDeviceBind(BindDevice bindDevice, HttpServletRequest request) {
+//        if (org.apache.commons.lang3.StringUtils.isBlank(bindDevice.getInstallTime())) {
+//            return HttpResult.error("安装设备时间不能为空");
+//        }
         String deviceRelationId = bindDevice.getDeviceRelationId();
         if (StringUtils.isBlank(deviceRelationId)) {
             return HttpResult.error("关联主键id不能为空");
@@ -1647,6 +1686,14 @@ public class ProjectService {
                 projectDeviceMapper.insert(device);
             });
         }
+        LocalDateTime localDateTime;
+        if (org.apache.commons.lang3.StringUtils.isNotBlank(bindDevice.getInstallTime())) {
+            String installTime = bindDevice.getInstallTime();
+            installTime = installTime + " 00:00:00";
+            localDateTime = LocalDateTime.parse(installTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
+        } else {
+            localDateTime = null;
+        }
         //设备修改状态
         if (!CollectionUtils.isEmpty(list)) {
             list.forEach(id -> {
@@ -1656,6 +1703,7 @@ public class ProjectService {
                     if (kwsDevice == null) {
                         throw new BusinessException("所属主设备id错误!");
                     }
+                    kwsDevice.setInstallTime(localDateTime);
                     kwsDevice.setRelevanceLevel(level);
                     kwsDevice.setUpdateTime(LocalDateTime.now());
                     kwsDevice.setUpdateBy(headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
@@ -1666,6 +1714,7 @@ public class ProjectService {
                         .eq(KwsDevice::getId, id)
                         .set(KwsDevice::getRelevanceLevel, level)
                         .set(KwsDevice::getStatus, DeviceEnum.BE_CHECKING.getCode())
+                        .set(KwsDevice::getInstallTime, localDateTime)
                         .set(KwsDevice::getOnline, 1)
                         .set(KwsDevice::getAlias, bindDevice.getAlias() == null ? kwsDevice.getName() : bindDevice.getAlias())
                         .set(KwsDevice::getUpdateTime, LocalDateTime.now())

+ 3 - 1
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/task/DeviceAlarmTaskService.java

@@ -5,6 +5,7 @@ import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.model.enums.AlarmLevelEnum;
 import com.sckw.core.model.enums.AlarmTitleEnum;
 import com.sckw.core.model.enums.AlarmTypeEnum;
+import com.sckw.core.model.enums.DeviceEnum;
 import com.sckw.core.utils.IdWorker;
 import com.sckw.excel.utils.DateUtil;
 import com.sckw.log.TraceLog.TraceLog;
@@ -86,6 +87,7 @@ public class DeviceAlarmTaskService {
         List<KwsDevice> deviceList = deviceMapper.selectList(
                 new LambdaQueryWrapper<KwsDevice>()
                         .eq(KwsDevice::getDelFlag, 0)
+                        .eq(KwsDevice::getStatus, DeviceEnum.ALREADY_REFERRED_TO.getCode())
         );
         if (!CollectionUtils.isEmpty(deviceList) && deviceList.size() > 0) {
             for (KwsDevice device : deviceList) {
@@ -156,7 +158,7 @@ public class DeviceAlarmTaskService {
             templateParam.put("time", cn.hutool.core.date.DateUtil.format(LocalDateTime.now(), "yyyy-MM-dd HH:mm:ss"));
             ProjectVo vo = projectDeviceMapper.selectProjectByDeviceId(device.getId());
             templateParam.put("project", vo == null ? null : vo.getProjectName());
-            templateParam.put("value",  cn.hutool.core.date.DateUtil.format(localDateTime, "yyyy-MM-dd HH:mm:ss"));
+            templateParam.put("value", cn.hutool.core.date.DateUtil.format(localDateTime, "yyyy-MM-dd HH:mm:ss"));
             templateParam.put("type", "设备离线告警");
             templateParam.put("element", AlarmTitleEnum.ALARM_TITLE_ONE.getName());
 //            commonService.pushEmailMessage(emailAddress

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

@@ -51,7 +51,7 @@ mqtt:
     #连接的mqtt地址
     url: tcp://10.10.10.108
     #客户端id
-    clientId: mqttx_45986965ec1
+    clientId: mqttx_4c1
     #推送主题  后面跟着#是监控下面所有的话题
     topic: system/iot/device_data_slope/#
     #topic: my-test

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

@@ -13,6 +13,7 @@
     <result column="model_id" jdbcType="BIGINT" property="modelId" />
     <result column="mountain_id" jdbcType="VARCHAR" property="mountainId" />
     <result column="valid_time" jdbcType="TIMESTAMP" property="validTime" />
+    <result column="install_time" jdbcType="TIMESTAMP" property="installTime" />
     <result column="secret_key" jdbcType="VARCHAR" property="secretKey" />
     <result column="relevance_level" jdbcType="VARCHAR" property="relevanceLevel" />
     <result column="inter_face" jdbcType="VARCHAR" property="interFace" />
@@ -29,7 +30,7 @@
   <sql id="Base_Column_List">
     <!--@mbg.generated-->
     id, `attribute`, `name`, `alias`, sn_code, model_id, valid_time, secret_key, inter_face,relevance_level,sn_code_full_name,
-    remark, `status`, create_by, create_time, update_by, update_time, del_flag,mountain_id,related,check_time,online
+    remark, `status`, create_by, create_time, update_by, update_time, del_flag,mountain_id,related,check_time,online,install_time
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
       <!--@mbg.generated-->

+ 26 - 10
slope-modules/slope-detection/src/main/resources/mapper/mysql/KwsProjectMapper.xml

@@ -17,6 +17,8 @@
         <result column="build_company" jdbcType="VARCHAR" property="buildCompany"/>
         <result column="build_contacts" jdbcType="VARCHAR" property="buildContacts"/>
         <result column="build_phone" jdbcType="VARCHAR" property="buildPhone"/>
+        <result column="project_type" jdbcType="VARCHAR" property="projectType"/>
+        <result column="project_no" jdbcType="VARCHAR" property="projectNo"/>
         <result column="remark" jdbcType="VARCHAR" property="remark"/>
         <result column="status" jdbcType="TINYINT" property="status"/>
         <result column="create_by" jdbcType="BIGINT" property="createBy"/>
@@ -30,6 +32,8 @@
         id,
         `name`,
         mountain_id,
+        project_type,
+        project_no,
         mountain_name,
         platform_name,
         platform_address,
@@ -60,7 +64,7 @@
         <if test="projectQueryDto.name != null and projectQueryDto.name != ''">
             and name like concat('%', #{projectQueryDto.name}, '%')
         </if>
-        order by  create_time desc
+        order by create_time desc
     </select>
 
     <select id="selectDeviceByProjectId" resultType="com.sckw.slope.detection.model.vo.ProjectDeviceVO">
@@ -93,7 +97,7 @@
             AND c.id = #{deviceId}
         </if>
         <if test="type != null and type != ''">
-           and  e.part_name  = #{type}
+            and e.part_name = #{type}
         </if>
     </select>
 
@@ -195,23 +199,23 @@
           AND a.relevance_level = 0
         <if test="deviceQuery.manufacturer != null and deviceQuery.manufacturer != ''">
             and d.manufacturer like concat('%'
-              , #{deviceQuery.manufacturer}
-              , '%')
+                , #{deviceQuery.manufacturer}
+                , '%')
         </if>
         <if test="deviceQuery.deviceType != null and deviceQuery.deviceType != ''">
             and d.device_type like concat('%'
-              , #{deviceQuery.deviceType}
-              , '%')
+                , #{deviceQuery.deviceType}
+                , '%')
         </if>
         <if test="deviceQuery.deviceModel != null and deviceQuery.deviceModel != ''">
             and d.name like concat('%'
-              , #{deviceQuery.deviceModel}
-              , '%')
+                , #{deviceQuery.deviceModel}
+                , '%')
         </if>
         <if test="deviceQuery.name != null and deviceQuery.name != ''">
             and a.name like concat('%'
-              , #{deviceQuery.name}
-              , '%')
+                , #{deviceQuery.name}
+                , '%')
         </if>
     </select>
 
@@ -230,4 +234,16 @@
             </if>
         </where>
     </select>
+
+    <select id="selectListByType" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List">
+        </include>
+        from kws_project
+        <where>
+            <if test="projectType != null and projectType != ''">
+            </if>
+            and project_type like concat(#{projectType}, '%')
+        </where>
+    </select>
 </mapper>