|
@@ -22,24 +22,6 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
- <select id="selectFreeRoomList" resultType="com.yc.ship.module.resource.dal.dataobject.room.ResourceRoomDO">
|
|
|
|
|
- select t1.id as id,
|
|
|
|
|
- t1.room_num as roomNum,
|
|
|
|
|
- t1.room_model_id as roomModelId,
|
|
|
|
|
- t1.floors as floors,
|
|
|
|
|
- group_concat(t3.gender separator ',') as genders,
|
|
|
|
|
- count(t3.id) as count
|
|
|
|
|
- from resource_room t1
|
|
|
|
|
- left join (select tv.* from trade_visitor tv
|
|
|
|
|
- join trade_order to1 on tv.order_id = to1.id where to1.voyage_id = #{voyageId}) t3
|
|
|
|
|
- on if(t3.final_room_id is null,t3.init_room_id,t3.final_room_id)= t1.id
|
|
|
|
|
- where t1.ship_id = (select ship_id from product_voyage where id=#{voyageId})
|
|
|
|
|
- <if test="roomId!=null" >and t1.id=#{roomId}</if>
|
|
|
|
|
- group by t1.id, t1.room_num, t1.room_model_id, t1.floors having count(t3.id)<2
|
|
|
|
|
- ORDER BY t1.room_num
|
|
|
|
|
- </select>
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
<select id="selectAllByShipIdAndFloors"
|
|
<select id="selectAllByShipIdAndFloors"
|
|
|
resultType="com.yc.ship.module.resource.controller.admin.room.vo.ResourceRoomRespVO">
|
|
resultType="com.yc.ship.module.resource.controller.admin.room.vo.ResourceRoomRespVO">
|
|
|
select t1.id as id,
|
|
select t1.id as id,
|
|
@@ -64,20 +46,37 @@
|
|
|
from trade_visitor tv
|
|
from trade_visitor tv
|
|
|
join trade_order to1 on tv.order_id = to1.id
|
|
join trade_order to1 on tv.order_id = to1.id
|
|
|
where to1.voyage_id = #{voyageId}) t3
|
|
where to1.voyage_id = #{voyageId}) t3
|
|
|
- on (t1.id = t3.final_room_id or t1.id = t3.init_room_id)
|
|
|
|
|
- on if(t3.final_room_id is null,t3.init_room_id,t3.final_room_id)= t1.id
|
|
|
|
|
|
|
+ on if(t3.final_room_id is null,t3.init_room_id,t3.final_room_id)= t1.id
|
|
|
left join buss_room_status t5 on t1.id = t5.room_id and t5.voyage_id= #{voyageId}
|
|
left join buss_room_status t5 on t1.id = t5.room_id and t5.voyage_id= #{voyageId}
|
|
|
where t1.ship_id = #{shipId}
|
|
where t1.ship_id = #{shipId}
|
|
|
and t1.deleted = 0
|
|
and t1.deleted = 0
|
|
|
and t1.floors = #{floors}
|
|
and t1.floors = #{floors}
|
|
|
group by t1.id, t1.room_num, t1.ship_id, t1.room_model_id, t2.name, t1.floors ,CASE
|
|
group by t1.id, t1.room_num, t1.ship_id, t1.room_model_id, t2.name, t1.floors ,CASE
|
|
|
- WHEN t5.status IS NULL THEN
|
|
|
|
|
- CASE
|
|
|
|
|
- WHEN t3.name IS NOT NULL THEN 3
|
|
|
|
|
- ELSE 0
|
|
|
|
|
- END
|
|
|
|
|
- ELSE t5.status
|
|
|
|
|
- END
|
|
|
|
|
|
|
+ WHEN t5.status IS NULL THEN
|
|
|
|
|
+ CASE
|
|
|
|
|
+ WHEN t3.name IS NOT NULL THEN 3
|
|
|
|
|
+ ELSE 0
|
|
|
|
|
+ END
|
|
|
|
|
+ ELSE t5.status
|
|
|
|
|
+ END
|
|
|
order by t1.room_num
|
|
order by t1.room_num
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectFreeRoomList" resultType="com.yc.ship.module.resource.dal.dataobject.room.ResourceRoomDO">
|
|
|
|
|
+ select t1.id as id,
|
|
|
|
|
+ t1.room_num as roomNum,
|
|
|
|
|
+ t1.room_model_id as roomModelId,
|
|
|
|
|
+ t1.floors as floors,
|
|
|
|
|
+ group_concat(t3.gender separator ',') as genders,
|
|
|
|
|
+ count(t3.id) as count
|
|
|
|
|
+ from resource_room t1
|
|
|
|
|
+ left join (select tv.* from trade_visitor tv
|
|
|
|
|
+ join trade_order to1 on tv.order_id = to1.id where to1.voyage_id = #{voyageId}) t3
|
|
|
|
|
+ on if(t3.final_room_id is null,t3.init_room_id,t3.final_room_id)= t1.id
|
|
|
|
|
+ where t1.ship_id = (select ship_id from product_voyage where id=#{voyageId})
|
|
|
|
|
+ <if test="roomId!=null" >and t1.id=#{roomId}</if>
|
|
|
|
|
+
|
|
|
|
|
+ group by t1.id, t1.room_num, t1.room_model_id, t1.floors having count(t3.id)<2
|
|
|
|
|
+ ORDER BY t1.room_num
|
|
|
|
|
+ </select>
|
|
|
</mapper>
|
|
</mapper>
|