|
|
@@ -32,6 +32,37 @@
|
|
|
</if>
|
|
|
and w.shelf_status = 1 order by w.start_time asc;
|
|
|
</select>
|
|
|
+ <select id="selectRecentThreeVoyages"
|
|
|
+ resultType="com.yc.ship.module.product.dal.dataobject.voyage.VoyageDO">
|
|
|
+ SELECT voyage.*
|
|
|
+ FROM (
|
|
|
+ (SELECT previous_voyage.*
|
|
|
+ FROM product_voyage previous_voyage
|
|
|
+ WHERE previous_voyage.ship_id = #{shipId}
|
|
|
+ AND previous_voyage.deleted = 0
|
|
|
+ AND previous_voyage.leave_time < NOW()
|
|
|
+ ORDER BY previous_voyage.start_time DESC
|
|
|
+ LIMIT 1)
|
|
|
+ UNION ALL
|
|
|
+ (SELECT current_voyage.*
|
|
|
+ FROM product_voyage current_voyage
|
|
|
+ WHERE current_voyage.ship_id = #{shipId}
|
|
|
+ AND current_voyage.deleted = 0
|
|
|
+ AND current_voyage.start_time <= NOW()
|
|
|
+ AND current_voyage.leave_time >= NOW()
|
|
|
+ ORDER BY current_voyage.start_time DESC
|
|
|
+ LIMIT 1)
|
|
|
+ UNION ALL
|
|
|
+ (SELECT next_voyage.*
|
|
|
+ FROM product_voyage next_voyage
|
|
|
+ WHERE next_voyage.ship_id = #{shipId}
|
|
|
+ AND next_voyage.deleted = 0
|
|
|
+ AND next_voyage.start_time > NOW()
|
|
|
+ ORDER BY next_voyage.start_time ASC
|
|
|
+ LIMIT 1)
|
|
|
+ ) voyage
|
|
|
+ ORDER BY voyage.start_time ASC
|
|
|
+ </select>
|
|
|
<select id="selectVoyageListByShipIdAndDate"
|
|
|
resultType="com.yc.ship.module.product.controller.app.voyage.vo.AppVoyageDayRespVO">
|
|
|
select w.id voyage_id, w.name as voyage_name,
|
|
|
@@ -219,4 +250,4 @@
|
|
|
where DATE_FORMAT(td.travel_date, '%Y-%m-%d') = DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL (-#{day}) DAY), '%Y-%m-%d')
|
|
|
and td.deleted='0' and td.order_status in (0,1,2,3,6,7,8,9,12,13,14,15) and rr.direction = #{direction}
|
|
|
</select>
|
|
|
-</mapper>
|
|
|
+</mapper>
|