Bläddra i källkod

Merge remote-tracking branch 'origin/zdsz3.0' into zdsz3.0

# Conflicts:
#	ruoyi-admin/src/main/resources/application-dev.yml
JX.Li 1 år sedan
förälder
incheckning
b1eae35d9d

+ 4 - 5
ruoyi-admin/src/main/resources/application-dev.yml

@@ -50,11 +50,10 @@ spring:
           # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
           # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
 #          url: jdbc:mysql://192.168.10.15:63306/sj_zdsz?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
-#          username: root
-#          password: sooka1a2b3c4d%...
-          url: jdbc:mysql://121.36.97.146:13306/zdsz?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
-          username: zdsz
-          password: ZDSZ1a2b3c4d%...
+          url: jdbc:mysql://192.168.10.15:63306/zdsz_xstb?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
+          username: root
+          password: sooka1a2b3c4d%...
+
         # 从库数据源
 #        slave:
 #          lazy: true

+ 8 - 4
ruoyi-admin/src/main/resources/application-prod.yml

@@ -52,8 +52,11 @@ spring:
           driverClassName: com.mysql.cj.jdbc.Driver
           # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
           # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
-          url: jdbc:mysql://121.36.97.146:13306/zdsz?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
-          username: zdsz
+#          url: jdbc:mysql://121.36.97.146:13306/zdsz?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
+#          username: zdsz
+#          password: ZDSZ1a2b3c4d%...
+          url: jdbc:mysql://123.249.95.134:13306/zdsz?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
+          username: root
           password: ZDSZ1a2b3c4d%...
         # 从库数据源
 #        slave:
@@ -107,7 +110,7 @@ spring:
     # 数据库索引
     database: 0
     # 密码(如没有密码请注释掉)
-    password: ZDSZ1a2b3c4d%...
+#    password: ZDSZ1a2b3c4d%...
     # 连接超时时间
     timeout: 10s
     # 是否开启ssl
@@ -199,4 +202,5 @@ tableNames:
   Year: z_engineering_review
 
 # 临时文件路径
-filePath: /usr/local/zdsz/temporary/
+#filePath: /usr/local/zdsz/temporary/
+filePath: /zdsz/temporary/

+ 2 - 0
ruoyi-admin/src/main/resources/application.yml

@@ -138,6 +138,8 @@ security:
     - /actuator/**
     # 文件下载路径
     - /zdsz/area/upload
+    # 字典类型公共文件
+    - /system/dict/data/type/*
 
 # MyBatisPlus配置
 # https://baomidou.com/config/

+ 1 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/ZEnginNotInstalled.java

@@ -35,6 +35,7 @@ public class ZEnginNotInstalled extends BaseEntity {
     private String unitName;
     private String houseName;
     private String type;
+    private String enginType;
     /**
      * 备注
      */

+ 1 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/bo/ZEnginNotInstalledBo.java

