Переглянути джерело

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

JX.Li 11 місяців тому
батько
коміт
3ab7a7f970

+ 51 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zdsz/ZEngineeringWasteMaterialController.java

@@ -0,0 +1,51 @@
+package com.ruoyi.web.controller.zdsz;
+
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.zdsz.domain.vo.ZEngineeringWasteMaterialVo;
+import com.ruoyi.zdsz.service.IZEngineeringWasteMaterialService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * 四大工程 耗材统计
+ *
+ * @author ruoyi
+ * @date 2024-01-02
+ */
+@Validated
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/zdsz/engineeringWasteMaterial")
+public class ZEngineeringWasteMaterialController extends BaseController {
+
+    private final IZEngineeringWasteMaterialService izEngineeringWasteMaterialService;
+
+    /**
+     * 四大工程 统计展示
+     */
+    @GetMapping("/{id}/{type}")
+    public R<ZEngineeringWasteMaterialVo> querys(@NotNull(message = "主键不能为空") @PathVariable String id, @NotNull(message = "类型不能为空") @PathVariable String type) {
+        switch (type){
+            case "engineeringIndustry":{ // 工业工程
+                return R.ok(izEngineeringWasteMaterialService.queryEngineeringIndustry(id));
+            }
+            case "engineeringMunicipal":{ // 市政工程
+                return R.ok(izEngineeringWasteMaterialService.queryEngineeringMunicipal(id));
+            }
+            case "engineeringPipeJacking":{ // 顶管工程
+                return R.ok(izEngineeringWasteMaterialService.queryEngineeringPipeJacking(id));
+            }
+            case "touchOperationEngineering":{ // 碰口作业
+                return R.ok(izEngineeringWasteMaterialService.queryTouchOperationEngineering(id));
+            }
+            default:{
+                return R.fail("类型或主键无效");
+            }
+        }
+    }
+
+}

+ 34 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/domain/vo/ZEngineeringWasteMaterialVo.java

@@ -0,0 +1,34 @@
+package com.ruoyi.zdsz.domain.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 四大工程 耗材统计 App
+ *
+ * @author ruoyi
+ * @date 2024-01-02
+ */
+@Data
+public class ZEngineeringWasteMaterialVo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+
+    /**
+     * 用料占比
+     * PE材料
+     * 钢材
+     */
+    private Map materialPercentagePE;
+    private Map materialPercentageIron;
+
+    /**
+     * 节点审核
+     */
+    private List nodeCheck;
+
+}

+ 25 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/mapper/ZEngineeringWasteMaterialMapper.java

@@ -0,0 +1,25 @@
+package com.ruoyi.zdsz.mapper;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.core.mapper.BaseMapperPlus;
+import com.ruoyi.zdsz.domain.ZEngineeringIndustry;
+import com.ruoyi.zdsz.domain.vo.ZEngineeringIndustryVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 四大工程 耗材统计
+ *
+ * @author ruoyi
+ * @date 2024-01-02
+ */
+public interface ZEngineeringWasteMaterialMapper extends BaseMapperPlus<ZEngineeringWasteMaterialMapper, ZEngineeringIndustry, ZEngineeringIndustryVo> {
+
+    Page<Map<String,Object>> getByUserList(@Param("names") List DateList, @Param("by")String name, @Param("type")String type,@Param("szAndGy")String szAndGy,@Param("pa") Page<?> page,@Param("enginName")String enginName,@Param("enginType")String enginType,@Param("enginClassification")String enginClassification);
+    Page<Map<String,Object>> getByUserList1(@Param("names") List DateList, @Param("by")String name, @Param("type")String type,@Param("szAndGy")String szAndGy,@Param("pa") Page<?> page,@Param("enginName")String enginName,@Param("enginType")String enginType);
+    List<Map<String,String>> getReviewStatusByNodeId(@Param("id") String id);
+    List<Map<String,String>> getDicts(@Param("type") String type);
+
+}

+ 17 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/IZEngineeringWasteMaterialService.java

@@ -0,0 +1,17 @@
+package com.ruoyi.zdsz.service;
+
+import com.ruoyi.zdsz.domain.vo.ZEngineeringWasteMaterialVo;
+
+/**
+ * 四大工程 耗材统计
+ *
+ * @author ruoyi
+ * @date 2024-01-02
+ */
+public interface IZEngineeringWasteMaterialService {
+
+    ZEngineeringWasteMaterialVo queryEngineeringIndustry(String id);
+    ZEngineeringWasteMaterialVo queryEngineeringMunicipal(String id);
+    ZEngineeringWasteMaterialVo queryEngineeringPipeJacking(String id);
+    ZEngineeringWasteMaterialVo queryTouchOperationEngineering(String id);
+}

+ 8 - 38
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringGYServiceImpl.java

@@ -77,6 +77,9 @@ public class ZEngineeringGYServiceImpl implements IZEngineeringGYService {
         zEngineeringNodeBo.setCreateTime(zEngineeringIndustryVo.getCreateTime());
         List<ZEngineeringNodeBo> zEngineeringNodeBos = izEngineeringNodeService.queryListDetails(zEngineeringNodeBo);
         zEngineeringIndustryVo.setZEngineeringNodeBoList(zEngineeringNodeBos);
+        ArrayList<ZEngineeringGYVo> list = new ArrayList<>();
+        list.add(zEngineeringIndustryVo);
+        zEngineeringIndustryVo.setNodeReViewStateList(nodeService.ReViewGYList(list)!=null?nodeService.ReViewGYList(list).get(zEngineeringIndustryVo.getId()):Collections.EMPTY_LIST);
         return zEngineeringIndustryVo;
     }
 
