3 Commits

2 changed files with 22 additions and 31 deletions
Unified View
  1. +16
    -15
      inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java
  2. +6
    -16
      inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolTaskStatusMapper.xml

+ 16
- 15
inspect-main/inspect-main-task/src/main/java/com/inspect/task/controller/PatrolTaskController.java View File

@ -421,28 +421,29 @@ public class PatrolTaskController extends BaseController {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }
// 生产设备 模糊匹配
if (StringUtils.isNotEmpty(patrolTaskStatus.getDeviceName())) { if (StringUtils.isNotEmpty(patrolTaskStatus.getDeviceName())) {
newList = newList.stream().filter((element) -> {
return patrolTaskStatus.getDeviceName().equals(element.getDeviceName());
}).collect(Collectors.toList());
newList = newList.stream().filter((element) ->
element.getDeviceName().contains(patrolTaskStatus.getDeviceName())
).collect(Collectors.toList());
} }
// 点位名称 模糊匹配
if (StringUtils.isNotEmpty(patrolTaskStatus.getPointName())) { if (StringUtils.isNotEmpty(patrolTaskStatus.getPointName())) {
newList = newList.stream().filter((element) -> {
return patrolTaskStatus.getPointName().equals(element.getPointName());
}).collect(Collectors.toList());
newList = newList.stream().filter((element) ->
element.getPointName().contains(patrolTaskStatus.getPointName())
).collect(Collectors.toList());
} }
// 相机名称 模糊匹配
if (StringUtils.isNotEmpty(patrolTaskStatus.getChannelName())) { if (StringUtils.isNotEmpty(patrolTaskStatus.getChannelName())) {
newList = newList.stream().filter((element) -> {
return patrolTaskStatus.getChannelName().equals(element.getChannelName());
}).collect(Collectors.toList());
newList = newList.stream().filter((element) ->
element.getChannelName().contains(patrolTaskStatus.getChannelName())
).collect(Collectors.toList());
} }
// 来源系统 模糊匹配
if (StringUtils.isNotEmpty(patrolTaskStatus.getDeviceSource())) { if (StringUtils.isNotEmpty(patrolTaskStatus.getDeviceSource())) {
newList = newList.stream().filter((element) -> {
return patrolTaskStatus.getDeviceSource().equals(element.getDeviceSource());
}).collect(Collectors.toList());
newList = newList.stream().filter((element) ->
element.getDeviceSource().contains(patrolTaskStatus.getDeviceSource())
).collect(Collectors.toList());
} }
if (StringUtils.isNotEmpty(patrolTaskStatus.getPointStatus())) { if (StringUtils.isNotEmpty(patrolTaskStatus.getPointStatus())) {


+ 6
- 16
inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolTaskStatusMapper.xml View File

@ -84,22 +84,12 @@
<where> <where>
<if test="taskPatrolledId != null and taskPatrolledId != ''">and a.task_patrolled_id = #{taskPatrolledId} <if test="taskPatrolledId != null and taskPatrolledId != ''">and a.task_patrolled_id = #{taskPatrolledId}
</if> </if>
<choose>
<!-- 当taskName和areaTaskName都有值时 -->
<when test="taskName != null and taskName != '' and areaTaskName != null and areaTaskName != ''">
and (a.task_name like concat('%', #{taskName}, '%')
or a.task_name like concat('%', #{areaTaskName}, '%'))
</when>
<otherwise>
<!-- 只有一个参数有值时 -->
<if test="taskName != null and taskName != ''">
and a.task_name like concat('%', #{taskName}, '%')
</if>
<if test="areaTaskName != null and areaTaskName != ''">
and a.task_name like concat('%', #{areaTaskName}, '%')
</if>
</otherwise>
</choose>
<if test="taskName != null and taskName != ''">
and a.task_name like concat('%', #{taskName}, '%')
</if>
<if test="areaTaskName != null and areaTaskName != ''">
and a.area_name like concat('%', #{areaTaskName}, '%')
</if>
<if test="taskCode != null and taskCode != ''">and a.task_code = #{taskCode}</if> <if test="taskCode != null and taskCode != ''">and a.task_code = #{taskCode}</if>
<if test="taskState != null and taskState != ''">and a.task_state = #{taskState}</if> <if test="taskState != null and taskState != ''">and a.task_state = #{taskState}</if>
<if test="planStartTime != null ">and a.plan_start_time = #{planStartTime}</if> <if test="planStartTime != null ">and a.plan_start_time = #{planStartTime}</if>


Loading…
Cancel
Save