@@ -36,6 +36,7 @@ public class ZEnginNotInstalledBo extends BaseEntity {
     private String unitName;
     private String houseName;
     private String type;
+    private String enginType;
     private String remark;
     private String delFlag;
 

+ 2 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/vo/BulidingStatusVo.java

@@ -35,4 +35,6 @@ public class BulidingStatusVo {
      */
     @ExcelProperty(value = "竣工(户)")
     private   String done;
+    @ExcelProperty(value = "未安装(户)")
+    private   String notInstall;
 }

+ 11 - 19
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/vo/ZComprehensiveVo.java

@@ -28,47 +28,51 @@ public class ZComprehensiveVo extends BaseEntity implements Serializable {
     /**
      *
      */
-    @ExcelProperty(value = "")
     private String id;
 
     /**
      * 小区id
      */
-    @ExcelProperty(value = "小区id")
     private String areaId;
 
     /**
      * 楼栋id
      */
-    @ExcelProperty(value = "楼栋id")
     private String buildingId;
 
     /**
      * 单元id
      */
-    @ExcelProperty(value = "单元id")
     private String unitId;
 
     @ExcelProperty(value = "行政区", converter = ExcelDictConvert.class)
     @ExcelDictFormat(dictType = "district")
     private String district;
+    @ExcelProperty(value = "小区")
+    private String areaName;
+
+    @ExcelProperty(value = "楼栋")
+    private String buildingName;
 
+    @ExcelProperty(value = "单元")
+    private String unitName;
+
+    @ExcelProperty(value = "房间号")
+    private String houseName;
     /**
      * 房间id
      */
-    @ExcelProperty(value = "房间id")
     private String houseId;
 
     /**
      * 类型
      */
-    @ExcelProperty(value = "类型")
     private String type;
 
     /**
      * 安检是否合格
      */
-    @ExcelProperty(value = "安检是否合格")
+    @ExcelProperty(value = "是否开栓")
     private String isQualified;
 
     /**
@@ -77,18 +81,6 @@ public class ZComprehensiveVo extends BaseEntity implements Serializable {
     @ExcelProperty(value = "备注")
     private String remark;
 
-    @ExcelProperty(value = "小区")
-    private String areaName;
-
-    @ExcelProperty(value = "楼栋")
-    private String buildingName;
-
-    @ExcelProperty(value = "单元")
-    private String unitName;
-
-    @ExcelProperty(value = "房间号")
-    private String houseName;
-
     /**
      * 入参
      */

+ 2 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/vo/ZEnginNotInstalledVo.java

@@ -52,6 +52,8 @@ public class ZEnginNotInstalledVo implements Serializable {
      */
     @ExcelProperty(value = "备注")
     private String remark;
+    private String enginType;
+
 
 
 }

+ 3 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/vo/areaStatusVo.java

@@ -38,5 +38,8 @@ public class areaStatusVo {
     @ExcelProperty(value = "竣工(户)")
     private   String done;
 
+    @ExcelProperty(value = "未安装(户)")
+    private   String notInstall;
+
 
 }

+ 3 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/mapper/ZComprehensiveMapper.java

@@ -11,6 +11,8 @@ import com.ruoyi.zdsz.domain.vo.ZEngineeringCivilVo;
 import com.ruoyi.zdsz.domain.vo.ZHouseVo;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+
 /**
  * 开栓|安检|维修Mapper接口
  *
@@ -21,6 +23,7 @@ public interface ZComprehensiveMapper extends BaseMapperPlus<ZComprehensiveMappe
 
 //    Page<ZComprehensiveVo> getPageList(@Param("p") ZComprehensiveBo bo, Page<?> page);
     Page<ZComprehensiveVo> queryPageList(@Param("p") ZComprehensiveBo bo, @Param("pa")Page<?> page, @Param("page") Integer pages, @Param("size") Integer size);
+    List<ZComprehensiveVo> queryPageListAll(@Param("p") ZComprehensiveBo bo);
     String getIsQualifiedString(String houseId);
 
 }

+ 2 - 2
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/mapper/ZEngineeringCivilMapper.java

@@ -24,8 +24,8 @@ public interface ZEngineeringCivilMapper extends BaseMapperPlus<ZEngineeringCivi
     Page<ZEngineeringCivilVo> queryPageIdList(@Param("idList") List idList, @Param("total") Long total, @Param("pa")Page<?> page,@Param("page") Integer pages,@Param("size") Integer size);
 
     List<roomStatusVo> getObtainRoomcCompletionInformationList(ZEngineeringCivilBo bo);
-    List<areaWillDoneVo> getAreaCompletionInformationList(@Param("idList") List idList,@Param("enginCycle")String enginCycle);
-    List<areaWillDoneVo> getAreaCompletionInformationList2(@Param("enginCycle")String enginCycle);
+    List<areaWillDoneVo> getAreaCompletionInformationList(@Param("idList") List idList,@Param("enginCycle")String enginCycle,@Param("enginType")String enginType);
+    List<areaWillDoneVo> getAreaCompletionInformationList2(@Param("enginCycle")String enginCycle,@Param("enginType")String enginType);
     Map<String,Number> getsumStatus(String district);
 
     areaMessageVo getHouseMessage(String Id);

+ 3 - 2
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZComprehensiveServiceImpl.java

@@ -82,8 +82,9 @@ public class ZComprehensiveServiceImpl implements IZComprehensiveService {
      */
     @Override
     public List<ZComprehensiveVo> queryList(ZComprehensiveBo bo) {
-        LambdaQueryWrapper<ZComprehensive> lqw = buildQueryWrapper(bo);
-        return baseMapper.selectVoList(lqw);
+//        LambdaQueryWrapper<ZComprehensive> lqw = buildQueryWrapper(bo);
+//        return baseMapper.selectVoList(lqw);
+        return baseMapper.queryPageListAll(bo);
     }
 
     private LambdaQueryWrapper<ZComprehensive> buildQueryWrapper(ZComprehensiveBo bo) {

+ 1 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEnginNotInstalledServiceImpl.java

@@ -80,6 +80,7 @@ public class ZEnginNotInstalledServiceImpl implements IZEnginNotInstalledService
         lqw.eq(StringUtils.isNotBlank(bo.getUnitId()), ZEnginNotInstalled::getUnitId, bo.getUnitId());
         lqw.eq(StringUtils.isNotBlank(bo.getHouseId()), ZEnginNotInstalled::getHouseId, bo.getHouseId());
         lqw.eq(StringUtils.isNotBlank(bo.getType()), ZEnginNotInstalled::getType, bo.getType());
+        lqw.eq(StringUtils.isNotBlank(bo.getEnginType()), ZEnginNotInstalled::getEnginType, bo.getEnginType());
         lqw.like(StringUtils.isNotBlank(bo.getRemark()), ZEnginNotInstalled::getRemark, bo.getRemark());
         return lqw;
     }

+ 14 - 4
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringCivilServiceImpl.java

@@ -239,7 +239,7 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
         });
         List<ZEngineeringCivilExportVo> zEngineeringCivilExportVoList = baseMapper.getexportList(DateList, format.format(new Date()), bo);
 
