Browse Source

fix:巡视任务支持任务名称和区域名称同时搜索

master
yinhuaiwei 12 hours ago
parent
commit
8aa8d7f739
1 changed files with 6 additions and 16 deletions
  1. +6
    -16
      inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolTaskStatusMapper.xml

+ 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