Browse Source

首页感知事件接口更换

develop
wangsixiang 9 months ago
parent
commit
b54cbc005f
  1. 20
      zc-business/src/main/java/com/zc/business/domain/DcWarning.java
  2. 11
      zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java
  3. 9
      zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml
  4. 6
      zc-business/src/main/resources/mapper/business/DcRoadSectionMapper.xml

20
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 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() { public String getUserName() {
return userName; return userName;
} }

11
zc-business/src/main/java/com/zc/business/service/impl/DcPerceivedEventsWarningServiceImpl.java

@ -1,6 +1,8 @@
package com.zc.business.service.impl; package com.zc.business.service.impl;
import com.ruoyi.common.utils.DateUtils; 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.DcEventType;
import com.zc.business.domain.DcWarning; import com.zc.business.domain.DcWarning;
import com.zc.business.mapper.DcPerceivedEventsWarningMapper; import com.zc.business.mapper.DcPerceivedEventsWarningMapper;
@ -46,6 +48,15 @@ public class DcPerceivedEventsWarningServiceImpl implements IDCPerceivedEventsWa
//根据类型查询预计事件 //根据类型查询预计事件
@Override @Override
public List<DcWarning> selectPerceivedEventsList(DcWarning dcWarning) { public List<DcWarning> 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); return perceivedEventsWarningMapper.selectPerceivedEventsList(dcWarning);
} }

9
zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml

@ -45,6 +45,15 @@
<if test="stakeMark != null and stakeMark != ''"> and warning.stake_mark = #{stakeMark}</if> <if test="stakeMark != null and stakeMark != ''"> and warning.stake_mark = #{stakeMark}</if>
<if test="startTime != null and completeTime != null "> <if test="startTime != null and completeTime != null ">
and warning.warning_time between #{startTime} and #{completeTime}</if> and warning.warning_time between #{startTime} and #{completeTime}</if>
<if test="startStakeMark != null and startStakeMark != ''">
and CAST(SUBSTRING(SUBSTRING_INDEX(warning.stake_mark,'+',1),2)AS UNSIGNED)*1000
+CAST(SUBSTRING_INDEX(warning.stake_mark, '+', -1) AS UNSIGNED)&gt;#{startStakeMark}
</if>
<if test=" endStakeMark != null and endStakeMark != '' ">
and CAST(SUBSTRING(SUBSTRING_INDEX(warning.stake_mark,'+',1),2)AS UNSIGNED)*1000
+CAST(SUBSTRING_INDEX(warning.stake_mark, '+', -1) AS UNSIGNED)&lt;#{endStakeMark}
</if>
</where> </where>
order by warning.warning_time desc order by warning.warning_time desc
</select> </select>

6
zc-business/src/main/resources/mapper/business/DcRoadSectionMapper.xml

@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="roadId != null "> and section.road_id = #{roadId}</if> <if test="roadId != null "> and section.road_id = #{roadId}</if>
<if test="startStakeMark != null and startStakeMark != '' <if test="startStakeMark != null and startStakeMark != ''
and endStakeMark != null and endStakeMark != ''"> and endStakeMark != null and endStakeMark != ''">
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)&gt;#{startStakeMark} +CAST(SUBSTRING_INDEX(start_stake_mark, '+', -1) AS UNSIGNED)&gt;#{startStakeMark}
and and
CAST(SUBSTRING(SUBSTRING_INDEX(end_stake_mark,'+',1),2)AS UNSIGNED)*1000 CAST(SUBSTRING(SUBSTRING_INDEX(end_stake_mark,'+',1),2)AS UNSIGNED)*1000
@ -44,12 +44,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
<if test="startStakeMark != null and startStakeMark != '' <if test="startStakeMark != null and startStakeMark != ''
and endStakeMark == null "> and endStakeMark == null ">
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)&gt;#{startStakeMark} +CAST(SUBSTRING_INDEX(start_stake_mark, '+', -1) AS UNSIGNED)&gt;#{startStakeMark}
</if> </if>
<if test=" endStakeMark != null and endStakeMark != '' <if test=" endStakeMark != null and endStakeMark != ''
and startStakeMark == null "> and startStakeMark == null ">
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)&lt;#{endStakeMark} +CAST(SUBSTRING_INDEX(end_stake_mark, '+', -1) AS UNSIGNED)&lt;#{endStakeMark}
</if> </if>
<if test="sectionName != null and sectionName != ''"> and section.section_name like concat('%', #{sectionName}, '%')</if> <if test="sectionName != null and sectionName != ''"> and section.section_name like concat('%', #{sectionName}, '%')</if>

Loading…
Cancel
Save