-        HashMap<String, List<ZEngineeringCivilExportVo>> hashMap = new HashMap<>();
+        LinkedHashMap<String, List<ZEngineeringCivilExportVo>> hashMap = new LinkedHashMap<>();
 
         for (int i = 0; i < zEngineeringCivilExportVoList.size(); i++) {
             if (hashMap.containsKey(zEngineeringCivilExportVoList.get(i).getId())) {
@@ -633,16 +633,19 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
         LambdaQueryWrapper<ZEngineeringCivil> lqw = Wrappers.lambdaQuery();
         lqw.eq(StringUtils.isNotBlank(bo.getAreaId()), ZEngineeringCivil::getAreaId, bo.getAreaId());
         if (StringUtils.isEmpty(bo.getBuildingId())) {
+            add.setBuildingId(null);
             lqw.isNull(ZEngineeringCivil::getBuildingId);
         } else {
             lqw.eq(ZEngineeringCivil::getBuildingId, bo.getBuildingId());
         }
         if (StringUtils.isEmpty(bo.getUnitId())) {
+            add.setUnitId(null);
             lqw.isNull(ZEngineeringCivil::getUnitId);
         } else {
             lqw.eq(ZEngineeringCivil::getUnitId, bo.getUnitId());
         }
         if (StringUtils.isEmpty(bo.getHouseId())) {
+            add.setHouseId(null);
             lqw.isNull(ZEngineeringCivil::getHouseId);
         } else {
             lqw.eq(ZEngineeringCivil::getHouseId, bo.getHouseId());
@@ -656,6 +659,7 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
                 izMaterialStatisticsService.insert(bo);
         }
         if (ObjectUtils.isEmpty(zEngineeringCivilVo)) {
+
             boolean flag = baseMapper.insert(add) > 0;
             if (flag) {
                 bo.setId(add.getId());
@@ -817,12 +821,14 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
             List willDone = value.stream().filter(item -> item.getRoomStatus().equals("未施工")).collect(Collectors.toList());
             List notstart = value.stream().filter(item -> item.getRoomStatus().equals("施工中")).collect(Collectors.toList());
             List done = value.stream().filter(item -> item.getRoomStatus().equals("竣工")).collect(Collectors.toList());
+            List notInstall = value.stream().filter(item -> item.getRoomStatus().equals("未安装")).collect(Collectors.toList());
             List<List<roomStatusVo>> roomStatusVoList = new ArrayList<>();
             Map<String, List<roomStatusVo>> sortMap = roomMap.entrySet().stream().sorted(Comparator.comparingInt(entry -> Integer.parseInt(entry.getKey()))).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldVal, newVal) -> oldVal, LinkedHashMap::new));
             sortMap.forEach((key1, value1) -> {
                 roomStatusVoList.add(value1);
             });
             bulidingStatusVo.setRoomStatusVoList(roomStatusVoList);
+            bulidingStatusVo.setDone(String.valueOf(notInstall.size()));
             bulidingStatusVo.setDone(String.valueOf(done.size()));
             bulidingStatusVo.setWillDone(String.valueOf(willDone.size()));
             bulidingStatusVo.setNotstart(String.valueOf(notstart.size()));
@@ -843,7 +849,7 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
         IdList.stream().forEach(item -> {
             Id.add(item.getId());
         });
-        List<areaWillDoneVo> hourseList = baseMapper.getAreaCompletionInformationList(Id, bo.getEnginCycle());
+        List<areaWillDoneVo> hourseList = baseMapper.getAreaCompletionInformationList(Id, bo.getEnginCycle(),bo.getEnginType());
         Map<String, List<areaWillDoneVo>> stringListMap = hourseList.stream().collect(Collectors.groupingBy(item -> item.getAreaId()));
         List<areaStatusVo> areaList = new ArrayList<>();
         stringListMap.forEach((key, value) -> {
@@ -851,11 +857,13 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
             List notstart = value.stream().filter(item -> item.getRoomStatus().equals("未施工")).collect(Collectors.toList());
             List willDone = value.stream().filter(item -> item.getRoomStatus().equals("施工中")).collect(Collectors.toList());
             List done = value.stream().filter(item -> item.getRoomStatus().equals("竣工")).collect(Collectors.toList());
+            List notInstall = value.stream().filter(item -> item.getRoomStatus().equals("未安装")).collect(Collectors.toList());
             areaStatusVo.setAreaId(key);
             areaStatusVo.setAreaName(value.get(0).getName());
             areaStatusVo.setWillDone(String.valueOf(willDone.size()));
             areaStatusVo.setNotstart(String.valueOf(notstart.size()));
             areaStatusVo.setDone(String.valueOf(done.size()));
+            areaStatusVo.setNotInstall(String.valueOf(notInstall.size()));
             areaStatusVo.setScale(value.get(0).getScale().toString());
             areaList.add(areaStatusVo);
         });
@@ -867,7 +875,7 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
 
     @Override
     public List<areaStatusVo> getAreaCompletionInformationList2(ZEngineeringCivilBo bo) {
-        List<areaWillDoneVo> hourseList = baseMapper.getAreaCompletionInformationList2(bo.getEnginCycle());
+        List<areaWillDoneVo> hourseList = baseMapper.getAreaCompletionInformationList2( bo.getEnginCycle(),bo.getEnginType());
         Map<String, List<areaWillDoneVo>> stringListMap = hourseList.stream().collect(Collectors.groupingBy(item -> item.getAreaId()));
         List<areaStatusVo> areaList = new ArrayList<>();
         stringListMap.forEach((key, value) -> {
@@ -875,11 +883,13 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
             List notstart = value.stream().filter(item -> item.getRoomStatus().equals("未施工")).collect(Collectors.toList());
             List willDone = value.stream().filter(item -> item.getRoomStatus().equals("施工中")).collect(Collectors.toList());
             List done = value.stream().filter(item -> item.getRoomStatus().equals("竣工")).collect(Collectors.toList());
+            List notInstall = value.stream().filter(item -> item.getRoomStatus().equals("未安装")).collect(Collectors.toList());
             areaStatusVo.setAreaId(key);
             areaStatusVo.setAreaName(value.get(0).getName());
             areaStatusVo.setWillDone(String.valueOf(willDone.size()));
             areaStatusVo.setNotstart(String.valueOf(notstart.size()));
             areaStatusVo.setDone(String.valueOf(done.size()));
+            areaStatusVo.setNotInstall(String.valueOf(notInstall.size()));
             areaStatusVo.setScale(value.get(0).getScale().toString());
             areaList.add(areaStatusVo);
         });
@@ -961,7 +971,7 @@ public class ZEngineeringCivilServiceImpl implements IZEngineeringCivilService {
             izEngineeringInfoService.deleteByIdNoDelFiles(zEngineeringInfoBo);
         });
         infoIdList.getInfoIdList().stream().forEach(item -> {
-            item.setState("1");
+            item.setState(zEngineeringReviewBo.getReviewStatus());
             izEngineeringInfoService.update(item);
         });
         ZEngineeringCivil zEngineeringCivil = baseMapper.selectById(zEngineeringNode.getCivliId());

+ 1 - 1
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringInfoServiceImpl.java

@@ -702,7 +702,7 @@ public class ZEngineeringInfoServiceImpl implements IZEngineeringInfoService {
             //lqwstatis.eq(StringUtils.isNotBlank(zEngineeringNode.getType()), ZMaterialStatistics::getNodeType, zEngineeringNode.getType());
             ZMaterialStatistics zMaterialStatistics = zMaterialStatisticsMapper.selectOne(lqwstatis);
             if (!ObjectUtils.isEmpty(zMaterialStatistics)) {
-                zMaterialStatistics.setRealitySize(BigDecimal.valueOf(zMaterialStatistics.getRealitySize()).subtract(BigDecimal.valueOf(item.getNumber())).doubleValue());
+                zMaterialStatistics.setRealitySize(BigDecimal.valueOf(zMaterialStatistics.getRealitySize()).subtract(BigDecimal.valueOf(ObjectUtils.isEmpty(item.getNumber())?0:item.getNumber())).doubleValue());
                 zMaterialStatisticsMapper.updateById(zMaterialStatistics);
             }
         });

