@ -52,8 +52,6 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
public final ModelClueRecordMapper modelClueRecordMapper ;
public final SupDepartMapper supDepartMapper ;
public final SupExternalDepartMapper supExternalDepartMapper ;
public Page < ModelClueModel > page ( ModelClueQueryParam param ) {
@ -173,7 +171,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
for ( ModelClue modelClue : modelClues ) {
modelClue . setModelId ( modelId ) ;
modelClue . setCreateTime ( LocalDateTime . now ( ) ) ;
SupExternalDepart supExternalDepart = supExternalDepartMapper . selectOne ( new LambdaQueryWrapper < SupExternalDepart > ( ) . eq ( SupExternalDepart : : getExternalId , modelClue . getInvolveDepartId ( ) ) ) ;
SupExternalDepart supExternalDepart = supExternalDepartMapper . selectOne ( new LambdaQueryWrapper < SupExternalDepart > ( ) . eq ( SupExternalDepart : : getExternalId , modelClue . getInvolveDepartId ( ) ) . last ( "LIMIT 1" ) ) ;
if ( supExternalDepart ! = null & & supExternalDepart . getInternalShortName ( ) ! = null & & ! supExternalDepart . getInternalShortName ( ) . isEmpty ( ) ) {
modelClue . setInvolveDepartName ( supExternalDepart . getInternalShortName ( ) ) ;
modelClue . setInvolveDepartId ( supExternalDepart . getInternalId ( ) ) ;
@ -193,9 +191,9 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
} else if ( modelId = = 4 ) { // 4号模型:疑似漏登执法办案场所问题监督模型
return getModelCluesForModel4 ( sql , modelClues ) ;
} else {
System . out . println ( "测试 " + modelId + "开始查询数据库" ) ;
System . out . println ( "模型 " + modelId + "开始查询数据库" ) ;
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 > oldUniqueKeys = this . listObjs ( new LambdaQueryWrapper < ModelClue > ( ) . select ( ModelClue : : getUniqueKey ) . eq ( ModelClue : : getStatus , 0 ) . eq ( ModelClue : : getModelId , modelId ) , String : : valueOf ) ;
@ -217,53 +215,184 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
if ( Objects . equals ( keyColumn , modelClue . getUniqueKey ( ) ) ) {
modelClue . setData ( JSONObject . toJSONString ( data ) ) ;
modelClue . setStatus ( 0 ) ;
List < Integer > modelNos = new ArrayList < > ( List . of ( 1 ) ) ; // 1号模型:行政、刑事案件受理30天仍未立案问题监督模型
if ( modelNos . contains ( modelId ) ) {
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小时。" ) ;
setPerson ( modelId , modelClue , data ) ;
generateZFBAThingDesc ( modelId , modelClue , data ) ;
break ;
}
}
}
return needsInsertModelClues ;
}
private void setPerson ( Integer modelId , ModelClue modelClue , Map < String , Object > data ) {
if ( modelId = = 3 ) {
if ( data . get ( "bar1" ) ! = null & & ! data . get ( "bar1" ) . equals ( "" ) ) {
if ( data . get ( "bar2" ) ! = null & & ! data . get ( "bar2" ) . equals ( "" ) ) {
modelClue . setInvolvePoliceName ( data . get ( "bar1" ) + "," + data . get ( "bar2" ) ) ;
} else {
modelClue . setInvolvePoliceName ( ( String ) data . get ( "bar1" ) ) ;
}
} 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 {
modelClue . setThingDesc ( "姓名" + data . get ( "xm" )
+ ",身份证号" + data . get ( "zjhm" )
+ ",于" + formatStringDate ( ( String ) data . get ( "djsj" ) )
+ "登记进入" + data . get ( "csmc" )
+ ",没有离开时间。" ) ;
modelClue . setInvolvePoliceEmpNo ( ( String ) bar1 . get ( "JH" ) ) ;
modelClue . setInvolvePoliceName ( ( String ) bar1 . get ( "XM" ) ) ;
}
} else if ( bar2 ! = null ) {
modelClue . setInvolvePoliceEmpNo ( ( String ) bar2 . get ( "JH" ) ) ;
modelClue . setInvolvePoliceName ( ( String ) bar2 . get ( "XM" ) ) ;
} else {
modelClue . setInvolvePoliceEmpNo ( "无数据" ) ;
modelClue . setInvolvePoliceName ( "无数据" ) ;
}
} 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 ) {
System . out . println ( "测试4开始查询数据库" ) ;
System . out . println ( "模型 4开始查询数据库" ) ;
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 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 > > zfqymaps = modelClueDataMapper . selectByUniqueKeys ( zfqySql ) ;
System . out . println ( "测试4查询数据库完毕" ) ;
System . out . println ( "模型 4查询数据库完毕" ) ;
if ( jjdmaps . isEmpty ( ) ) {
return modelClues ;
}
List < ModelClue > jjdModelClues = new ArrayList < > ( ) ;
for ( Map < String , Object > data : jjdmaps ) {
SupExternalDepart supExternalDepart = supExternalDepartMapper . selectOne ( new LambdaQueryWrapper < SupExternalDepart > ( ) . eq ( SupExternalDepart : : getExternalId , data . get ( "involve_depart_id" ) ) ) ;
SupExternalDepart supExternalDepart = supExternalDepartMapper . selectOne ( new LambdaQueryWrapper < SupExternalDepart > ( ) . eq ( SupExternalDepart : : getExternalId , data . get ( "involve_depart_id" ) ) . last ( "LIMIT 1" ) ) ;
if ( supExternalDepart ! = null & & supExternalDepart . getExternalId ( ) ! = null & & supExternalDepart . getExternalName ( ) ! = null & & supExternalDepart . getInternalId ( ) ! = null & & supExternalDepart . getLevel ( ) ! = null & & supExternalDepart . getPid ( ) ! = null ) {
ModelClue modelClue = new ModelClue ( ) ;
modelClue . setData ( JSONObject . toJSONString ( data ) ) ;
@ -283,7 +412,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
mergeModelClues ( jjdModelClues4 , jjdModelClues3 , 1 ) ;
List < ModelClue > zfqymModelClues = new ArrayList < > ( ) ;
for ( Map < String , Object > data : zfqymaps ) {
SupExternalDepart supExternalDepart = supExternalDepartMapper . selectOne ( new LambdaQueryWrapper < SupExternalDepart > ( ) . eq ( SupExternalDepart : : getExternalId , data . get ( "involve_depart_id" ) ) ) ;
SupExternalDepart supExternalDepart = supExternalDepartMapper . selectOne ( new LambdaQueryWrapper < SupExternalDepart > ( ) . eq ( SupExternalDepart : : getExternalId , data . get ( "involve_depart_id" ) ) . last ( "LIMIT 1" ) ) ;
if ( supExternalDepart ! = null & & supExternalDepart . getExternalId ( ) ! = null & & supExternalDepart . getExternalName ( ) ! = null & & supExternalDepart . getInternalId ( ) ! = null & & supExternalDepart . getLevel ( ) ! = null & & supExternalDepart . getPid ( ) ! = null ) {
ModelClue modelClue = new ModelClue ( ) ;
modelClue . setData ( JSONObject . toJSONString ( data ) ) ;
@ -300,7 +429,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
List < ModelClue > zfqymModelClues5 = new ArrayList < > ( zfqymModelClues . stream ( ) . filter ( clue - > clue . getDepartLevel ( ) = = 5 ) . toList ( ) ) ;
mergeModelClues ( zfqymModelClues5 , zfqymModelClues4 , 2 ) ;
mergeModelClues ( zfqymModelClues4 , zfqymModelClues3 , 2 ) ;
BigDecimal avgPercentage = null ;
BigDecimal avgPercentage ;
if ( ! zfqymModelClues3 . isEmpty ( ) ) {
BigDecimal zjjsTotal = BigDecimal . valueOf ( jjdModelClues3 . stream ( ) . mapToLong ( ModelClue : : getZjjs ) . sum ( ) ) ;
BigDecimal zfcsdjsTotal = BigDecimal . valueOf ( zfqymModelClues3 . stream ( ) . mapToLong ( ModelClue : : getZfcsdjs ) . sum ( ) ) ;
@ -356,59 +485,6 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
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 ) {
for ( ModelClue modelClue2 : modelClues2 ) {
Iterator < ModelClue > iterator1 = modelClues1 . iterator ( ) ;
@ -427,7 +503,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
}
}
if ( ! found ) {
SupExternalDepart supExternalDepart = supExternalDepartMapper . selectOne ( new LambdaQueryWrapper < SupExternalDepart > ( ) . eq ( SupExternalDepart : : getInternalId , modelClue2 . getParentId ( ) ) ) ;
SupExternalDepart supExternalDepart = supExternalDepartMapper . selectOne ( new LambdaQueryWrapper < SupExternalDepart > ( ) . eq ( SupExternalDepart : : getInternalId , modelClue2 . getParentId ( ) ) . last ( "LIMIT 1" ) ) ;
if ( supExternalDepart ! = null ) {
ModelClue newModelClue = new ModelClue ( ) ;
newModelClue . setData ( modelClue2 . getData ( ) ) ;
@ -486,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 ( ) ;
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 ( "," ) ) + ");" ;
System . out . println ( "测试2开始查询数据库 newSql2" ) ;
List < Map < String , Object > > allData2 = modelClueDataMapper . selectByUniqueKeys ( newSql2 ) ;
System . out . println ( "测试2查询数据库newSql2记录条数:" + allData2 . size ( ) ) ;
for ( ModelClue modelClue : modelClues2 ) {
for ( Map < String , Object > data : allData2 ) {
String keyColumn = ( String ) data . get ( "jjdbh" ) ;
@ -513,35 +587,35 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
}
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 ) ;
System . out . println ( "测试 2开始查询数据库 骗" ) ;
System . out . println ( "模型 2开始查询数据库 骗" ) ;
List < ModelClue > modelClues2 = modelClueDataMapper . selectDataByDynamicSql ( preSql + "骗" + postSql ) ;
System . out . println ( "测试 2开始查询数据库 强奸" ) ;
System . out . println ( "模型 2开始查询数据库 强奸" ) ;
List < ModelClue > modelClues3 = modelClueDataMapper . selectDataByDynamicSql ( preSql + "强奸" + postSql ) ;
System . out . println ( "测试 2开始查询数据库 抢" ) ;
System . out . println ( "模型 2开始查询数据库 抢" ) ;
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 ) ;
System . out . println ( "测试 2开始查询数据库 11岁" ) ;
System . out . println ( "模型 2开始查询数据库 11岁" ) ;
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 ) ;
System . out . println ( "测试 2开始查询数据库 13岁" ) ;
System . out . println ( "模型 2开始查询数据库 13岁" ) ;
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 ) ;
System . out . println ( "测试 2开始查询数据库 15岁" ) ;
System . out . println ( "模型 2开始查询数据库 15岁" ) ;
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 ) ;
System . out . println ( "测试 2开始查询数据库 未成年" ) ;
System . out . println ( "模型 2开始查询数据库 未成年" ) ;
List < ModelClue > modelClues12 = modelClueDataMapper . selectDataByDynamicSql ( preSql + "未成年" + postSql ) ;
modelClues . addAll ( Stream . of ( modelClues1 , modelClues2 , modelClues3 , modelClues4 , modelClues5 , modelClues6 , modelClues7 , modelClues8 , modelClues9 , modelClues10 , modelClues11 , modelClues12 )
. flatMap ( List : : stream )
. collect ( Collectors . toMap ( ModelClue : : getUniqueKey , data - > data , ( existing , replacement ) - > existing ) )
. values ( ) ) ;
System . out . println ( "测试 2查询数据库完毕,数量为:" + modelClues . size ( ) ) ;
System . out . println ( "模型 2查询数据库完毕,数量为:" + modelClues . size ( ) ) ;
}
private static String getDateString ( Object param ) {
@ -571,7 +645,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
}
}
}
return " " ;
return " 无时间数据 " ;
}
public static String generateNewSql ( String originalSql , List < String > uniqueKeys ) {
@ -614,13 +688,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
log . info ( "日期转换异常" , ex ) ;
}
}
return " " ;
}
public static String getNowTime ( ) {
LocalDateTime now = LocalDateTime . now ( ) ;
DateTimeFormatter formatter = DateTimeFormatter . ofPattern ( "yyyy-MM-dd HH:mm:ss" ) ;
return now . format ( formatter ) ;
return " 无时间数据 " ;
}
public static List < String > parseSqlForModel2 ( String param ) {