@@ -204,47 +207,14 @@ public class ZEngineeringGYServiceImpl implements IZEngineeringGYService {
         boolean flag = baseMapper.updateById(update) > 0;
         ZEngineeringGYVo voById = baseMapper.selectVoById(bo.getId());
         bo.setCreateTime(voById.getCreateTime());
-        if (flag) {
-            List<ZEngiineeringPhoto> list = new ArrayList<>();
-            // 查询数据库中已存在的文件列表
-            ZEngiineeringPhotoBo zEngiineeringPhotoBo = new ZEngiineeringPhotoBo();
-            zEngiineeringPhotoBo.setParentId(update.getId());
-            zEngiineeringPhotoBo.setCreateTime(bo.getCreateTime());
-            List<String> existingPhotos = photoService.queryList(zEngiineeringPhotoBo).stream().map(ZEngiineeringPhotoVo::getPicUrl).collect(Collectors.toList());
-            // 插入前端传来的新文件
-            if (!ObjectUtils.isEmpty(bo.getFiles())) {
-                for (ZFileBo pic : bo.getFiles()) {
-                    if (!existingPhotos.contains(pic.getUrl())) {
-                        ZEngiineeringPhoto newPhoto = new ZEngiineeringPhoto();
-                        newPhoto.setParentId(bo.getId());
-                        newPhoto.setPicUrl(pic.getUrl());
-                        newPhoto.setFileName(pic.getName());
-                        newPhoto.setCreateBy(String.valueOf(LoginHelper.getUserId()));
-                        newPhoto.setCreateTime(bo.getCreateTime());
-                        newPhoto.setUpdateTime(new Date());
-                        list.add(newPhoto);
-                    }
-                }
-                // 删除数据库中多余的文件
-                List<String> photosToDelete = existingPhotos.stream().filter(pic -> !bo.getFiles().stream().map(ZFileBo::getUrl).collect(Collectors.toList()).contains(pic)).collect(Collectors.toList());
-                if (!photosToDelete.isEmpty()) {
-                    photosToDelete.forEach(item -> {
-                        ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
-                        zEngiineeringPhoto.setPicUrl(item);
-                        zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
-                        photoService.deleteWithValid(zEngiineeringPhoto);
-                    });
-                }
-                // 批量插入新图片
-                if (!list.isEmpty()) {
-                    photoService.insertBatch(list);
-                }
-            }
-        }
         //节点表与info表
         if (!ObjectUtils.isEmpty(bo.getzEngineeringNodeBo())) {
             bo.getzEngineeringNodeBo().setCreateTime(voById.getCreateTime());
-            izEngineeringNodeService.update(bo.getzEngineeringNodeBo());
+            if (!ObjectUtils.isEmpty(bo.getzEngineeringNodeBo().getzEngineeringInfoBoList())) {
+                izEngineeringNodeService.updateMuch(bo.getzEngineeringNodeBo());
+            } else {
+                izEngineeringNodeService.update(bo.getzEngineeringNodeBo());
+            }
         }
         return flag;
     }

+ 9 - 38
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringIndustryServiceImpl.java

@@ -18,6 +18,7 @@ import com.ruoyi.zdsz.domain.ZEngiineeringPhoto;
 import com.ruoyi.zdsz.domain.ZEngineeringIndustry;
 import com.ruoyi.zdsz.domain.bo.*;
 import com.ruoyi.zdsz.domain.vo.ZEngiineeringPhotoVo;
+import com.ruoyi.zdsz.domain.vo.ZEngineeringGYVo;
 import com.ruoyi.zdsz.domain.vo.ZEngineeringIndustryTypeVo;
 import com.ruoyi.zdsz.domain.vo.ZEngineeringIndustryVo;
 import com.ruoyi.zdsz.mapper.ZEngineeringCivilMapper;
@@ -386,6 +387,9 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
         zEngineeringNodeBo.setCreateTime(zEngineeringIndustryVo.getCreateTime());
         List<ZEngineeringNodeBo> zEngineeringNodeBos = izEngineeringNodeService.queryListDetails(zEngineeringNodeBo);
         zEngineeringIndustryVo.setZEngineeringNodeBoList(zEngineeringNodeBos);
+        ArrayList<ZEngineeringIndustryVo> list = new ArrayList<>();
+        list.add(zEngineeringIndustryVo);
+        zEngineeringIndustryVo.setNodeReViewStateList(nodeService.ReViewSZList(list)!=null?nodeService.ReViewSZList(list).get(zEngineeringIndustryVo.getId()):Collections.EMPTY_LIST);
         return zEngineeringIndustryVo;
     }
 
@@ -507,47 +511,14 @@ public class ZEngineeringIndustryServiceImpl implements IZEngineeringIndustrySer
         boolean flag = baseMapper.updateById(update) > 0;
         ZEngineeringIndustryVo voById = baseMapper.selectVoById(bo.getId());
         bo.setCreateTime(voById.getCreateTime());
-        if (flag) {
-            List<ZEngiineeringPhoto> list = new ArrayList<>();
-            // 查询数据库中已存在的文件列表
-            ZEngiineeringPhotoBo zEngiineeringPhotoBo = new ZEngiineeringPhotoBo();
-            zEngiineeringPhotoBo.setParentId(update.getId());
-            zEngiineeringPhotoBo.setCreateTime(bo.getCreateTime());
-            List<String> existingPhotos = photoService.queryList(zEngiineeringPhotoBo).stream().map(ZEngiineeringPhotoVo::getPicUrl).collect(Collectors.toList());
-            // 插入前端传来的新文件
-            if (!ObjectUtils.isEmpty(bo.getFiles())) {
-                for (ZFileBo pic : bo.getFiles()) {
-                    if (!existingPhotos.contains(pic.getUrl())) {
-                        ZEngiineeringPhoto newPhoto = new ZEngiineeringPhoto();
-                        newPhoto.setParentId(bo.getId());
-                        newPhoto.setPicUrl(pic.getUrl());
-                        newPhoto.setFileName(pic.getName());
-                        newPhoto.setCreateBy(String.valueOf(LoginHelper.getUserId()));
-                        newPhoto.setCreateTime(bo.getCreateTime());
-                        newPhoto.setUpdateTime(new Date());
-                        list.add(newPhoto);
-                    }
-                }
-                // 删除数据库中多余的文件
-                List<String> photosToDelete = existingPhotos.stream().filter(pic -> !bo.getFiles().stream().map(ZFileBo::getUrl).collect(Collectors.toList()).contains(pic)).collect(Collectors.toList());
-                if (!photosToDelete.isEmpty()) {
-                    photosToDelete.forEach(item -> {
-                        ZEngiineeringPhoto zEngiineeringPhoto = new ZEngiineeringPhoto();
-                        zEngiineeringPhoto.setPicUrl(item);
-                        zEngiineeringPhoto.setCreateTime(bo.getCreateTime());
-                        photoService.deleteWithValid(zEngiineeringPhoto);
-                    });
-                }
-                // 批量插入新图片
-                if (!list.isEmpty()) {
-                    photoService.insertBatch(list);
-                }
-            }
-        }
         //节点表与info表
         if (!ObjectUtils.isEmpty(bo.getzEngineeringNodeBo())) {
             bo.getzEngineeringNodeBo().setCreateTime(voById.getCreateTime());
-            izEngineeringNodeService.update(bo.getzEngineeringNodeBo());
+            if (!ObjectUtils.isEmpty(bo.getzEngineeringNodeBo().getzEngineeringInfoBoList())) {
+                izEngineeringNodeService.updateMuch(bo.getzEngineeringNodeBo());
+            } else {
+                izEngineeringNodeService.update(bo.getzEngineeringNodeBo());
+            }
         }
         return flag;
     }