+ 42 - 0
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZComprehensiveMapper.xml

@@ -89,6 +89,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         )
         order by zc.create_time desc
     </select>
+    <select id="queryPageListAll" resultType="com.ruoyi.zdsz.domain.vo.ZComprehensiveVo">
+        SELECT
+        zc.district,
+        dd.dict_label as is_qualified,
+        if(zh.NAME is null , '未知' ,zh.NAME) AS houseName,
+        if(zt.NAME is null , '未知' ,zt.NAME) AS unitName,
+        if(zb.NAME is null , '未知' ,zb.NAME) AS buildingName,
+        if(za.NAME is null , '未知' ,za.NAME) AS areaName,
+        zc.remark
+        FROM
+        z_comprehensive AS zc
+        LEFT JOIN z_house AS zh ON zh.id = zc.house_id
+        LEFT JOIN z_unit AS zt ON zh.unit_id = zt.id
+        LEFT JOIN z_building AS zb ON zt.building_id = zb.id
+        LEFT JOIN z_area AS za ON zb.area_id = za.id
+        left join sys_dict_data dd on dd.dict_type='sys_yes_no' and zc.is_qualified=dd.dict_value
+        WHERE
+        1 = 1
+        AND zc.del_flag = '0'
+        <if test="p.areaId != null and p.areaId != ''">
+            AND zc.area_id = #{p.areaId}
+        </if>
+        <if test="p.buildingId != null and p.buildingId != ''">
+            AND zc.building_id = #{p.buildingId}
+        </if>
+        <if test="p.personBy != null and p.personBy != ''">
+            AND zc.create_by = #{p.personBy}
+        </if>
+        <if test="p.unitId != null and p.unitId != ''">
+            AND zc.unit_id = #{p.unitId}
+        </if>
+        <if test="p.constructTime != null and p.constructTime != '' and p.constructEndTime != null and p.constructEndTime != ''">
+            AND zc.create_time BETWEEN #{p.constructTime} AND #{p.constructEndTime}
+        </if>
+        <if test="p.district != null and p.district != ''">
+            AND zc.district = #{p.district}
+        </if>
+        <if test="p.houseId != null and p.houseId != ''">
+            AND zc.house_id = #{p.houseId}
+        </if>
+        order by zc.create_time desc
+    </select>
     <select id="getIsQualifiedString" resultType="java.lang.String" parameterType="java.lang.String">
         SELECT
             CASE is_qualified WHEN 'N' THEN 0 ELSE 1 END as isQualified

