Browse Source

修改104号模型

main
sjh 1 year ago
parent
commit
aa7a50d37d
  1. 4
      src/main/java/com/biutag/supervision/service/ModelClueService.java

4
src/main/java/com/biutag/supervision/service/ModelClueService.java

@ -1048,7 +1048,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
private void getModelCluesForModel104(String param, List<ModelClue> modelClues) {
System.out.println("模型104开始查询数据库");
List<String> params = parseSqlForModel2(param);
String sql = "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 jqjb != '04' 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%') GROUP BY gxdwdm, gxdwmc;";
String sql = "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 jqjb != '04' 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;";
List<Map<String, Object>> jjdmaps = modelClueDataMapper.selectByUniqueKeys(sql);
System.out.println("模型104查询数据库完毕");
if (jjdmaps.isEmpty()) {
@ -1085,7 +1085,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
BigDecimal sumOfPercentages = departPercentageMap.values().stream()
.reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal avgPercentage = sumOfPercentages.divide(BigDecimal.valueOf(departPercentageMap.size()), 3, RoundingMode.HALF_UP);
BigDecimal multiply = avgPercentage.multiply(new BigDecimal("0.5"));
BigDecimal multiply = avgPercentage.multiply(new BigDecimal("1.5"));
List<String> highPercentageDepartments = departPercentageMap.entrySet().stream()
.filter(entry -> entry.getValue().compareTo(multiply) > 0)
.map(Map.Entry::getKey)

Loading…
Cancel
Save