diff --git a/src/main/java/com/biutag/supervision/service/ModelClueService.java b/src/main/java/com/biutag/supervision/service/ModelClueService.java index 87b6e91..7771f7b 100644 --- a/src/main/java/com/biutag/supervision/service/ModelClueService.java +++ b/src/main/java/com/biutag/supervision/service/ModelClueService.java @@ -57,6 +57,8 @@ public class ModelClueService extends ServiceImpl { public final SupExternalDepartMapper supExternalDepartMapper; + private final StatisticsDepartMapper statisticsDepartMapper; + public Page page(ModelClueQueryParam param) { if (Objects.nonNull(param.getModelIds()) && param.getModelIds().isEmpty()) { return new Page().setTotal(0).setRecords(new ArrayList<>()); @@ -1048,7 +1050,7 @@ public class ModelClueService extends ServiceImpl { private void getModelCluesForModel104(String param, List modelClues) { System.out.println("模型104开始查询数据库"); List params = parseSqlForModel2(param); - String sql = "select a.gxdwdm, a.gxdwmc, a.num anum, b.num bnum from ((SELECT gxdwdm, gxdwmc, COUNT(*) AS zjjs from dwd_asj_zhtx_jjd where bjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' AND (ysjqxzdm LIKE '01%' OR ysjqxzdm LIKE'02%' OR ysjqxzdm LIKE'06%') AND (bjxldm NOT LIKE '01%' AND bjxldm NOT LIKE '02%' AND bjxldm NOT LIKE '06%') and bjfsdm = '0101' GROUP BY gxdwdm, gxdwmc) a join (SELECT gxdwdm, gxdwmc, COUNT(*) AS zjjs from dwd_asj_zhtx_jjd where bjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' AND (ysjqxzdm LIKE '01%' OR ysjqxzdm LIKE'02%' OR ysjqxzdm LIKE'06%') and bjfsdm = '0101' GROUP BY gxdwdm, gxdwmc) b on a.gxdwdm = b.gxdwdm);"; + String sql = "select a.gxdwdm, a.gxdwmc, a.num anum, b.num bnum from ((SELECT gxdwdm, gxdwmc, COUNT(*) AS num from dwd_asj_zhtx_jjd where bjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' AND (ysjqxzdm LIKE '01%' OR ysjqxzdm LIKE'02%' OR ysjqxzdm LIKE'06%') AND (bjxldm NOT LIKE '01%' AND bjxldm NOT LIKE '02%' AND bjxldm NOT LIKE '06%') and bjfsdm = '0101' GROUP BY gxdwdm, gxdwmc) a join (SELECT gxdwdm, gxdwmc, COUNT(*) num from dwd_asj_zhtx_jjd where bjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' AND (ysjqxzdm LIKE '01%' OR ysjqxzdm LIKE'02%' OR ysjqxzdm LIKE'06%') and bjfsdm = '0101' GROUP BY gxdwdm, gxdwmc) b on a.gxdwdm = b.gxdwdm);"; List> jjdmaps = modelClueDataMapper.selectByUniqueKeys(sql); System.out.println("模型104查询数据库完毕"); if (jjdmaps.isEmpty()) { @@ -1089,6 +1091,9 @@ public class ModelClueService extends ServiceImpl { .map(Map.Entry::getKey) .toList(); for (String department : highPercentageDepartments) { + if (departNumMap.get(department) < 10) { + continue; + } ModelClue newModelClue = new ModelClue(); newModelClue.setUniqueKey(department); newModelClue.setNegativeIdEx(department); @@ -1096,6 +1101,10 @@ public class ModelClueService extends ServiceImpl { if (supExternalDepart != null) { if (supExternalDepart.getInternalId() != null) { newModelClue.setInvolveDepartId(supExternalDepart.getInternalId()); + StatisticsDepart statisticsDepart = statisticsDepartMapper.selectOne(new QueryWrapper().eq("departId", supExternalDepart.getInternalId()).last("LIMIT 1")); + if (statisticsDepart == null || statisticsDepart.getLevel() == null || statisticsDepart.getLevel() != 10L) { + continue; + } } if (supExternalDepart.getInternalShortName() != null) { newModelClue.setInvolveDepartName(supExternalDepart.getInternalShortName());