Commit 5b73376f authored by 周健威's avatar 周健威

Merge branch 'master-arrival-bug' into dev

parents ce03b87a 1fe8b08f
......@@ -992,8 +992,12 @@
from
<!--
查询开始时间 前面的最后一条 预约记录
查询结束时间 后面的第一条 预约记录 -->
(select vehicle_id, max(if(book_end_date &lt; #{startDateExtend}, book_end_date, null)) as max_book_end_date, min(if(book_start_date &gt; #{endDateExtend}, book_start_date, null)) as min_book_start_date from vehicle_book_record where status != 4 and status != 6 group by vehicle_id) sevbr
查询结束时间 后面的第一条 预约记录
添加比较actual_start_date 和 actual_end_date-->
(select vehicle_id
, max(if(IFNULL(actual_end_date, book_end_date) &lt; #{startDateExtend}, IFNULL(actual_end_date,book_end_date), null)) as max_book_end_date
, min(if(IFNULL(actual_start_date, book_start_date) &gt; #{endDateExtend}, IFNULL(actual_start_date, book_start_date), null)) as min_book_start_date
from vehicle_book_record where status != 4 and status != 6 group by vehicle_id) sevbr
left join vehicle_book_record vbre
on sevbr.vehicle_id = vbre.vehicle_id and sevbr.max_book_end_date = vbre.book_end_date and vbre.status != 4 and vbre.status != 6
left join vehicle_book_record vbrs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment