浏览代码

app查询所有任务-去掉拒单后重新派给其他人情况

yuejiaying 4 年之前
父节点
当前提交
ec65d38197
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 5 3
      operation_manager/src/main/resources/mapper/order/WorkOrderManageMapper.xml

+ 5 - 3
operation_manager/src/main/resources/mapper/order/WorkOrderManageMapper.xml

@@ -515,11 +515,13 @@
     order by send_time desc
   </select>
   <select id="selectAppAll" resultMap="BaseResultMap">
-    select id,task_no,send_time,address,order_type_id,current_task_name,create_by,update_by,task_desc,order_status
-    from sc_work_order_manage
+    select distinct t1.id,task_no,send_time,address,order_type_id,current_task_name,t1.create_by,t1.update_by,task_desc,order_status
+    from sc_work_order_manage t1
+    left join sc_work_flow_log t2 ON t1.id=t2.flow_id and flow_type=2 and find_in_set(#{userId},handle_user_id) and left(flow_result,2)='拒单'
     where (find_in_set(#{userId},current_users)
-     or id in(select flow_id from sc_work_flow_log where flow_type=2 and find_in_set(#{userId},handle_user_id)))
+     or t1.id in(select flow_id from sc_work_flow_log where flow_type=2 and find_in_set(#{userId},handle_user_id)))
      and tenant_id = #{tenantId}
+     and (t2.id is null or t1.order_user_id=t2.handle_user_id)
     union
     select id,plan_id,plan_date,task_area_name,task_type,current_task_name,create_by,update_by,task_content,plan_status
     from sc_plan_manage