Browse Source

修改前14号模型,支持导入对应单位和人员

main
sjh 1 year ago
parent
commit
a25749e057
  1. 2
      src/main/java/com/biutag/supervision/mapper/ModelClueDataMapper.java
  2. 2
      src/main/java/com/biutag/supervision/pojo/entity/ModelClue.java
  3. 5
      src/main/java/com/biutag/supervision/service/BusinessPoliceService.java
  4. 292
      src/main/java/com/biutag/supervision/service/ModelClueService.java

2
src/main/java/com/biutag/supervision/mapper/ModelClueDataMapper.java

@ -17,4 +17,6 @@ public interface ModelClueDataMapper extends BaseMapper<ModelClue> {
@Select("${newSql}") @Select("${newSql}")
List<Map<String, Object>> selectByUniqueKeys(@org.apache.ibatis.annotations.Param("newSql") String newSql); List<Map<String, Object>> selectByUniqueKeys(@org.apache.ibatis.annotations.Param("newSql") String newSql);
@Select("SELECT XM, JH FROM dwd_ry_zfba_baryxx WHERE ZJ = #{barID}")
Map<String, Object> selectBAR(String barID);
} }

2
src/main/java/com/biutag/supervision/pojo/entity/ModelClue.java

@ -30,7 +30,7 @@ public class ModelClue {
private String involveDepartId; private String involveDepartId;
// 涉及人员 // 涉及人员
@TableField("involve_depart_name") @TableField("involve_police_name")
private String involvePoliceName; private String involvePoliceName;
// 涉及人员警号 // 涉及人员警号

5
src/main/java/com/biutag/supervision/service/BusinessPoliceService.java

@ -40,12 +40,8 @@ public class BusinessPoliceService extends ServiceImpl<BusinessPoliceMapper, Bus
private final BusinessLogMapper businessLogMapper; private final BusinessLogMapper businessLogMapper;
private final BusinessDepartService businessDepartService;
public final ModelClueDataMapper modelClueDataMapper; public final ModelClueDataMapper modelClueDataMapper;
private final SupDepartMapper supDepartMapper;
private final SupExternalDepartMapper supExternalDepartMapper; private final SupExternalDepartMapper supExternalDepartMapper;
public Page<BusinessPoliceModel> page(BusinessQueryParam businessQueryParam) { public Page<BusinessPoliceModel> page(BusinessQueryParam businessQueryParam) {
@ -59,7 +55,6 @@ public class BusinessPoliceService extends ServiceImpl<BusinessPoliceMapper, Bus
happenTime.add(startDate); happenTime.add(startDate);
happenTime.add(endDate); happenTime.add(endDate);
generate(happenTime); generate(happenTime);
businessDepartService.generate(happenTime);
log.info("已经导入{}的个人数据", date.format(DateTimeFormatter.ofPattern("yyyy年M月d日"))); log.info("已经导入{}的个人数据", date.format(DateTimeFormatter.ofPattern("yyyy年M月d日")));
} }
} else if (businessQueryParam.getDepartName() != null && businessQueryParam.getDepartName().equals("开始导入今天所有的数据")) { } else if (businessQueryParam.getDepartName() != null && businessQueryParam.getDepartName().equals("开始导入今天所有的数据")) {

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

@ -52,8 +52,6 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
public final ModelClueRecordMapper modelClueRecordMapper; public final ModelClueRecordMapper modelClueRecordMapper;
public final SupDepartMapper supDepartMapper;
public final SupExternalDepartMapper supExternalDepartMapper; public final SupExternalDepartMapper supExternalDepartMapper;
public Page<ModelClueModel> page(ModelClueQueryParam param) { public Page<ModelClueModel> page(ModelClueQueryParam param) {
@ -193,9 +191,9 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
} else if (modelId == 4) { // 4号模型:疑似漏登执法办案场所问题监督模型 } else if (modelId == 4) { // 4号模型:疑似漏登执法办案场所问题监督模型
return getModelCluesForModel4(sql, modelClues); return getModelCluesForModel4(sql, modelClues);
} else { } else {
System.out.println("测试" + modelId + "开始查询数据库"); System.out.println("模型" + modelId + "开始查询数据库");
modelClues = modelClueDataMapper.selectDataByDynamicSql(sql); modelClues = modelClueDataMapper.selectDataByDynamicSql(sql);
System.out.println("测试" + modelId + "查询数据库完毕,数量为:" + modelClues.size()); System.out.println("模型" + modelId + "查询数据库完毕,数量为:" + modelClues.size());
} }
List<String> uniqueKeys = modelClues.stream().map(ModelClue::getUniqueKey).filter(k -> k != null && !k.isEmpty()).toList(); List<String> uniqueKeys = modelClues.stream().map(ModelClue::getUniqueKey).filter(k -> k != null && !k.isEmpty()).toList();
List<String> oldUniqueKeys = this.listObjs(new LambdaQueryWrapper<ModelClue>().select(ModelClue::getUniqueKey).eq(ModelClue::getStatus, 0).eq(ModelClue::getModelId, modelId), String::valueOf); List<String> oldUniqueKeys = this.listObjs(new LambdaQueryWrapper<ModelClue>().select(ModelClue::getUniqueKey).eq(ModelClue::getStatus, 0).eq(ModelClue::getModelId, modelId), String::valueOf);
@ -217,55 +215,178 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
if (Objects.equals(keyColumn, modelClue.getUniqueKey())) { if (Objects.equals(keyColumn, modelClue.getUniqueKey())) {
modelClue.setData(JSONObject.toJSONString(data)); modelClue.setData(JSONObject.toJSONString(data));
modelClue.setStatus(0); modelClue.setStatus(0);
List<Integer> modelNos = new ArrayList<>(List.of(1)); // 1号模型:行政、刑事案件受理30天仍未立案问题监督模型 setPerson(modelId, modelClue, data);
if (modelNos.contains(modelId)) { generateZFBAThingDesc(modelId, modelClue, data);
String thingDesc = modelClue.getThingDesc(); break;
modelClue.setThingDesc("该" + data.get("AJBZmc") }
+ "案件编号为" + data.get("AJBH") }
+ ",报案日期为" + getDateString(data.get("BARQ")) }
+ ",受理日期为" + getDateString(data.get("SLRQ")) return needsInsertModelClues;
+ ",当前案件状态为“" + data.get("AJZTmc") }
+ "”,已经超过" + "30"
+ "日仍未受理。" + thingDesc); private void setPerson(Integer modelId, ModelClue modelClue, Map<String, Object> data) {
} else if (modelId == 3) { // 3号模型:执法办案场所登记时长超时问题监督模型 if (modelId == 3) {
if (data.get("lksj") != null && !data.get("lksj").equals("")) { if (data.get("bar1") != null && !data.get("bar1").equals("")) {
modelClue.setThingDesc("姓名" + data.get("xm") if (data.get("bar2") != null && !data.get("bar2").equals("")) {
+ ",身份证号" + data.get("zjhm") modelClue.setInvolvePoliceName(data.get("bar1") + "," + data.get("bar2"));
+ ",于" + formatStringDate((String) data.get("djsj")) } else {
+ "登记进入" + data.get("csmc") modelClue.setInvolvePoliceName((String) data.get("bar1"));
+ ",离开时间为" + formatStringDate((String) data.get("lksj")) }
+ ",超过了48小时。"); } else {
if (data.get("bar2") != null && !data.get("bar2").equals("")) {
modelClue.setInvolvePoliceName((String) data.get("bar2"));
} else {
modelClue.setInvolvePoliceName("无数据");
}
}
if (data.get("bar1jh") != null && !data.get("bar1jh").equals("")) {
if (data.get("bar2jh") != null && !data.get("bar2jh").equals("")) {
modelClue.setInvolvePoliceEmpNo(data.get("bar1jh") + "," + data.get("bar2jh"));
} else {
modelClue.setInvolvePoliceEmpNo((String) data.get("bar1jh"));
}
} else {
if (data.get("bar2jh") != null && !data.get("bar2jh").equals("")) {
modelClue.setInvolvePoliceEmpNo((String) data.get("bar2jh"));
} else {
modelClue.setInvolvePoliceEmpNo("无数据");
}
}
}
if (modelId == 10 || modelId == 11 || modelId == 12 || modelId == 13 || modelId == 14) {
Map<String, Object> bar1;
Map<String, Object> bar2;
if (data.get("BAR1ID") != null && !data.get("BAR1ID").equals("")) {
bar1 = modelClueDataMapper.selectBAR((String) data.get("BAR1ID"));
if (data.get("BAR2ID") != null && !data.get("BAR2ID").equals("")) {
bar2 = modelClueDataMapper.selectBAR((String) data.get("BAR2ID"));
if (bar1 != null) {
if (bar2 != null) {
modelClue.setInvolvePoliceEmpNo(bar1.get("JH") + "," + bar2.get("JH"));
modelClue.setInvolvePoliceName(bar1.get("XM") + "," + bar2.get("XM"));
} else { } else {
modelClue.setThingDesc("姓名" + data.get("xm") modelClue.setInvolvePoliceEmpNo((String) bar1.get("JH"));
+ ",身份证号" + data.get("zjhm") modelClue.setInvolvePoliceName((String) bar1.get("XM"));
+ ",于" + formatStringDate((String) data.get("djsj"))
+ "登记进入" + data.get("csmc")
+ ",没有离开时间。");
} }
} else if (modelId == 10) { // 10号模型:案件受理不及时的异常数据 } else if (bar2 != null) {
modelClue.setThingDesc("该" + data.get("AJBZmc") modelClue.setInvolvePoliceEmpNo((String) bar2.get("JH"));
+ "案件编号为" + data.get("AJBH") modelClue.setInvolvePoliceName((String) bar2.get("XM"));
+ ",报案日期为" + getDateString(data.get("BARQ")) } else {
+ ",受理日期为" + getDateString(data.get("SLRQ")) modelClue.setInvolvePoliceEmpNo("无数据");
+ ",当前案件状态为“" + data.get("AJZTmc") modelClue.setInvolvePoliceName("无数据");
+ "”,已经超过" + "3" }
+ "日仍未受理。"); } else {
if (bar1 != null) {
modelClue.setInvolvePoliceEmpNo((String) bar1.get("JH"));
modelClue.setInvolvePoliceName((String) bar1.get("XM"));
} else {
modelClue.setInvolvePoliceEmpNo("无数据");
modelClue.setInvolvePoliceName("无数据");
} }
break; }
} else {
if (data.get("bar2jh") != null && !data.get("bar2jh").equals("")) {
bar2 = modelClueDataMapper.selectBAR((String) data.get("BAR2ID"));
if (bar2 != null) {
modelClue.setInvolvePoliceEmpNo((String) bar2.get("JH"));
modelClue.setInvolvePoliceName((String) bar2.get("XM"));
} else {
modelClue.setInvolvePoliceEmpNo("无数据");
modelClue.setInvolvePoliceName("无数据");
}
} else {
modelClue.setInvolvePoliceEmpNo("无数据");
modelClue.setInvolvePoliceName("无数据");
} }
} }
} }
return needsInsertModelClues; }
private static void generateZFBAThingDesc(Integer modelId, ModelClue modelClue, Map<String, Object> data) {
if (modelId == 1) { // 1号模型:行政、刑事案件受理30天仍未立案问题监督模型
String thingDesc = modelClue.getThingDesc();
modelClue.setThingDesc("该" + data.get("AJBZmc")
+ "案件编号为" + data.get("AJBH")
+ ",报案日期为" + getDateString(data.get("BARQ"))
+ ",受理日期为" + getDateString(data.get("SLRQ"))
+ ",当前案件状态为“" + data.get("AJZTmc")
+ "”,已经超过" + "30"
+ "日仍未受理。" + thingDesc);
} else if (modelId == 3) { // 3号模型:执法办案场所登记时长超时问题监督模型
if (data.get("lksj") != null && !data.get("lksj").equals("")) {
modelClue.setThingDesc("姓名" + data.get("xm")
+ ",身份证号" + data.get("zjhm")
+ ",于" + formatStringDate((String) data.get("djsj"))
+ "登记进入" + data.get("csmc")
+ ",离开时间为" + formatStringDate((String) data.get("lksj"))
+ ",超过了48小时。");
} else {
modelClue.setThingDesc("姓名" + data.get("xm")
+ ",身份证号" + data.get("zjhm")
+ ",于" + formatStringDate((String) data.get("djsj"))
+ "登记进入" + data.get("csmc")
+ ",没有离开时间。");
}
} else if (modelId == 10) { // 10号模型:案件受理不及时的异常数据
modelClue.setThingDesc("该" + data.get("AJBZmc")
+ "案件编号为" + getAjbh(data)
+ ",报案日期为" + getDateString(data.get("BARQ"))
+ ",受理日期为" + getDateString(data.get("SLRQ"))
+ ",当前案件状态为“" + data.get("AJZTmc")
+ "”,超过" + "3"
+ "日未受理。");
} else if (modelId == 11) { // 11号模型:立案不及时的异常数据(7天)
modelClue.setThingDesc("该" + data.get("AJBZmc")
+ "案件编号为" + getAjbh(data)
+ ",受理日期为" + getDateString(data.get("SLRQ"))
+ ",立案日期为" + getDateString(data.get("LARQ"))
+ ",当前案件状态为“" + data.get("AJZTmc")
+ "”,超过" + "7"
+ "日未受理。");
} else if (modelId == 12) { // 12号模型:立案不及时的异常数据(30天)
modelClue.setThingDesc("该" + data.get("AJBZmc")
+ "案件编号为" + getAjbh(data)
+ ",受理日期为" + getDateString(data.get("SLRQ"))
+ ",立案日期为" + getDateString(data.get("LARQ"))
+ ",当前案件状态为“" + data.get("AJZTmc")
+ "”,超过" + "30"
+ "日未受理。");
} else if (modelId == 13) { // 13号模型:立案不及时的异常数据(60天)
modelClue.setThingDesc("该" + data.get("AJBZmc")
+ "案件编号为" + getAjbh(data)
+ ",受理日期为" + getDateString(data.get("SLRQ"))
+ ",立案日期为" + getDateString(data.get("LARQ"))
+ ",当前案件状态为“" + data.get("AJZTmc")
+ "”,超过" + "60"
+ "日未受理。");
} else if (modelId == 14) { // 14号模型:立案不及时的异常数据(无数据)
modelClue.setThingDesc("该" + data.get("AJBZmc")
+ "案件编号为" + getAjbh(data)
+ ",受理日期为" + getDateString(data.get("SLRQ"))
+ ",立案日期 无数据"
+ ",当前案件状态为“" + data.get("AJZTmc")
+ "”,立案不及时。");
}
}
private static String getAjbh(Map<String, Object> data) {
String AJBH;
if (data.get("AJBH") == null || data.get("AJBH").equals("")) {
AJBH = "空";
} else {
AJBH = (String) data.get("AJBH");
}
return AJBH;
} }
private List<ModelClue> getModelCluesForModel4(String param, List<ModelClue> modelClues) { private List<ModelClue> getModelCluesForModel4(String param, List<ModelClue> modelClues) {
System.out.println("测试4开始查询数据库"); System.out.println("模型4开始查询数据库");
List<String> params = parseSqlForModel2(param); List<String> params = parseSqlForModel2(param);
String jjdSql = "SELECT gxdwdm AS involve_depart_id, gxdwmc AS involve_depart_name, COUNT(*) AS zjjs FROM dwd_asj_zhtx_jjd WHERE cjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' GROUP BY gxdwdm, gxdwmc;"; String jjdSql = "SELECT gxdwdm AS involve_depart_id, gxdwmc AS involve_depart_name, COUNT(*) AS zjjs FROM dwd_asj_zhtx_jjd WHERE cjsj BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' GROUP BY gxdwdm, gxdwmc;";
String zfqySql = "SELECT csid AS involve_depart_id, COUNT(*) AS zfcsdjs FROM dwd_ry_zfba_zfqywfryb WHERE STR_TO_DATE( djsj, '%Y%m%d%H%i%s' ) BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' GROUP BY csid;"; String zfqySql = "SELECT csid AS involve_depart_id, COUNT(*) AS zfcsdjs FROM dwd_ry_zfba_zfqywfryb WHERE STR_TO_DATE( djsj, '%Y%m%d%H%i%s' ) BETWEEN '" + params.get(0) + " 00:00:00' AND '" + params.get(1) + " 00:00:00' GROUP BY csid;";
List<Map<String, Object>> jjdmaps = modelClueDataMapper.selectByUniqueKeys(jjdSql); List<Map<String, Object>> jjdmaps = modelClueDataMapper.selectByUniqueKeys(jjdSql);
List<Map<String, Object>> zfqymaps = modelClueDataMapper.selectByUniqueKeys(zfqySql); List<Map<String, Object>> zfqymaps = modelClueDataMapper.selectByUniqueKeys(zfqySql);
System.out.println("测试4查询数据库完毕"); System.out.println("模型4查询数据库完毕");
if (jjdmaps.isEmpty()) { if (jjdmaps.isEmpty()) {
return modelClues; return modelClues;
} }
@ -308,7 +429,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
List<ModelClue> zfqymModelClues5 = new ArrayList<>(zfqymModelClues.stream().filter(clue -> clue.getDepartLevel() == 5).toList()); List<ModelClue> zfqymModelClues5 = new ArrayList<>(zfqymModelClues.stream().filter(clue -> clue.getDepartLevel() == 5).toList());
mergeModelClues(zfqymModelClues5, zfqymModelClues4, 2); mergeModelClues(zfqymModelClues5, zfqymModelClues4, 2);
mergeModelClues(zfqymModelClues4, zfqymModelClues3, 2); mergeModelClues(zfqymModelClues4, zfqymModelClues3, 2);
BigDecimal avgPercentage = null; BigDecimal avgPercentage;
if (!zfqymModelClues3.isEmpty()) { if (!zfqymModelClues3.isEmpty()) {
BigDecimal zjjsTotal = BigDecimal.valueOf(jjdModelClues3.stream().mapToLong(ModelClue::getZjjs).sum()); BigDecimal zjjsTotal = BigDecimal.valueOf(jjdModelClues3.stream().mapToLong(ModelClue::getZjjs).sum());
BigDecimal zfcsdjsTotal = BigDecimal.valueOf(zfqymModelClues3.stream().mapToLong(ModelClue::getZfcsdjs).sum()); BigDecimal zfcsdjsTotal = BigDecimal.valueOf(zfqymModelClues3.stream().mapToLong(ModelClue::getZfcsdjs).sum());
@ -364,59 +485,6 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
return modelClues; return modelClues;
} }
/*
private List<ModelClue> getModelCluesForModel4(String sql, List<ModelClue> modelClues) {
System.out.println("测试4开始查询数据库");
List<Map<String, Object>> maps = modelClueDataMapper.selectByUniqueKeys(sql);
System.out.println("测试4查询数据库完毕");
// 全市平均数
BigDecimal avgPercentage = null;
if (!maps.isEmpty()) {
avgPercentage = (BigDecimal) maps.get(0).get("avg_percentage");
}
List<ModelClue> oriModelClues = new ArrayList<>();
for (Map<String, Object> data : maps) {
SupExternalDepart supExternalDepart = supExternalDepartMapper.selectOne(new LambdaQueryWrapper<SupExternalDepart>().eq(SupExternalDepart::getExternalId, data.get("involve_depart_id")));
if (supExternalDepart != null) {
ModelClue modelClue = new ModelClue();
modelClue.setData(JSONObject.toJSONString(data));
modelClue.setInvolveDepartId(supExternalDepart.getExternalId());
modelClue.setInvolveDepartName(supExternalDepart.getExternalName());
modelClue.setZjjs((Long) data.get("zjjs"));
modelClue.setZfcsdjs((Long) data.get("zfcsdjs"));
modelClue.setBl((BigDecimal) data.get("bl"));
modelClue.setDepartLevel(supExternalDepart.getLevel());
modelClue.setParentId(supExternalDepart.getPid());
modelClue.setThisId(supExternalDepart.getInternalId());
oriModelClues.add(modelClue);
}
}
List<ModelClue> modelClues3 = new ArrayList<>(oriModelClues.stream().filter(clue -> clue.getDepartLevel() == 3).toList());
List<ModelClue> modelClues4 = new ArrayList<>(oriModelClues.stream().filter(clue -> clue.getDepartLevel() == 4).toList());
List<ModelClue> modelClues5 = new ArrayList<>(oriModelClues.stream().filter(clue -> clue.getDepartLevel() == 5).toList());
mergeModelClues(modelClues5, modelClues3);
mergeModelClues(modelClues4, modelClues3);
Iterator<ModelClue> iterator = modelClues3.iterator();
while (iterator.hasNext()) {
ModelClue modelClue = iterator.next();
if (modelClue.getBl().compareTo(avgPercentage) > 0) {
iterator.remove();
}
}
for (ModelClue modelClue : modelClues3) {
modelClue.setStatus(0);
modelClue.setThingDesc("在" + getNowTime() + "之前的1个月内," + modelClue.getInvolveDepartName()
+ "的总警情数为" + modelClue.getZjjs()
+ ",执法场所登记数为" + modelClue.getZfcsdjs()
+ ",每100起警情执法场所登记比例为" + modelClue.getBl()
+ ",低于全市平均值(" + avgPercentage
+ "%),疑似漏登执法办案场所。");
}
modelClues.addAll(modelClues3);
return modelClues;
}
*/
private void mergeModelClues(List<ModelClue> modelClues2, List<ModelClue> modelClues1 , int no) { private void mergeModelClues(List<ModelClue> modelClues2, List<ModelClue> modelClues1 , int no) {
for (ModelClue modelClue2 : modelClues2) { for (ModelClue modelClue2 : modelClues2) {
Iterator<ModelClue> iterator1 = modelClues1.iterator(); Iterator<ModelClue> iterator1 = modelClues1.iterator();
@ -494,9 +562,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
List<String> uniqueKeys2 = modelClues2.stream().map(ModelClue::getUniqueKey).filter(k -> k != null && !k.isEmpty()).toList(); List<String> uniqueKeys2 = modelClues2.stream().map(ModelClue::getUniqueKey).filter(k -> k != null && !k.isEmpty()).toList();
if (!uniqueKeys2.isEmpty()) { if (!uniqueKeys2.isEmpty()) {
String newSql2 = "SELECT a.*, b.ajbh, b.lasj FROM dwd_asj_zhtx_jjd a LEFT JOIN dwd_asj_sjjhygx_jjcjxxb b ON b.BARLXDH = a.bjdh WHERE a.jjdbh IN " + "(" + uniqueKeys2.stream().map(k -> "'" + k + "'").collect(Collectors.joining(",")) + ");"; String newSql2 = "SELECT a.*, b.ajbh, b.lasj FROM dwd_asj_zhtx_jjd a LEFT JOIN dwd_asj_sjjhygx_jjcjxxb b ON b.BARLXDH = a.bjdh WHERE a.jjdbh IN " + "(" + uniqueKeys2.stream().map(k -> "'" + k + "'").collect(Collectors.joining(",")) + ");";
System.out.println("测试2开始查询数据库 newSql2");
List<Map<String, Object>> allData2 = modelClueDataMapper.selectByUniqueKeys(newSql2); List<Map<String, Object>> allData2 = modelClueDataMapper.selectByUniqueKeys(newSql2);
System.out.println("测试2查询数据库newSql2记录条数:" + allData2.size());
for (ModelClue modelClue : modelClues2) { for (ModelClue modelClue : modelClues2) {
for (Map<String, Object> data : allData2) { for (Map<String, Object> data : allData2) {
String keyColumn = (String) data.get("jjdbh"); String keyColumn = (String) data.get("jjdbh");
@ -521,35 +587,35 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
} }
private void genarateModelCluesForModel2(String preSql, String postSql, List<ModelClue> modelClues) { private void genarateModelCluesForModel2(String preSql, String postSql, List<ModelClue> modelClues) {
System.out.println("测试2开始查询数据库 盗"); System.out.println("模型2开始查询数据库 盗");
List<ModelClue> modelClues1 = modelClueDataMapper.selectDataByDynamicSql(preSql + "盗" + postSql); List<ModelClue> modelClues1 = modelClueDataMapper.selectDataByDynamicSql(preSql + "盗" + postSql);
System.out.println("测试2开始查询数据库 骗"); System.out.println("模型2开始查询数据库 骗");
List<ModelClue> modelClues2 = modelClueDataMapper.selectDataByDynamicSql(preSql + "骗" + postSql); List<ModelClue> modelClues2 = modelClueDataMapper.selectDataByDynamicSql(preSql + "骗" + postSql);
System.out.println("测试2开始查询数据库 强奸"); System.out.println("模型2开始查询数据库 强奸");
List<ModelClue> modelClues3 = modelClueDataMapper.selectDataByDynamicSql(preSql + "强奸" + postSql); List<ModelClue> modelClues3 = modelClueDataMapper.selectDataByDynamicSql(preSql + "强奸" + postSql);
System.out.println("测试2开始查询数据库 抢"); System.out.println("模型2开始查询数据库 抢");
List<ModelClue> modelClues4 = modelClueDataMapper.selectDataByDynamicSql(preSql + "抢" + postSql); List<ModelClue> modelClues4 = modelClueDataMapper.selectDataByDynamicSql(preSql + "抢" + postSql);
System.out.println("测试2开始查询数据库 10岁"); System.out.println("模型2开始查询数据库 10岁");
List<ModelClue> modelClues5 = modelClueDataMapper.selectDataByDynamicSql(preSql + "10岁" + postSql); List<ModelClue> modelClues5 = modelClueDataMapper.selectDataByDynamicSql(preSql + "10岁" + postSql);
System.out.println("测试2开始查询数据库 11岁"); System.out.println("模型2开始查询数据库 11岁");
List<ModelClue> modelClues6 = modelClueDataMapper.selectDataByDynamicSql(preSql + "11岁" + postSql); List<ModelClue> modelClues6 = modelClueDataMapper.selectDataByDynamicSql(preSql + "11岁" + postSql);
System.out.println("测试2开始查询数据库 12岁"); System.out.println("模型2开始查询数据库 12岁");
List<ModelClue> modelClues7 = modelClueDataMapper.selectDataByDynamicSql(preSql + "12岁" + postSql); List<ModelClue> modelClues7 = modelClueDataMapper.selectDataByDynamicSql(preSql + "12岁" + postSql);
System.out.println("测试2开始查询数据库 13岁"); System.out.println("模型2开始查询数据库 13岁");
List<ModelClue> modelClues8 = modelClueDataMapper.selectDataByDynamicSql(preSql + "13岁" + postSql); List<ModelClue> modelClues8 = modelClueDataMapper.selectDataByDynamicSql(preSql + "13岁" + postSql);
System.out.println("测试2开始查询数据库 14岁"); System.out.println("模型2开始查询数据库 14岁");
List<ModelClue> modelClues9 = modelClueDataMapper.selectDataByDynamicSql(preSql + "14岁" + postSql); List<ModelClue> modelClues9 = modelClueDataMapper.selectDataByDynamicSql(preSql + "14岁" + postSql);
System.out.println("测试2开始查询数据库 15岁"); System.out.println("模型2开始查询数据库 15岁");
List<ModelClue> modelClues10 = modelClueDataMapper.selectDataByDynamicSql(preSql + "15岁" + postSql); List<ModelClue> modelClues10 = modelClueDataMapper.selectDataByDynamicSql(preSql + "15岁" + postSql);
System.out.println("测试2开始查询数据库 16岁"); System.out.println("模型2开始查询数据库 16岁");
List<ModelClue> modelClues11 = modelClueDataMapper.selectDataByDynamicSql(preSql + "16岁" + postSql); List<ModelClue> modelClues11 = modelClueDataMapper.selectDataByDynamicSql(preSql + "16岁" + postSql);
System.out.println("测试2开始查询数据库 未成年"); System.out.println("模型2开始查询数据库 未成年");
List<ModelClue> modelClues12 = modelClueDataMapper.selectDataByDynamicSql(preSql + "未成年" + postSql); List<ModelClue> modelClues12 = modelClueDataMapper.selectDataByDynamicSql(preSql + "未成年" + postSql);
modelClues.addAll(Stream.of(modelClues1, modelClues2, modelClues3, modelClues4, modelClues5, modelClues6, modelClues7, modelClues8, modelClues9, modelClues10, modelClues11, modelClues12) modelClues.addAll(Stream.of(modelClues1, modelClues2, modelClues3, modelClues4, modelClues5, modelClues6, modelClues7, modelClues8, modelClues9, modelClues10, modelClues11, modelClues12)
.flatMap(List::stream) .flatMap(List::stream)
.collect(Collectors.toMap(ModelClue::getUniqueKey, data -> data, (existing, replacement) -> existing)) .collect(Collectors.toMap(ModelClue::getUniqueKey, data -> data, (existing, replacement) -> existing))
.values()); .values());
System.out.println("测试2查询数据库完毕,数量为:" + modelClues.size()); System.out.println("模型2查询数据库完毕,数量为:" + modelClues.size());
} }
private static String getDateString(Object param) { private static String getDateString(Object param) {
@ -579,7 +645,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
} }
} }
} }
return ""; return " 无时间数据 ";
} }
public static String generateNewSql(String originalSql, List<String> uniqueKeys) { public static String generateNewSql(String originalSql, List<String> uniqueKeys) {
@ -622,13 +688,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
log.info("日期转换异常", ex); log.info("日期转换异常", ex);
} }
} }
return "空"; return " 无时间数据 ";
}
public static String getNowTime() {
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
return now.format(formatter);
} }
public static List<String> parseSqlForModel2(String param) { public static List<String> parseSqlForModel2(String param) {

Loading…
Cancel
Save