+ 123 - 93
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZEngineeringCivilMapper.xml

@@ -141,7 +141,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     a.NAME AS roomName,
     a.id AS roomId,
     b.engin_type AS enginCycle,
-    IFNULL( b.completion_status, '未施工' ) AS roomStatus,
+    IFNULL( b.completion_status,
+    IFNULL((select '未安装' from z_engin_not_installed ni
+    where ni.house_id = a.id
+    <if test="enginType != null and enginType != ''">
+        and ni.engin_type=#{enginType}
+    </if>
+    LIMIT 1),'未施工')) AS roomStatus,
     b.create_time,
     CAST(CONCAT( REPLACE ( bd.NAME, '栋', '' ),REPLACE ( c.NAME, '单元', '' )) AS SIGNED) AS unitOrder
     FROM
@@ -172,11 +178,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         za.id as areaId,
         za.NAME,
         IFNULL( za.scale, 0 ) AS scale,
-        IFNULL( ze.completion_status, '未施工' ) AS roomStatus
+        IFNULL( ze.completion_status,
+        IFNULL((select '未安装' from z_engin_not_installed ni
+        where ni.house_id = zh.id
+        <if test="enginType != null and enginType != ''">
+            and ni.engin_type=#{enginType}
+        </if>
+        LIMIT 1),'未施工')) AS roomStatus
         FROM
         z_house zh
         LEFT JOIN z_area za ON za.id = zh.area_id
         LEFT JOIN z_engineering_civil ze ON zh.id = ze.house_id AND ze.del_flag = '0' AND ze.engin_cycle=#{enginCycle}
