From f021b36b28c12c8704c161fc2727f93489244ccc Mon Sep 17 00:00:00 2001 From: Angel <1050374295@qq.com> Date: Thu, 25 Jan 2024 15:33:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B2=BF=E6=B5=B7=E8=AD=A6=E6=83=85?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BigScreenController.java | 13 ++++-- .../controller/MetaAlarmInfoController.java | 20 ++++++++- .../database/mapper/MetaAlarmInfoMapper.java | 45 ++++++++++++------- 3 files changed, 57 insertions(+), 21 deletions(-) diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java b/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java index 01a86e6..3978511 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java @@ -56,14 +56,18 @@ public class BigScreenController extends BaseController { @ApiOperation("资源概况") public AjaxResult overviewResources() { try { + //人户一致 101 + //流动人口 102 + //人在户不在 124 + //户在人不在 201 // 流口查询 QueryWrapper queryLdrkWrapper = new QueryWrapper<>(); queryLdrkWrapper.eq("actual_user_type", 102); int actualUserLdrkCount = actualUserInfoService.count(queryLdrkWrapper); - //实有人口总数 -// QueryWrapper querySyrkWrapper = new QueryWrapper<>(); -// querySyrkWrapper.ne("actual_user_type", 101); - int actualUserSyrkCount = actualUserInfoService.count(); +// 实有人口总数 + QueryWrapper querySyrkWrapper = new QueryWrapper<>(); + querySyrkWrapper.ne("actual_user_type", 101); + int actualUserSyrkCount = actualUserInfoService.count(querySyrkWrapper); //实有房屋总数 // int countSyfw = realEstateInfoService.countSyfw(new MetaRealEstateInfo()); int countSyfw = realEstateInfoService.count(); @@ -289,6 +293,7 @@ public class BigScreenController extends BaseController { @ApiOperation("警情统计列表,重点警情") public AjaxResult policeSituationStatisticsList() { try { + List metaAlarmInfos = alarmInfoService.listAlarmAndHandleAlarm(); return AjaxResult.success(metaAlarmInfos); } catch (Exception e) { diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/MetaAlarmInfoController.java b/gather-app/src/main/java/com/ruoyi/database/controller/MetaAlarmInfoController.java index 41feb55..4e7034e 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/MetaAlarmInfoController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/MetaAlarmInfoController.java @@ -44,7 +44,23 @@ public class MetaAlarmInfoController extends BaseController { @ApiOperation("查询接警信息表") public TableDataInfo list(MetaAlarmInfo metaAlarmInfo) { startPage(); - List list = metaAlarmInfoService.list(new QueryWrapper<>(metaAlarmInfo)); + QueryWrapper wrapper = new QueryWrapper<>(metaAlarmInfo); + wrapper.and(w -> w.like("alarm_response_unit", "射阳县公安局临海派出所").or() + .like("alarm_response_unit", "射阳县公安局临海派出所第一警务区").or() + .like("alarm_response_unit", "射阳县公安局临海派出所第二警务区").or() + .like("alarm_response_unit", "射阳县公安局临海派出所第三警务区").or() + .like("alarm_response_unit", "射阳县公安局临海派出所第四警务区").or() + .like("alarm_response_unit", "射阳县公安局临港派出所").or() + .like("alarm_response_unit", "射阳县公安局临港派出所社区警务责任区").or() + .like("alarm_response_unit", "射阳县公安局临港派出所第一警务区").or() + .like("alarm_response_unit", "射阳县公安局临港派出所第二警务区").or() + .like("alarm_response_unit", "射阳县公安局临港派出所第一警务区").or() + .like("alarm_response_unit", "射阳县公安局扁担港边防派出所").or() + .like("alarm_response_unit", "射阳县公安局扁担港边防派出所第一警务区").or() + .like("alarm_response_unit", "射阳县公安局黄沙河边防派出所").or() + .like("alarm_response_unit", "射阳县公安局黄沙河边防派出所第一警务区").or() + .like("alarm_response_unit", "射阳县公安局黄沙河边防派出所第三警务区")); + List list = metaAlarmInfoService.list(wrapper); return getDataTable(list); } @@ -69,7 +85,7 @@ public class MetaAlarmInfoController extends BaseController { PageUtils.startPage(); List list = metaAlarmInfoService.list(queryWrapper); List alarmInfos = new ArrayList<>(); - for (MetaAlarmInfo metaAlarmInfo1 : list){ + for (MetaAlarmInfo metaAlarmInfo1 : list) { String informantTime = metaAlarmInfo1.getInformantTime(); Date parse1 = outputSdf.parse(informantTime); String format1 = dateFormat.format(parse1); diff --git a/gather-app/src/main/java/com/ruoyi/database/mapper/MetaAlarmInfoMapper.java b/gather-app/src/main/java/com/ruoyi/database/mapper/MetaAlarmInfoMapper.java index ffaa6f9..80e0689 100644 --- a/gather-app/src/main/java/com/ruoyi/database/mapper/MetaAlarmInfoMapper.java +++ b/gather-app/src/main/java/com/ruoyi/database/mapper/MetaAlarmInfoMapper.java @@ -27,21 +27,36 @@ public interface MetaAlarmInfoMapper extends BaseMapper { public List selectTop3AlarmInfo(); - @Select(" select a.id, " + - "a.alarm_code jjxx_alarm_code, " + - "a.police_receiver_name jjxx_police_receiver_name, " + - "a.alarm_response_unit jjxx_alarm_response_unit, " + - "a.alarm_response_time jjxx_alarm_response_time, " + - "a.alarm_response_content jjxx_alarm_response_content, " + - "a.alarm_response_type_name jjxx_alarm_response_type_name, " + - "a.informant_name jjxx_informant_name, " + - "a.informant_phone jjxx_informant_phone, " + - "a.informant_time jjxx_informant_time, " + - "a.alarm_address jjxx_alarm_address, " + - "a.longitude jjxx_longitude, " + - "a.latitude jjxx_latitude from ( " + - "select * from meta_alarm_info order by informant_time desc limit 100 " + - ") a " ) + @Select("SELECT a.id, " + + "a.alarm_code jjxx_alarm_code, " + + "a.police_receiver_name jjxx_police_receiver_name, " + + "a.alarm_response_unit jjxx_alarm_response_unit, " + + "a.alarm_response_time jjxx_alarm_response_time, " + + "a.alarm_response_content jjxx_alarm_response_content, " + + "a.alarm_response_type_name jjxx_alarm_response_type_name, " + + "a.informant_name jjxx_informant_name, " + + "a.informant_phone jjxx_informant_phone, " + + "a.informant_time jjxx_informant_time, " + + "a.alarm_address jjxx_alarm_address, " + + "a.longitude jjxx_longitude, " + + "a.latitude jjxx_latitude " + + "FROM (SELECT * FROM meta_alarm_info WHERE " + + "alarm_response_unit LIKE '射阳县公安局临海派出所' OR " + + "alarm_response_unit LIKE '射阳县公安局临海派出所第一警务区' OR " + + "alarm_response_unit LIKE '射阳县公安局临海派出所第二警务区' OR " + + "alarm_response_unit LIKE '射阳县公安局临海派出所第三警务区' OR " + + "alarm_response_unit LIKE '射阳县公安局临海派出所第四警务区' OR " + + "alarm_response_unit LIKE '射阳县公安局临港派出所' OR " + + "alarm_response_unit LIKE '射阳县公安局临港派出所社区警务责任区' OR " + + "alarm_response_unit LIKE '射阳县公安局临港派出所第一警务区' OR " + + "alarm_response_unit LIKE '射阳县公安局临港派出所第二警务区' OR " + + "alarm_response_unit LIKE '射阳县公安局临港派出所第一警务区' OR " + + "alarm_response_unit LIKE '射阳县公安局扁担港边防派出所' OR " + + "alarm_response_unit LIKE '射阳县公安局扁担港边防派出所第一警务区' OR " + + "alarm_response_unit LIKE '射阳县公安局黄沙河边防派出所' OR " + + "alarm_response_unit LIKE '射阳县公安局黄沙河边防派出所第一警务区' OR " + + "alarm_response_unit LIKE '射阳县公安局黄沙河边防派出所第三警务区' " + + "ORDER BY informant_time DESC LIMIT 100) a") public List listAlarmAndHandleAlarm(); From eb0c2556fa458cf413931e9c28357d902edf0221 Mon Sep 17 00:00:00 2001 From: Angel <1050374295@qq.com> Date: Thu, 25 Jan 2024 15:47:28 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E8=AD=A6=E6=83=85?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BigScreenController.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java b/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java index 31f1003..f3abb02 100644 --- a/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java +++ b/gather-app/src/main/java/com/ruoyi/business/controller/BigScreenController.java @@ -312,7 +312,22 @@ public class BigScreenController extends BaseController { Date thirtyMinutesAgo = DateUtil.offsetMinute(new Date(), -NumKit.checkInt(time)); QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.gt("alarm_response_time", DateUtil.format(thirtyMinutesAgo, "yyyyMMddHHmmss")); + queryWrapper.gt("alarm_response_time", DateUtil.format(thirtyMinutesAgo, "yyyyMMddHHmmss")) + .and(wrapper -> wrapper.like("alarm_response_unit", "射阳县公安局临海派出所").or() + .like("alarm_response_unit", "射阳县公安局临海派出所第一警务区").or() + .like("alarm_response_unit", "射阳县公安局临海派出所第二警务区").or() + .like("alarm_response_unit", "射阳县公安局临海派出所第三警务区").or() + .like("alarm_response_unit", "射阳县公安局临海派出所第四警务区").or() + .like("alarm_response_unit", "射阳县公安局临港派出所").or() + .like("alarm_response_unit", "射阳县公安局临港派出所社区警务责任区").or() + .like("alarm_response_unit", "射阳县公安局临港派出所第一警务区").or() + .like("alarm_response_unit", "射阳县公安局临港派出所第二警务区").or() + .like("alarm_response_unit", "射阳县公安局临港派出所第一警务区").or() + .like("alarm_response_unit", "射阳县公安局扁担港边防派出所").or() + .like("alarm_response_unit", "射阳县公安局扁担港边防派出所第一警务区").or() + .like("alarm_response_unit", "射阳县公安局黄沙河边防派出所").or() + .like("alarm_response_unit", "射阳县公安局黄沙河边防派出所第一警务区").or() + .like("alarm_response_unit", "射阳县公安局黄沙河边防派出所第三警务区")); List metaAlarmInfos = alarmInfoService.list(queryWrapper); return AjaxResult.success(metaAlarmInfos); } catch (Exception e) {