Browse Source

新增105号模型:近一月同一人同一类型问题出现3次以上的异常数据

main
sjh 1 year ago
parent
commit
64b6d48405
  1. 5
      src/main/java/com/biutag/supervision/mapper/ModelClueMapper.java
  2. 27
      src/main/java/com/biutag/supervision/service/ModelClueService.java

5
src/main/java/com/biutag/supervision/mapper/ModelClueMapper.java

@ -9,8 +9,13 @@ import com.biutag.supervision.pojo.model.ModelClueModel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
public interface ModelClueMapper extends BaseMapper<ModelClue> {
Page<ModelClueModel> queryPage(@Param("page") Page<ModelClue> page, @Param(Constants.WRAPPER) QueryWrapper<ModelClue> queryWrapper);
@Select("${newSql}")
List<Map<String, Object>> selectByUniqueKeys(@org.apache.ibatis.annotations.Param("newSql") String newSql);
}

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

@ -245,6 +245,9 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
} else if (modelId == 104) { // 模型104:大量变更接警性质的预警模型
getModelCluesForModel104(sql, modelClues);
return modelClues;
} else if (modelId == 105) { // 模型105:近一月同一人同一类型问题出现3次以上的异常数据
getModelCluesForModel105(sql, modelClues);
return modelClues;
} else {
System.out.println("模型" + modelId + "开始查询数据库");
modelClues = modelClueDataMapper.selectDataByDynamicSql(sql);
@ -1124,6 +1127,30 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
}
}
private void getModelCluesForModel105(String sql, List<ModelClue> modelClues) {
System.out.println("模型105开始查询数据库");
List<Map<String, Object>> sqlList = modelClueMapper.selectByUniqueKeys(sql);
System.out.println("模型105查询数据库完毕,结果数量:" + sqlList.size());
if (sqlList.isEmpty()) {
return;
}
for (Map<String, Object> map : sqlList) {
ModelClue newModelClue = new ModelClue();
newModelClue.setUniqueKey((String) map.get("blameId"));
newModelClue.setNegativeIdEx((String) map.get("blameId"));
newModelClue.setInvolveDepartName(map.get("involveDepartName") == null ? "" : (String) map.get("involveDepartName"));
newModelClue.setInvolveDepartId(map.get("involveDepartId") == null ? "" : (String) map.get("involveDepartId"));
newModelClue.setInvolvePoliceEmpNo((String) map.get("emp_no"));
newModelClue.setInvolvePoliceName((String) map.get("blameName"));
newModelClue.setData(JSONObject.toJSONString(map));
newModelClue.setDistributionState("0");
newModelClue.setThingDesc(
"发现过去的一个月内,民警" + map.get("blameName") + "出现了" + map.get("co") + "次“"
+ map.get("threeLevelContent") + "”的违规行为,请予以重点关注。");
modelClues.add(newModelClue);
}
}
private void mergeModelClues(List<ModelClue> modelClues2, List<ModelClue> modelClues1 , int no) {
for (ModelClue modelClue2 : modelClues2) {
Iterator<ModelClue> iterator1 = modelClues1.iterator();

Loading…
Cancel
Save