+        <if test="enginType != null and enginType != ''">
+            and ze.engin_type=#{enginType}
+        </if>
         WHERE
         zh.del_flag = 0
           AND zh.area_id in
@@ -190,11 +205,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         za.id as areaId,
         za.NAME,
         IFNULL( za.scale, 0 ) AS scale,
-        IFNULL( ze.completion_status, '未施工' ) AS roomStatus
+        IFNULL( ze.completion_status,
+        IFNULL((select '未安装' from z_engin_not_installed ni
+        where ni.house_id = zh.id
+        <if test="enginType != null and enginType != ''">
+            and ni.engin_type=#{enginType}
+        </if>
+        LIMIT 1),'未施工')) AS roomStatus
         FROM
         z_house zh
         LEFT JOIN z_area za ON za.id = zh.area_id
         LEFT JOIN z_engineering_civil ze ON zh.id = ze.house_id AND ze.del_flag = '0' AND ze.engin_cycle=#{enginCycle}
+        <if test="enginType != null and enginType != ''">
+            and ze.engin_type=#{enginType}
+        </if>
         WHERE
         zh.del_flag = 0
         ORDER BY za.id ASC
@@ -270,7 +294,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         z_engineering_info
         WHERE
             1=1
-
         <if test="createTime != null and createTime != ''">
             and update_info_time between #{createTime[0]} and #{createTime[1]}
         </if>
@@ -295,88 +318,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     </select>
     <select id="getexportList" resultType="com.ruoyi.zdsz.domain.vo.ZEngineeringCivilExportVo">