+ 510 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZEngineeringWasteMaterialServiceImpl.java

@@ -0,0 +1,510 @@
+package com.ruoyi.zdsz.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.common.core.domain.entity.SysDictData;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.redis.RedisUtils;
+import com.ruoyi.common.utils.spring.SpringUtils;
+import com.ruoyi.zdsz.domain.ZEngineeringMaterial;
+import com.ruoyi.zdsz.domain.bo.ZEngineeringInfoBo;
+import com.ruoyi.zdsz.domain.bo.ZEngineeringNodeBo;
+import com.ruoyi.zdsz.domain.vo.*;
+import com.ruoyi.zdsz.mapper.*;
+import com.ruoyi.zdsz.service.IZEngineeringNodeService;
+import com.ruoyi.zdsz.service.IZEngineeringWasteMaterialService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.util.ObjectUtils;
+import org.springframework.web.context.request.RequestAttributes;
+import org.springframework.web.context.request.RequestContextHolder;
+
+import javax.annotation.Resource;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.*;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
+
+/**
+ * 四大工程 耗材统计
+ *
+ * @author ruoyi
+ * @date 2024-01-02
+ */
+@RequiredArgsConstructor
+@Service
+public class ZEngineeringWasteMaterialServiceImpl implements IZEngineeringWasteMaterialService {
+
+    @Resource
+    private final ZEngineeringGYMapper gyMapper;
+    @Resource
+    private final ZEngineeringIndustryMapper baseMapper;
+    @Resource
+    private final ZEngineeringPipeJackingMapper pipeJackingMapper;
+    @Resource
+    private final ZTouchOperationEngineeringMapper touchOperationMapper;
+
+    @Resource
+    private IZEngineeringNodeService izEngineeringNodeService;
+
+    @Resource
+    private ZEngineeringMaterialMapper zEngineeringMaterialMapper;
+    @Resource
+    private  ZEnginMaterialQualityMapper zEnginMaterialQualityMapper;
+
+    /**
+     * 工业工程
+     * 工程分类 engin_classification
+     * 节点类型 gy_tyg 调压柜
+     * engineeringIndustry
+     */
+
+    public ZEngineeringWasteMaterialVo queryEngineeringIndustry2(String id) {
+        ZEngineeringGYVo zEngineeringGYVo = gyMapper.selectVoById(id);
+        List list = new ArrayList();
+        list.add(zEngineeringGYVo);
+        List<Map<String, Object>> aaa = ReViewGYList(list);
+        return new ZEngineeringWasteMaterialVo();
+    }
+    @Override
+    public ZEngineeringWasteMaterialVo queryEngineeringIndustry(String id) {
+        ZEngineeringGYVo zEngineeringGYVo = gyMapper.selectVoById(id);
+        ZEngineeringNodeBo zEngineeringNodeBo = new ZEngineeringNodeBo();
+        zEngineeringNodeBo.setCivliId(id);
+        zEngineeringNodeBo.setCreateTime(zEngineeringGYVo.getCreateTime());
+        List<ZEngineeringNodeBo> zEngineeringNodeBos = izEngineeringNodeService.queryListDetails(zEngineeringNodeBo);
+//        zEngineeringIndustryVo.setZEngineeringNodeBoList(zEngineeringNodeBos);
+//        List<SysDictData> dictList = sysDictMap.get("engin_classification");
+//        for (SysDictData dict : dictList) {
+//            if(dict.getDictValue().equals(zEngineeringIndustryVo.getEnginClassification())){
+//
+//            }
+//        }
+        String enginClassification = zEngineeringGYVo.getEnginClassification();
+        String dictType;
+        switch (enginClassification){
+            case "调压柜":{
+                dictType = "gy_tyg";
+                break;
+            }
+            case "室内管线":{
+                dictType = "gy_inner";
+                break;
+            }
+            case "室外管线":{
+                dictType = "gy_out";
+                break;
+            }
+            default:{
+                dictType = null;
+            }
+        }
+        Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
+        List<SysDictData> dictDataList = sysDictMap.get(dictType);
+        ZEngineeringWasteMaterialVo zEngineeringWasteMaterialVo = new ZEngineeringWasteMaterialVo();
+        List nodeCheck = new ArrayList<>();
+        for (SysDictData dictData : dictDataList) {
+            boolean flag = false;
+            for (ZEngineeringNodeBo nodeBo : zEngineeringNodeBos) {
+                if(nodeBo.getType().equals(dictData.getDictValue())){
+                    flag = true;
+                    break;
+                }
+            }
+            Map map = new HashMap();
+            map.put("name", dictData.getDictLabel());
+            if(flag){
+                for (ZEngineeringNodeBo nodeBo : zEngineeringNodeBos) {
+                    if(nodeBo.getType().equals(dictData.getDictValue())){
+                        if(nodeBo.getzEngineeringInfoBoList().size() == 0){
+                            map.put("value", "未上传"); // 上传过 创建过节点 后来删了工程信息 但是节点数据依然在
+                        }else if (nodeBo.getzEngineeringInfoBoList().stream().anyMatch(ele -> "0".equals(ele.getState()))) {
+                            map.put("value", "未通过");
+                        } else if (nodeBo.getzEngineeringInfoBoList().stream().allMatch(ele -> "1".equals(ele.getState()))) {
+                            map.put("value", "通过");
+                        } else {
+                            map.put("value", "未审核");
+                        }
+                        break;
+                    }
+                }
+            }else {
+                map.put("value", "未上传"); // 未创建过节点
+            }
+            nodeCheck.add(map);
+        }
+        zEngineeringWasteMaterialVo.setNodeCheck(nodeCheck);
+        AtomicReference<BigDecimal> pesj = new AtomicReference<>(new BigDecimal(0));
+        AtomicReference<BigDecimal> gsj = new AtomicReference<>(new BigDecimal(0));
+        for (int i = 0; i < zEngineeringNodeBos.size(); i++) {
+            ZEngineeringNodeBo nodeBo = zEngineeringNodeBos.get(i);
+            for (ZEngineeringInfoBo info: nodeBo.getzEngineeringInfoBoList()) {
+                System.out.println(info.getzEngineeringMaterialBo());
+                LambdaQueryWrapper<ZEngineeringMaterial> lqw4 = Wrappers.lambdaQuery();
+                lqw4.eq(StringUtils.isNotBlank(info.getId()), ZEngineeringMaterial::getDetailsId, info.getId());
+                List<ZEngineeringMaterial> material= zEngineeringMaterialMapper.selectList(lqw4);
+                material.stream().forEach(item4->{
+                    String type = zEnginMaterialQualityMapper.selectVoById(item4.getMaterialQuality()).getMaterialType();
+                    if("0".equals(type)){
+                        pesj.updateAndGet(v ->v.add(new BigDecimal(Double.toString(item4.getNumber()))) );
+
+//                        pesj = pesj.get().add(new BigDecimal(Double.toString(item4.getNumber())));
+                    }else if("1".equals(type)){
+//                        gsj.updateAndGet(v -> new BigDecimal(Double.toString(item4.getNumber())));
+                        gsj.updateAndGet(v ->v.add(new BigDecimal(Double.toString(item4.getNumber()))) );
+
+//                        gsj.updateAndGet(v -> v + new BigDecimal(Double.toString(item4.getNumber())).doubleValue());
+                    }
+                });
+            }
+        }
+        Map pe = new HashMap(); // PE材料
+        pe.put("actuality", getRoundDouble(pesj.get(), 2)); // 实际
+        pe.put("anticipation", zEngineeringGYVo.getPePreset()); // 预计  divide zEngineeringGYVo.getGcPreset()
+        pe.put("percentage", getRoundDouble((pesj.get().multiply(new BigDecimal(100))).divide(BigDecimal.valueOf(zEngineeringGYVo.getPePreset())),2) + "%"); // 占比
+        Map iron = new HashMap(); // 钢材
+        iron.put("actuality", getRoundDouble(gsj.get(), 2)); // 实际
+        iron.put("anticipation", zEngineeringGYVo.getGcPreset()); // 预计
+        iron.put("percentage", getRoundDouble((gsj.get().multiply(new BigDecimal(100))).divide(BigDecimal.valueOf(zEngineeringGYVo.getGcPreset())),2) + "%"); // 占比
+        zEngineeringWasteMaterialVo.setMaterialPercentagePE(pe);
+        zEngineeringWasteMaterialVo.setMaterialPercentageIron(iron);
+//        zEngineeringWasteMaterialVo.setMaterialPercentagePE();
+
+
+//        List<ZEngineeringInfo> info= zEngineeringInfoMapper.selectList(lqw3);
+//        info.stream().forEach(item3->{
+//            LambdaQueryWrapper<ZEngineeringMaterial> lqw4 = Wrappers.lambdaQuery();
+//            lqw4.eq(StringUtils.isNotBlank(item3.getId()), ZEngineeringMaterial::getDetailsId, item3.getId());
+//            List<ZEngineeringMaterial> material= zEngineeringMaterialMapper.selectList(lqw4);
+//            material.stream().forEach(item4->{
+//                String type = zEnginMaterialQualityMapper.selectVoById(item4.getMaterialQuality()).getMaterialType();
+//                if("0".equals(type)){
+//                    item.setPesj(new BigDecimal(Double.toString(item.getPesj())).add(new BigDecimal(Double.toString(item4.getNumber()))).doubleValue());
+//                }else if("1".equals(type)){
+//                    item.setGsj(new BigDecimal(Double.toString(item.getGsj())).add(new BigDecimal(Double.toString(item4.getNumber()))).doubleValue());
+//                }
+//            });
+//        });
+        return zEngineeringWasteMaterialVo;
+    }
+
+    private double getRoundDouble(double d, int i){
+        return BigDecimal.valueOf(d).setScale(i, RoundingMode.HALF_UP).doubleValue();
+    }
+    private double getRoundDouble(BigDecimal d, int i){
+        return d.setScale(i, RoundingMode.HALF_UP).doubleValue();
+    }
+
+    private List<Map<String, Object>> ReViewGYList(List<ZEngineeringGYVo> list) {
+        Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
+        IZEngineeringNodeService nodeService = SpringUtils.getBean(IZEngineeringNodeService.class);
+        RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
+
+        List<CompletableFuture<LinkedHashMap<String, Object>>> futures = list.stream()
+            .map(one -> CompletableFuture.supplyAsync(() -> {
+                RequestContextHolder.setRequestAttributes(attributes);
+
+                LinkedHashMap<String, Object> objectLinkedHashMap = new LinkedHashMap<>();
+                objectLinkedHashMap.put("id", one.getId());
+                List<SysDictData> dictData = new ArrayList<>();
+                if (one.getEnginClassification().equals("室内管线")) {
+                    dictData = sysDictMap.get("gy_inner");
+                } else if (one.getEnginClassification().equals("室外管线")) {
+                    dictData = sysDictMap.get("gy_out");
+                } else if (one.getEnginClassification().equals("调压柜")) {
+                    dictData = sysDictMap.get("gy_tyg");
+                }
+                List<LinkedHashMap<String, Object>> status = new ArrayList<>();
+                objectLinkedHashMap.put("status", status);
+                for (SysDictData dict : dictData) {
+                    ZEngineeringNodeBo bo = new ZEngineeringNodeBo();
+                    bo.setCreateTime(one.getCreateTime());
+                    bo.setCivliId(one.getId());
+                    bo.setType(dict.getDictLabel());
+                    ZEngineeringNodeBo nodeBo = nodeService.query(bo);
+                    LinkedHashMap<String, Object> linkedHashMap = new LinkedHashMap<>();
+                    linkedHashMap.put("type", bo.getType());
+                    if (!ObjectUtils.isEmpty(nodeBo) && !ObjectUtils.isEmpty(nodeBo.getzEngineeringInfoBoList())) {
+                        if (nodeBo.getzEngineeringInfoBoList().stream().anyMatch(ele -> "0".equals(ele.getState()))) {
+                            linkedHashMap.put("status", "0");
+                        } else if (nodeBo.getzEngineeringInfoBoList().stream().allMatch(ele -> "1".equals(ele.getState()))) {
+                            linkedHashMap.put("status", "1");
+                        } else {
+                            linkedHashMap.put("status", "2");
+                        }
+                    } else {
+                        linkedHashMap.put("status", "3");
+                    }
+                    status.add(linkedHashMap);
+                }
+                return objectLinkedHashMap;
+            }))
+            .collect(Collectors.toList());
+
+        CompletableFuture<Void> allOf = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));
+
+        try {
+            allOf.get(); // 等待所有 CompletableFuture 完成
+        } catch (InterruptedException | ExecutionException e) {
+            e.printStackTrace();
+        }
+
+        return futures.stream()
+            .map(CompletableFuture::join) // 获取每个 CompletableFuture 的结果
+            .collect(Collectors.toList());
+    }
+
+
+    /**
+     * 市政工程
+     * municipal_node_types
+     * engineeringMunicipal
+     */
+    @Override
+    public ZEngineeringWasteMaterialVo queryEngineeringMunicipal(String id) {
+        ZEngineeringIndustryVo zEngineeringIndustryVo = baseMapper.selectVoById(id);
+        ZEngineeringNodeBo zEngineeringNodeBo = new ZEngineeringNodeBo();
+        zEngineeringNodeBo.setCivliId(id);
+        zEngineeringNodeBo.setCreateTime(zEngineeringIndustryVo.getCreateTime());
+        List<ZEngineeringNodeBo> zEngineeringNodeBos = izEngineeringNodeService.queryListDetails(zEngineeringNodeBo);
+//        zEngineeringIndustryVo.setZEngineeringNodeBoList(zEngineeringNodeBos);
+        Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
+        List<SysDictData> dictDataList = sysDictMap.get("municipal_node_types");
+        ZEngineeringWasteMaterialVo zEngineeringWasteMaterialVo = new ZEngineeringWasteMaterialVo();
+        List nodeCheck = new ArrayList<>();
+        for (SysDictData dictData : dictDataList) {
+            boolean flag = false;
+            for (ZEngineeringNodeBo nodeBo : zEngineeringNodeBos) {
+                if(nodeBo.getType().equals(dictData.getDictValue())){
+                    flag = true;
+                    break;
+                }
+            }
+            Map map = new HashMap();
+            map.put("name", dictData.getDictLabel());
+            if(flag){
+                for (ZEngineeringNodeBo nodeBo : zEngineeringNodeBos) {
+                    if(nodeBo.getType().equals(dictData.getDictValue())){
+                        if(nodeBo.getzEngineeringInfoBoList().size() == 0){
+                            map.put("value", "未上传"); // 上传过 创建过节点 后来删了工程信息 但是节点数据依然在
+                        }else if (nodeBo.getzEngineeringInfoBoList().stream().anyMatch(ele -> "0".equals(ele.getState()))) {
+                            map.put("value", "未通过");
+                        } else if (nodeBo.getzEngineeringInfoBoList().stream().allMatch(ele -> "1".equals(ele.getState()))) {
+                            map.put("value", "通过");
+                        } else {
+                            map.put("value", "未审核");
+                        }
+                        break;
+                    }
+                }
+            }else {
+                map.put("value", "未上传");
+            }
+            nodeCheck.add(map);
+        }
+        zEngineeringWasteMaterialVo.setNodeCheck(nodeCheck);
+//        for (int i = 0; i < zEngineeringNodeBos.size(); i++) {
+//            ZEngineeringNodeBo nodeBo = zEngineeringNodeBos.get(i);
+//        }
+//        zEngineeringWasteMaterialVo.setMaterialPercentagePE();
+        AtomicReference<BigDecimal> pesj = new AtomicReference<>(new BigDecimal(0));
+        AtomicReference<BigDecimal> gsj = new AtomicReference<>(new BigDecimal(0));
+        for (int i = 0; i < zEngineeringNodeBos.size(); i++) {
+            ZEngineeringNodeBo nodeBo = zEngineeringNodeBos.get(i);
+            for (ZEngineeringInfoBo info: nodeBo.getzEngineeringInfoBoList()) {
+                System.out.println(info.getzEngineeringMaterialBo());
+                LambdaQueryWrapper<ZEngineeringMaterial> lqw4 = Wrappers.lambdaQuery();
+                lqw4.eq(StringUtils.isNotBlank(info.getId()), ZEngineeringMaterial::getDetailsId, info.getId());
+                List<ZEngineeringMaterial> material= zEngineeringMaterialMapper.selectList(lqw4);
+                material.stream().forEach(item4->{
+                    String type = zEnginMaterialQualityMapper.selectVoById(item4.getMaterialQuality()).getMaterialType();
+                    if("0".equals(type)){
+                        pesj.updateAndGet(v ->v.add(new BigDecimal(Double.toString(item4.getNumber()))));
+                    }else if("1".equals(type)){
+                        gsj.updateAndGet(v ->v.add(new BigDecimal(Double.toString(item4.getNumber()))));
+                    }
+                });
+            }
+        }
+        Map pe = new HashMap(); // PE材料
+        pe.put("actuality", getRoundDouble(pesj.get(), 2)); // 实际
+        pe.put("anticipation", zEngineeringIndustryVo.getPePreset()); // 预计
+        pe.put("percentage", getRoundDouble((pesj.get().multiply(new BigDecimal(100))).divide(BigDecimal.valueOf(zEngineeringIndustryVo.getPePreset())),2) + "%"); // 占比
+        Map iron = new HashMap(); // 钢材
+        iron.put("actuality", getRoundDouble(gsj.get(), 2)); // 实际
+        iron.put("anticipation", zEngineeringIndustryVo.getGcPreset()); // 预计
+        iron.put("percentage", getRoundDouble((gsj.get().multiply(new BigDecimal(100))).divide(BigDecimal.valueOf(zEngineeringIndustryVo.getGcPreset())),2) + "%"); // 占比
+        zEngineeringWasteMaterialVo.setMaterialPercentagePE(pe);
+        zEngineeringWasteMaterialVo.setMaterialPercentageIron(iron);
+        return zEngineeringWasteMaterialVo;
+    }
+
+    /**
+     * 顶管工程
+     * pipe_jack
+     * engineeringPipeJacking
+     */
+    @Override
+    public ZEngineeringWasteMaterialVo queryEngineeringPipeJacking(String id) {
+        ZEngineeringPipeJackingVo zEngineeringPipeJackingVo = pipeJackingMapper.selectVoById(id);
+        ZEngineeringNodeBo zEngineeringNodeBo = new ZEngineeringNodeBo();
+        zEngineeringNodeBo.setCivliId(id);
+        zEngineeringNodeBo.setCreateTime(zEngineeringPipeJackingVo.getCreateTime());
+        List<ZEngineeringNodeBo> zEngineeringNodeBos = izEngineeringNodeService.queryListDetails(zEngineeringNodeBo);
+//        zEngineeringIndustryVo.setZEngineeringNodeBoList(zEngineeringNodeBos);
+        Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
+        List<SysDictData> dictDataList = sysDictMap.get("pipe_jack");
+        ZEngineeringWasteMaterialVo zEngineeringWasteMaterialVo = new ZEngineeringWasteMaterialVo();
+        List nodeCheck = new ArrayList<>();
+        for (SysDictData dictData : dictDataList) {
+            boolean flag = false;
+            for (ZEngineeringNodeBo nodeBo : zEngineeringNodeBos) {
+                if(nodeBo.getType().equals(dictData.getDictValue())){
+                    flag = true;
+                    break;
+                }
+            }
+            Map map = new HashMap();
+            map.put("name", dictData.getDictLabel());
+            if(flag){
+                for (ZEngineeringNodeBo nodeBo : zEngineeringNodeBos) {
+                    if(nodeBo.getType().equals(dictData.getDictValue())){
+                        if(nodeBo.getzEngineeringInfoBoList().size() == 0){
+                            map.put("value", "未上传"); // 上传过 创建过节点 后来删了工程信息 但是节点数据依然在
+                        }else if (nodeBo.getzEngineeringInfoBoList().stream().anyMatch(ele -> "0".equals(ele.getState()))) {
+                            map.put("value", "未通过");
+                        } else if (nodeBo.getzEngineeringInfoBoList().stream().allMatch(ele -> "1".equals(ele.getState()))) {
+                            map.put("value", "通过");
+                        } else {
+                            map.put("value", "未审核");
+                        }
+                        break;
+                    }
+                }
+            }else {
+                map.put("value", "未上传");
+            }
+            nodeCheck.add(map);
+        }
+        zEngineeringWasteMaterialVo.setNodeCheck(nodeCheck);
+//        for (int i = 0; i < zEngineeringNodeBos.size(); i++) {
+//            ZEngineeringNodeBo nodeBo = zEngineeringNodeBos.get(i);
+//        }
+//        zEngineeringWasteMaterialVo.setMaterialPercentagePE();
+        AtomicReference<BigDecimal> pesj = new AtomicReference<>(new BigDecimal(0));
+        AtomicReference<BigDecimal> gsj = new AtomicReference<>(new BigDecimal(0));
+        for (int i = 0; i < zEngineeringNodeBos.size(); i++) {
+            ZEngineeringNodeBo nodeBo = zEngineeringNodeBos.get(i);
+            for (ZEngineeringInfoBo info: nodeBo.getzEngineeringInfoBoList()) {
+                System.out.println(info.getzEngineeringMaterialBo());
+                LambdaQueryWrapper<ZEngineeringMaterial> lqw4 = Wrappers.lambdaQuery();
+                lqw4.eq(StringUtils.isNotBlank(info.getId()), ZEngineeringMaterial::getDetailsId, info.getId());
+                List<ZEngineeringMaterial> material= zEngineeringMaterialMapper.selectList(lqw4);
+                material.stream().forEach(item4->{
+                    String type = zEnginMaterialQualityMapper.selectVoById(item4.getMaterialQuality()).getMaterialType();
+                    if("0".equals(type)){
+                        pesj.updateAndGet(v ->v.add(new BigDecimal(Double.toString(item4.getNumber()))));
+                    }else if("1".equals(type)){
+                        gsj.updateAndGet(v ->v.add(new BigDecimal(Double.toString(item4.getNumber()))));
+                    }
+                });
+            }
+        }
+        Map pe = new HashMap(); // PE材料
+        pe.put("actuality", getRoundDouble(pesj.get(), 2)); // 实际
+        pe.put("anticipation", zEngineeringPipeJackingVo.getPePreset()); // 预计
+        pe.put("percentage", getRoundDouble((pesj.get().multiply(new BigDecimal(100))).divide(BigDecimal.valueOf(zEngineeringPipeJackingVo.getPePreset())),2) + "%"); // 占比
+        Map iron = new HashMap(); // 钢材
+        iron.put("actuality", getRoundDouble(gsj.get(), 2)); // 实际
+        iron.put("anticipation", zEngineeringPipeJackingVo.getGcPreset()); // 预计
+        iron.put("percentage", getRoundDouble((gsj.get().multiply(new BigDecimal(100))).divide(BigDecimal.valueOf(zEngineeringPipeJackingVo.getGcPreset())),2) + "%"); // 占比
+        zEngineeringWasteMaterialVo.setMaterialPercentagePE(pe);
+        zEngineeringWasteMaterialVo.setMaterialPercentageIron(iron);
+        return zEngineeringWasteMaterialVo;
+    }
+
+    /**
+     * 碰口作业
+     * tapping_operation
+     * touchOperationEngineering
+     */
+    @Override
+    public ZEngineeringWasteMaterialVo queryTouchOperationEngineering(String id) {
+        ZTouchOperationEngineeringVo zTouchOperationEngineeringVo = touchOperationMapper.selectVoById(id);
+        ZEngineeringNodeBo zEngineeringNodeBo = new ZEngineeringNodeBo();
+        zEngineeringNodeBo.setCivliId(id);
+        zEngineeringNodeBo.setCreateTime(zTouchOperationEngineeringVo.getCreateTime());
+        List<ZEngineeringNodeBo> zEngineeringNodeBos = izEngineeringNodeService.queryListDetails(zEngineeringNodeBo);
+//        zEngineeringIndustryVo.setZEngineeringNodeBoList(zEngineeringNodeBos);
+        String modeOperation = zTouchOperationEngineeringVo.getModeOperation();
+        String dictType;
+        switch (modeOperation){
+            case "地埋扳孔":{
+                dictType = "bury_the_wrench_hole";
+                break;
+            }
+            case "架空扳孔":{
+                dictType = "aerial_wrench_hole";
+                break;
+            }
+            case "停气作业":{
+                dictType = "shutdown_operation";
+                break;
+            }
+            case "PE 封堵":{
+                dictType = "pe_plugging";
+                break;
+            }
+            case "钢管带气封堵":{
+                dictType = "the_steel_pipe_sealed_with_gas";
+                break;
+            }
+            default:{
+                dictType = null;
+            }
+        }
+        Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
+        List<SysDictData> dictDataList = sysDictMap.get(dictType);
+        ZEngineeringWasteMaterialVo zEngineeringWasteMaterialVo = new ZEngineeringWasteMaterialVo();
+        List nodeCheck = new ArrayList<>();
+        for (SysDictData dictData : dictDataList) {
+            boolean flag = false;
+            for (ZEngineeringNodeBo nodeBo : zEngineeringNodeBos) {
+                if(nodeBo.getType().equals(dictData.getDictValue())){
+                    flag = true;
+                    break;
+                }
+            }
+            Map map = new HashMap();
+            map.put("name", dictData.getDictLabel());
+            if(flag){
+                for (ZEngineeringNodeBo nodeBo : zEngineeringNodeBos) {
+                    if(nodeBo.getType().equals(dictData.getDictValue())){
+                        if(nodeBo.getzEngineeringInfoBoList().size() == 0){
+                            map.put("value", "未上传"); // 上传过 创建过节点 后来删了工程信息 但是节点数据依然在
+                        }else if (nodeBo.getzEngineeringInfoBoList().stream().anyMatch(ele -> "0".equals(ele.getState()))) {
+                            map.put("value", "未通过");
+                        } else if (nodeBo.getzEngineeringInfoBoList().stream().allMatch(ele -> "1".equals(ele.getState()))) {
+                            map.put("value", "通过");
+                        } else {
+                            map.put("value", "未审核");
+                        }
+                        break;
+                    }
+                }
+            }else {
+                map.put("value", "未上传");
+            }
+            nodeCheck.add(map);
+        }
+        zEngineeringWasteMaterialVo.setNodeCheck(nodeCheck);
+//        for (int i = 0; i < zEngineeringNodeBos.size(); i++) {
+//            ZEngineeringNodeBo nodeBo = zEngineeringNodeBos.get(i);
+//        }
+//        zEngineeringWasteMaterialVo.setMaterialPercentagePE();
+        return zEngineeringWasteMaterialVo;
+    }
+}

