Browse Source

修改104号模型

main
sjh 1 year ago
parent
commit
0da65a5a38
  1. 11
      src/main/java/com/biutag/supervision/service/ModelClueService.java

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

@ -57,6 +57,8 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
public final SupExternalDepartMapper supExternalDepartMapper;
private final StatisticsDepartMapper statisticsDepartMapper;
public Page<ModelClueModel> page(ModelClueQueryParam param) {
if (Objects.nonNull(param.getModelIds()) && param.getModelIds().isEmpty()) {
return new Page<ModelClueModel>().setTotal(0).setRecords(new ArrayList<>());
@ -1048,7 +1050,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 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<Map<String, Object>> jjdmaps = modelClueDataMapper.selectByUniqueKeys(sql);
System.out.println("模型104查询数据库完毕");
if (jjdmaps.isEmpty()) {
@ -1089,6 +1091,9 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
.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<ModelClueMapper, ModelClue> {
if (supExternalDepart != null) {
if (supExternalDepart.getInternalId() != null) {
newModelClue.setInvolveDepartId(supExternalDepart.getInternalId());
StatisticsDepart statisticsDepart = statisticsDepartMapper.selectOne(new QueryWrapper<StatisticsDepart>().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());

Loading…
Cancel
Save