-        SELECT
-        a.id,
-        (SELECT dict_label FROM `sys_dict_data` WHERE dict_type = 'district' AND dict_value = a.district) AS district,
-        g.`name` AS area_id,
-        h.`name` AS building_id,
-        i.`name` AS unit_id,
-        j.`name` AS house_id,
-        (SELECT dict_label FROM `sys_dict_data` WHERE dict_type = 'community_source' AND dict_value = j.`source`) AS source,
-        k.dict_label AS engin_classification,
-        CASE
-        a.engin_type
-        WHEN 'new_built' THEN
-        '新建' ELSE '旧改'
-        END AS engin_type,
-        a.completion_status,
-        b.type,
-        c.construct_addre,
-        c.construct_according_drawings,
-        c.segmented_compression_qualified,
-        c.backfill_time,
-        c.construct_phone,
-        c.construct_time,
-        c.head_name,
-        c.head_phone,
-        d.visit_type,
-        d.corrosion_level AS corrosion_level,
-        n.name as self_closing_valve_type,
-        m.name as brand,
-        e.`name` AS material_quality,
-        f.`name` AS specifications,
-        d.number,
-        c.update_info_time as updateInfoTime,
-        c.create_by as createBy,
-        c.remark,
-        d.remark as remarkd
-        FROM
-            z_engineering_civil a
-        LEFT JOIN z_engineering_node b ON a.id = b.civli_id
-        LEFT JOIN z_engineering_info c ON b.id = c.eng_info_id
-        LEFT JOIN z_engineering_material d ON c.id = d.details_id
-        LEFT JOIN z_engin_material_quality e ON e.id = d.material_quality
-        LEFT JOIN z_engin_specifications f ON f.id = d.specifications
-        LEFT JOIN z_area g ON g.id = a.area_id
-        LEFT JOIN z_building h ON h.id = a.building_id
-        LEFT JOIN z_unit i ON i.id = a.unit_id
-        LEFT JOIN z_house j ON j.id = a.house_id
-        LEFT JOIN sys_dict_data k ON k.dict_type = a.engin_type
-        AND k.dict_value = a.engin_classification
-        LEFT JOIN z_engin_material_quality l ON l.id = d.corrosion_level
-        LEFT JOIN z_engin_material_quality m ON m.id = d.brand
-        LEFT JOIN z_engin_material_quality n ON n.id = d.self_closing_valve_type
-        WHERE
-         a.create_time LIKE CONCAT(REPLACE(#{createTime}, '_', '-'),'%')
-        <if test="p.district != null and p.district != ''">
-            and a.district = #{p.district}
-        </if>
-        <if test="p.areaId != null and p.areaId != ''">
-            and a.area_id = #{p.areaId}
-        </if>
-        <if test="p.buildingId != null and p.buildingId != ''">
-            and a.building_id = #{p.buildingId}
-        </if>
-        <if test="p.unitId != null and p.unitId != ''">
-            and a.unit_id = #{p.unitId}
-        </if>
-        <if test="p.enginType != null and p.enginType != ''">
-            and a.engin_type = #{p.enginType}
-        </if>
-        <if test="p.enginClassification != null and p.enginClassification != ''">
-            and a.engin_classification = #{p.enginClassification}
-        </if>
-        <if test="p.enginCycle != null and p.enginCycle != ''">
-            and a.engin_cycle = 0
-        </if>
-        <if test="p.beginTime != null and p.beginTime != ''">
-            and  c.update_info_time between #{beginTime[0]} and #{beginTime[1]}
-        </if>
-        <if test="p.createBy != null and p.createBy != ''">
-            and c.create_by like CONCAT(#{p.createBy},'%')
-        </if>
-        <foreach collection="tableNames" item="name">
-            union
+        select * from (
             SELECT
             a.id,
             (SELECT dict_label FROM `sys_dict_data` WHERE dict_type = 'district' AND dict_value = a.district) AS district,
@@ -413,10 +355,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             c.remark,
             d.remark as remarkd
             FROM
-            z_engineering_civil a
-            LEFT JOIN z_engineering_node_${name} b ON a.id = b.civli_id
-            LEFT JOIN z_engineering_info_${name} c ON b.id = c.eng_info_id
-            LEFT JOIN z_engineering_material_${name} d ON c.id = d.details_id
+                z_engineering_civil a
+            LEFT JOIN z_engineering_node b ON a.id = b.civli_id
+            LEFT JOIN z_engineering_info c ON b.id = c.eng_info_id
+            LEFT JOIN z_engineering_material d ON c.id = d.details_id
             LEFT JOIN z_engin_material_quality e ON e.id = d.material_quality
             LEFT JOIN z_engin_specifications f ON f.id = d.specifications
             LEFT JOIN z_area g ON g.id = a.area_id
@@ -425,11 +367,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             LEFT JOIN z_house j ON j.id = a.house_id
             LEFT JOIN sys_dict_data k ON k.dict_type = a.engin_type
             AND k.dict_value = a.engin_classification
-            LEFT JOIN z_engin_specifications l ON l.id = d.corrosion_level
+            LEFT JOIN z_engin_material_quality l ON l.id = d.corrosion_level
             LEFT JOIN z_engin_material_quality m ON m.id = d.brand
             LEFT JOIN z_engin_material_quality n ON n.id = d.self_closing_valve_type
             WHERE
-             a.create_time LIKE CONCAT(REPLACE(#{name}, '_', '-'),'%')
+             a.create_time LIKE CONCAT(REPLACE(#{createTime}, '_', '-'),'%')
             <if test="p.district != null and p.district != ''">
                 and a.district = #{p.district}
             </if>
@@ -457,7 +399,95 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="p.createBy != null and p.createBy != ''">
                 and c.create_by like CONCAT(#{p.createBy},'%')
             </if>
-        </foreach>
+            <foreach collection="tableNames" item="name">
+                union
+                SELECT
+                a.id,
+                (SELECT dict_label FROM `sys_dict_data` WHERE dict_type = 'district' AND dict_value = a.district) AS district,
+                g.`name` AS area_id,
+                h.`name` AS building_id,
+                i.`name` AS unit_id,
+                j.`name` AS house_id,
+                (SELECT dict_label FROM `sys_dict_data` WHERE dict_type = 'community_source' AND dict_value = j.`source`) AS source,
+                k.dict_label AS engin_classification,
+                CASE
+                a.engin_type
+                WHEN 'new_built' THEN
+                '新建' ELSE '旧改'
+                END AS engin_type,
+                a.completion_status,
+                b.type,
+                c.construct_addre,
+                c.construct_according_drawings,
+                c.segmented_compression_qualified,
+                c.backfill_time,
+                c.construct_phone,
+                c.construct_time,
+                c.head_name,
+                c.head_phone,
+                d.visit_type,
+                d.corrosion_level AS corrosion_level,
+                n.name as self_closing_valve_type,
+                m.name as brand,
+                e.`name` AS material_quality,
+                f.`name` AS specifications,
+                d.number,
+                c.update_info_time as updateInfoTime,
+                c.create_by as createBy,
+                c.remark,
+                d.remark as remarkd
+                FROM
+                z_engineering_civil a
+                LEFT JOIN z_engineering_node_${name} b ON a.id = b.civli_id
+                LEFT JOIN z_engineering_info_${name} c ON b.id = c.eng_info_id
+                LEFT JOIN z_engineering_material_${name} d ON c.id = d.details_id
+                LEFT JOIN z_engin_material_quality e ON e.id = d.material_quality
+                LEFT JOIN z_engin_specifications f ON f.id = d.specifications
+                LEFT JOIN z_area g ON g.id = a.area_id
+                LEFT JOIN z_building h ON h.id = a.building_id
+                LEFT JOIN z_unit i ON i.id = a.unit_id
+                LEFT JOIN z_house j ON j.id = a.house_id
+                LEFT JOIN sys_dict_data k ON k.dict_type = a.engin_type
+                AND k.dict_value = a.engin_classification
+                LEFT JOIN z_engin_specifications l ON l.id = d.corrosion_level
+                LEFT JOIN z_engin_material_quality m ON m.id = d.brand
+                LEFT JOIN z_engin_material_quality n ON n.id = d.self_closing_valve_type
+                WHERE
+                 a.create_time LIKE CONCAT(REPLACE(#{name}, '_', '-'),'%')
+                <if test="p.district != null and p.district != ''">
+                    and a.district = #{p.district}
+                </if>
+                <if test="p.areaId != null and p.areaId != ''">
+                    and a.area_id = #{p.areaId}
+                </if>
+                <if test="p.buildingId != null and p.buildingId != ''">
+                    and a.building_id = #{p.buildingId}
+                </if>
+                <if test="p.unitId != null and p.unitId != ''">
+                    and a.unit_id = #{p.unitId}
+                </if>
+                <if test="p.enginType != null and p.enginType != ''">
+                    and a.engin_type = #{p.enginType}
+                </if>
+                <if test="p.enginClassification != null and p.enginClassification != ''">
+                    and a.engin_classification = #{p.enginClassification}
+                </if>
+                <if test="p.enginCycle != null and p.enginCycle != ''">
+                    and a.engin_cycle = 0
+                </if>
+                <if test="p.beginTime != null and p.beginTime != ''">
+                    and  c.update_info_time between #{beginTime[0]} and #{beginTime[1]}
+                </if>
+                <if test="p.createBy != null and p.createBy != ''">
+                    and c.create_by like CONCAT(#{p.createBy},'%')
+                </if>
+            </foreach>
+        ) z
+        ORDER BY
+        z.area_id,
+        CONVERT ( REPLACE ( z.building_id, '栋', '' ), UNSIGNED ),
+        CONVERT ( REPLACE ( z.unit_id, '单元', '' ), UNSIGNED ),
+        CONVERT ( REPLACE ( z.house_id, '号', '' ), UNSIGNED ) ASC
     </select>
     <select id="getTypeNumber" resultType="Long">
         SELECT