+ 170 - 0
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZEngineeringWasteMateriaMapper.xml

@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.zdsz.mapper.ZEngineeringWasteMaterialMapper">
+
+    <resultMap type="com.ruoyi.zdsz.domain.ZEngineeringIndustry" id="ZEngineeringIndustryResult">
+        <result property="id" column="id"/>
+        <result property="enginType" column="engin_type"/>
+        <result property="constructUnit" column="construct_unit"/>
+        <result property="projectHead" column="project_head"/>
+        <result property="sceneHead" column="scene_head"/>
+        <result property="designUnit" column="design_unit"/>
+        <result property="designHead" column="design_head"/>
+        <result property="designPhone" column="design_phone"/>
+        <result property="supervisionUnit" column="supervision_unit"/>
+        <result property="supervisionHead" column="supervision_head"/>
+        <result property="supervisionPhone" column="supervision_phone"/>
+        <result property="type" column="type"/>
+        <result property="version" column="version"/>
+        <result property="remark" column="remark"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <select id="getDicts" resultType="java.util.Map">
+        SELECT dict_label as dictLabel,dict_value as dictValue
+        from sys_dict_data
+        where 1 = 1
+        <if test="type == 4">
+            and dict_type = 'municipal_node_types'
+        </if>
+        <if test="type == 2">
+            and dict_type = 'engineering_infrastructure'
+        </if>
+        <if test="type == 1">
+            and dict_type = 'pipe_jack'
+        </if>
+        <if test="type == 5">
+            and dict_type = 'engin_classification'
+        </if>
+        <if test="type == 3">
+            and dict_type = 'air_wall_node'
+        </if>
+    </select>
+    <select id="getReviewStatusByNodeId" resultType="java.util.Map">
+        SELECT
+            en.type,
+            COALESCE(
+                    (SELECT er.review_status FROM z_engineering_review er WHERE er.eng_info_id = en.id AND er.del_flag = 0
+                                                                          ORDER BY er.update_info_time DESC LIMIT 1),
+        '2'
+    ) AS reviewStatus
+        FROM
+            z_engineering_node en
+        WHERE
+            en.civli_id = #{id}
+    </select>
+    <select id="getByUserList" resultType="java.util.Map">
+        SELECT
+            epj.id AS id,
+            epj.engin_name AS enginName,
+        <if test="szAndGy=='gy'">
+            epj.engin_classification AS enginClassification,
+        </if>
+            <if test="szAndGy=='pk'">
+                if(#{type} = 'z_touch_operation_engineering',epj.mode_operation,'') AS modeOperation,
+            </if>
+            epj.create_time AS createTime
+        FROM z_engineering_info  ei
+                 LEFT JOIN z_engineering_node en ON ei.eng_info_id = en.id
+                 LEFT JOIN ${type} epj ON epj.id = en.civli_id
+                and epj.del_flag = '0'
+        WHERE ei.create_by = #{by} AND epj.id IS NOT NULL
+        <if test="enginName != '' and enginName != null ">
+            and epj.engin_name LIKE CONCAT('%',#{enginName},'%')
+        </if>
+        <if test="enginType != '' and enginType != null and szAndGy!='pk'">
+            and epj.engin_type LIKE CONCAT('%',#{enginType},'%')
+        </if>
+        <if test="enginClassification != '' and enginClassification != null and szAndGy=='gy'">
+            and epj.engin_classification LIKE CONCAT('%',#{enginClassification},'%')
+        </if>
+        <if test="enginType != '' and enginType != null and szAndGy=='pk'">
+            and epj.mode_operation LIKE CONCAT('%',#{enginType},'%')
+        </if>
+        GROUP BY epj.id
+        <foreach collection="names" item="name">
+            union
+            SELECT
+            epj.id AS id,
+            epj.engin_name AS enginName,
+            <if test="szAndGy=='gy'">
+                epj.engin_classification AS enginClassification,
+            </if>
+            <if test="szAndGy=='pk'">
+                if(#{type} = 'z_touch_operation_engineering',epj.mode_operation,'') AS modeOperation,
+            </if>
+            epj.create_time AS createTime
+            FROM z_engineering_info_${name}  ei
+            LEFT JOIN z_engineering_node_${name} en ON ei.eng_info_id = en.id
+            LEFT JOIN ${type} epj ON epj.id = en.civli_id
+            and epj.del_flag = '0'
+            WHERE ei.create_by = #{by} AND epj.id IS NOT NULL
+            <if test="enginName != '' and enginName != null ">
+                and epj.engin_name LIKE CONCAT('%',#{enginName},'%')
+            </if>
+            <if test="enginType != '' and enginType != null and szAndGy!='pk'">
+                and epj.engin_type LIKE CONCAT('%',#{enginType},'%')
+            </if>
+            <if test="enginClassification != '' and enginClassification != null and szAndGy=='gy'">
+                and epj.engin_classification LIKE CONCAT('%',#{enginClassification},'%')
+            </if>
+            <if test="enginType != '' and enginType != null and szAndGy=='pk'">
+                and epj.mode_operation LIKE CONCAT('%',#{enginType},'%')
+            </if>
+            GROUP BY epj.id
+
+        </foreach>
+    </select>
+
+    <select id="getByUserList1" resultType="java.util.Map">
+        SELECT
+        epj.id AS id,
+        epj.engin_name AS enginName,
+        dict.dict_label as dictName,
+        dict.dict_value as dictvalue,
+        epj.create_time AS createTime
+        FROM z_engineering_info  ei
+        LEFT JOIN z_engineering_node en ON ei.eng_info_id = en.id
+        LEFT JOIN ${type} epj ON epj.id = en.civli_id
+        left join sys_dict_data as dict ON dict.dict_value = epj.engin_type
+        and epj.del_flag = '0'
+        WHERE ei.create_by = #{by} AND epj.id IS NOT NULL
+        <if test="enginName != '' and enginName != null ">
+            and epj.engin_name LIKE CONCAT('%',#{enginName},'%')
+        </if>
+        <if test="enginType != '' and enginType != null and type!='z_engineering_dangerous'">
+            and epj.engin_type LIKE CONCAT('%',#{enginType},'%')
+        </if>
+        GROUP BY epj.id
+        <foreach collection="names" item="name">
+            union
+            SELECT
+            epj.id AS id,
+            epj.engin_name AS enginName,
+            dict.dict_label as dictName,
+            dict.dict_value as dictvalue,
+            epj.create_time AS createTime
+            FROM z_engineering_info_${name}  ei
+            LEFT JOIN z_engineering_node_${name} en ON ei.eng_info_id = en.id
+            LEFT JOIN ${type} epj ON epj.id = en.civli_id
+            left join sys_dict_data as dict ON dict.dict_value = epj.engin_type
+            and epj.del_flag = '0'
+            WHERE ei.create_by = #{by} AND epj.id IS NOT NULL
+            <if test="enginName != '' and enginName != null ">
+                and epj.engin_name LIKE CONCAT('%',#{enginName},'%')
+            </if>
+            <if test="enginType != '' and enginType != null and type!='z_engineering_dangerous'">
+                and epj.engin_type LIKE CONCAT('%',#{enginType},'%')
+            </if>
+            GROUP BY epj.id
+
+        </foreach>
+    </select>
+
+</mapper>