From b54cbc005f7b6b08b90bfda89d05c05d32f98581 Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Wed, 13 Mar 2024 17:26:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=84=9F=E7=9F=A5=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E6=8E=A5=E5=8F=A3=E6=9B=B4=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/domain/DcWarning.java | 20 +++++++++++++++++++ .../DcPerceivedEventsWarningServiceImpl.java | 11 ++++++++++ .../DcPerceivedEventsWarningMapper.xml | 9 +++++++++ .../mapper/business/DcRoadSectionMapper.xml | 6 +++--- 4 files changed, 43 insertions(+), 3 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/domain/DcWarning.java b/zc-business/src/main/java/com/zc/business/domain/DcWarning.java index 216588f9..970ee88d 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcWarning.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcWarning.java @@ -112,6 +112,26 @@ public class DcWarning extends BaseEntity //操作员 private String userName; + //范围查询参数 + private String startStakeMark; + private String endStakeMark; + + public String getStartStakeMark() { + return startStakeMark; + } + + public void setStartStakeMark(String startStakeMark) { + this.startStakeMark = startStakeMark; + } + + public String getEndStakeMark() { + return endStakeMark; + } + + public void setEndStakeMark(String endStakeMark) { + this.endStakeMark = endStakeMark; + } + public String getUserName() { return userName; } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java index 90838bf0..ce580bea 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java @@ -1,6 +1,8 @@ package com.zc.business.service.impl; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.common.utils.StakeMarkUtils; +import com.ruoyi.common.utils.StringUtils; import com.zc.business.domain.DcEventType; import com.zc.business.domain.DcWarning; import com.zc.business.mapper.DcPerceivedEventsWarningMapper; @@ -46,6 +48,15 @@ public class DcPerceivedEventsWarningServiceImpl implements IDCPerceivedEventsWa //根据类型查询预计事件 @Override public List selectPerceivedEventsList(DcWarning dcWarning) { + if (StringUtils.isNotEmpty(dcWarning.getStartStakeMark())){ + String startStakeMark = StakeMarkUtils.formatMetre(dcWarning.getStartStakeMark()); + dcWarning.setStartStakeMark(startStakeMark); + } + + if (StringUtils.isNotEmpty(dcWarning.getEndStakeMark())){ + String endStakeMark = StakeMarkUtils.formatMetre(dcWarning.getEndStakeMark()); + dcWarning.setEndStakeMark(endStakeMark); + } return perceivedEventsWarningMapper.selectPerceivedEventsList(dcWarning); } diff --git a/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml b/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml index 5f9d3df1..8d0860c5 100644 --- a/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml @@ -45,6 +45,15 @@ and warning.stake_mark = #{stakeMark} and warning.warning_time between #{startTime} and #{completeTime} + + and CAST(SUBSTRING(SUBSTRING_INDEX(warning.stake_mark,'+',1),2)AS UNSIGNED)*1000 + +CAST(SUBSTRING_INDEX(warning.stake_mark, '+', -1) AS UNSIGNED)>#{startStakeMark} + + + and CAST(SUBSTRING(SUBSTRING_INDEX(warning.stake_mark,'+',1),2)AS UNSIGNED)*1000 + +CAST(SUBSTRING_INDEX(warning.stake_mark, '+', -1) AS UNSIGNED)<#{endStakeMark} + + order by warning.warning_time desc diff --git a/zc-business/src/main/resources/mapper/business/DcRoadSectionMapper.xml b/zc-business/src/main/resources/mapper/business/DcRoadSectionMapper.xml index 6d75acd9..aa4eab64 100644 --- a/zc-business/src/main/resources/mapper/business/DcRoadSectionMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcRoadSectionMapper.xml @@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and section.road_id = #{roadId} - CAST(SUBSTRING(SUBSTRING_INDEX(start_stake_mark,'+',1),2)AS UNSIGNED)*1000 + and CAST(SUBSTRING(SUBSTRING_INDEX(start_stake_mark,'+',1),2)AS UNSIGNED)*1000 +CAST(SUBSTRING_INDEX(start_stake_mark, '+', -1) AS UNSIGNED)>#{startStakeMark} and CAST(SUBSTRING(SUBSTRING_INDEX(end_stake_mark,'+',1),2)AS UNSIGNED)*1000 @@ -44,12 +44,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - CAST(SUBSTRING(SUBSTRING_INDEX(start_stake_mark,'+',1),2)AS UNSIGNED)*1000 + and CAST(SUBSTRING(SUBSTRING_INDEX(start_stake_mark,'+',1),2)AS UNSIGNED)*1000 +CAST(SUBSTRING_INDEX(start_stake_mark, '+', -1) AS UNSIGNED)>#{startStakeMark} - CAST(SUBSTRING(SUBSTRING_INDEX(end_stake_mark,'+',1),2)AS UNSIGNED)*1000 + and CAST(SUBSTRING(SUBSTRING_INDEX(end_stake_mark,'+',1),2)AS UNSIGNED)*1000 +CAST(SUBSTRING_INDEX(end_stake_mark, '+', -1) AS UNSIGNED)<#{endStakeMark} and section.section_name like concat('%', #{sectionName}, '%')