From 3a38a3eb9bbf200e4c109e15d4f0c445fa1cf80a Mon Sep 17 00:00:00 2001 From: wu Date: Tue, 10 Sep 2024 15:22:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0aiid=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6;=20119=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/dto/request/AlarmFindRequest.java | 8 +++++++- .../domain/dto/request/EventPageRequest.java | 8 +++++++- .../domain/dto/request/FireFindRequest.java | 12 ++++++++++++ .../page/service/impl/FireServiceImpl.java | 19 +++++++++++++++++++ .../resources/mapper/page/AlarmMapper.xml | 12 ++++++++++-- .../resources/mapper/page/EventMapper.xml | 11 +++++++++-- alarm/src/main/resources/application-dev.yml | 2 +- .../yingji/service/impl/FireServiceImpl.java | 11 ++++++++++- 8 files changed, 75 insertions(+), 8 deletions(-) diff --git a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/dto/request/AlarmFindRequest.java b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/dto/request/AlarmFindRequest.java index c1b8cee..709e97d 100644 --- a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/dto/request/AlarmFindRequest.java +++ b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/dto/request/AlarmFindRequest.java @@ -105,5 +105,11 @@ public class AlarmFindRequest implements Serializable { * 前端选择框 1查询ai120Id不为空的 2查询ai120Id为空的 */ @ApiModelProperty(value = "前端选择框 1查询ai120Id不为空的 2查询ai120Id为空的") - private Integer selectIsNull; + private Integer select120; + + /** + * 前端选择框 1查询ai119Id不为空的 2查询ai119Id为空的 + */ + @ApiModelProperty(value = "前端选择框 1查询ai120Id不为空的 2查询ai120Id为空的") + private Integer select119; } diff --git a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/dto/request/EventPageRequest.java b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/dto/request/EventPageRequest.java index fd50611..f6f1435 100644 --- a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/dto/request/EventPageRequest.java +++ b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/dto/request/EventPageRequest.java @@ -117,6 +117,12 @@ public class EventPageRequest implements Serializable { * 前端选择框 1查询ai110Id不为空的 2查询ai110Id为空的 */ @ApiModelProperty(value = "前端选择框 1查询ai110Id不为空的 2查询ai110Id为空的") - private Integer selectIsNull; + private Integer select110; + + /** + * 前端选择框 1查询ai119Id不为空的 2查询ai119Id为空的 + */ + @ApiModelProperty(value = "前端选择框 1查询ai119Id不为空的 2查询ai119Id为空的") + private Integer select119; } diff --git a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/dto/request/FireFindRequest.java b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/dto/request/FireFindRequest.java index 1ee8c37..f7501e8 100644 --- a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/dto/request/FireFindRequest.java +++ b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/domain/dto/request/FireFindRequest.java @@ -54,4 +54,16 @@ public class FireFindRequest implements Serializable { */ @ApiModelProperty(value = "案发地址") private String afdz; + + /** + * 前端选择框 1查询ai120Id不为空的 2查询ai120Id为空的 + */ + @ApiModelProperty(value = "前端选择框 1查询ai120Id不为空的 2查询ai120Id为空的") + private Integer select120; + + /** + * 前端选择框 1查询ai110Id不为空的 2查询ai110Id为空的 + */ + @ApiModelProperty(value = "前端选择框 1查询ai110Id不为空的 2查询ai110Id为空的") + private Integer select110; } diff --git a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/impl/FireServiceImpl.java b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/impl/FireServiceImpl.java index b09139c..70201f8 100644 --- a/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/impl/FireServiceImpl.java +++ b/RuoYi-Vue/ruoyi-admin/src/main/java/com/ruoyi/page/service/impl/FireServiceImpl.java @@ -35,7 +35,26 @@ public class FireServiceImpl extends ServiceImpl implements Fi .like(StrUtil.isNotEmpty(fire.getAjms()), "ajms", fire.getAjms()) .like(StrUtil.isNotEmpty(fire.getAfdz()), "afdz", fire.getAfdz()) .orderByDesc("create_time"); + addCondition(fire.getSelect110(), "ai_110_id", wrapper); + addCondition(fire.getSelect120(), "ai_120_id", wrapper); return this.page(page, wrapper); } + + /** + * 判断拼接wrapper + * + * @param key 传值 + * @param selectKey 查询字段 + * @param wrapper wrapper + */ + private void addCondition(Integer key, String selectKey, QueryWrapper wrapper) { + if (key != null) { + if (key == 1) { + wrapper.and(wq -> wq.isNotNull(selectKey).and(q -> q.ne(selectKey, ""))); + } else if (key == 2) { + wrapper.and(wq -> wq.isNull(selectKey).or(q -> q.eq(selectKey, ""))); + } + } + } } diff --git a/RuoYi-Vue/ruoyi-system/src/main/resources/mapper/page/AlarmMapper.xml b/RuoYi-Vue/ruoyi-system/src/main/resources/mapper/page/AlarmMapper.xml index 6e2350e..081e92f 100644 --- a/RuoYi-Vue/ruoyi-system/src/main/resources/mapper/page/AlarmMapper.xml +++ b/RuoYi-Vue/ruoyi-system/src/main/resources/mapper/page/AlarmMapper.xml @@ -165,12 +165,20 @@ and ai_num <= #{req.aiNumMax} - + and ai_120_id is not null and ai_120_id != '' - + and ai_120_id is null or ai_120_id = '' + + + and ai_119_id is not null and ai_119_id != '' + + + and ai_119_id is null or ai_119_id = '' + + order by update_time desc diff --git a/RuoYi-Vue/ruoyi-system/src/main/resources/mapper/page/EventMapper.xml b/RuoYi-Vue/ruoyi-system/src/main/resources/mapper/page/EventMapper.xml index 518d896..0ce69ce 100644 --- a/RuoYi-Vue/ruoyi-system/src/main/resources/mapper/page/EventMapper.xml +++ b/RuoYi-Vue/ruoyi-system/src/main/resources/mapper/page/EventMapper.xml @@ -105,12 +105,19 @@ AND alarm_unit_telephone LIKE CONCAT('%', #{event.alarmUnitTelephone}, '%') - + and ai_110_id is not null and ai_110_id != '' - + and ai_110_id is null or ai_110_id = '' + + + and ai_119_id is not null and ai_119_id != '' + + + and ai_119_id is null or ai_119_id = '' + order by event_date_time desc diff --git a/alarm/src/main/resources/application-dev.yml b/alarm/src/main/resources/application-dev.yml index aaa5063..39bad05 100644 --- a/alarm/src/main/resources/application-dev.yml +++ b/alarm/src/main/resources/application-dev.yml @@ -3,7 +3,7 @@ spring: datasource: url: jdbc:mysql://localhost:3306/algorithms?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: root - password: jichuang@123 + password: 123456 driverClassName: com.mysql.cj.jdbc.Driver diff --git a/page/src/main/java/com/yingji/service/impl/FireServiceImpl.java b/page/src/main/java/com/yingji/service/impl/FireServiceImpl.java index eb40c79..60d0214 100644 --- a/page/src/main/java/com/yingji/service/impl/FireServiceImpl.java +++ b/page/src/main/java/com/yingji/service/impl/FireServiceImpl.java @@ -1,6 +1,7 @@ package com.yingji.service.impl; import cn.hutool.core.util.StrUtil; +import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -28,13 +29,21 @@ public class FireServiceImpl extends ServiceImpl implements Fi */ @Override public Page page(Page page, FireFindRequest fire) { + log.error("==================119入参开始====================="); + log.error("==================119每页显示条数: " + page.getSize() + "页数: " + page.getCurrent() + "====================="); + log.error(JSONUtil.toJsonStr(fire)); + log.error("==================119入参结束====================="); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.like(StrUtil.isNotEmpty(fire.getAjbh()), "ajbh", fire.getAjbh()) .ge(fire.getStartTime() != null, "create_time", fire.getStartTime()) .le(fire.getEndTime() != null, "create_time", fire.getEndTime()) .like(StrUtil.isNotEmpty(fire.getAjms()), "ajms", fire.getAjms()) .like(StrUtil.isNotEmpty(fire.getAfdz()), "afdz", fire.getAfdz()); - return this.page(page, wrapper); + Page firePage = this.page(page, wrapper); + log.error("==================119响应开始====================="); + log.error(JSONUtil.toJsonStr(firePage)); + log.error("==================119响应结束====================="); + return firePage; } }