|
@@ -1179,4 +1179,23 @@
|
|
|
)a ) b
|
|
|
group by duration
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="selectByTime" resultMap="BaseResultMap">
|
|
|
+ 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,in_process_status,t1.plan_finish_date,t1.finish_date,t1.date_create,t1.date_limit
|
|
|
+ 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 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)
|
|
|
+ and t1.date_create between #{startTime} and #{endTime}
|
|
|
+ union
|
|
|
+ select id,plan_id,plan_date,task_area_name,task_type,current_task_name,create_by,update_by,task_content,plan_status,in_process_status,plan_end_date,finish_date,date_create,"0"
|
|
|
+ from sc_plan_manage
|
|
|
+ where (find_in_set(#{userId},current_users)
|
|
|
+ or id in(select flow_id from sc_work_flow_log where flow_type=1 and find_in_set(#{userId},handle_user_id)))
|
|
|
+ and tenant_id = #{tenantId}
|
|
|
+ and date_create between #{startTime} and #{endTime}
|
|
|
+ order by send_time desc
|
|
|
+ </select>
|
|
|
</mapper>
|