|
@@ -38,4 +38,46 @@
|
|
|
group by t1.id, t1.room_num, t1.room_model_id, t1.floors having count(t3.id)<2
|
|
group by t1.id, t1.room_num, t1.room_model_id, t1.floors having count(t3.id)<2
|
|
|
ORDER BY t1.room_num
|
|
ORDER BY t1.room_num
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectAllByShipIdAndFloors"
|
|
|
|
|
+ resultType="com.yc.ship.module.resource.controller.admin.room.vo.ResourceRoomRespVO">
|
|
|
|
|
+ select t1.id as id,
|
|
|
|
|
+ t1.room_num as roomNum,
|
|
|
|
|
+ t1.ship_id as shipId,
|
|
|
|
|
+ t1.room_model_id as roomModelId,
|
|
|
|
|
+ t2.name as roomModelName,
|
|
|
|
|
+ t1.floors as floors,
|
|
|
|
|
+ CASE
|
|
|
|
|
+ WHEN t5.status IS NULL THEN
|
|
|
|
|
+ CASE
|
|
|
|
|
+ WHEN t3.name IS NOT NULL THEN 3
|
|
|
|
|
+ ELSE 0
|
|
|
|
|
+ END
|
|
|
|
|
+ ELSE t5.status
|
|
|
|
|
+ END as status,
|
|
|
|
|
+ group_concat(concat(t3.name,'-',coalesce(t3.nationality,''),'-',coalesce(t3.mobile,'')) separator ',') as visitorName
|
|
|
|
|
+
|
|
|
|
|
+ from resource_room t1
|
|
|
|
|
+ left join resource_room_model t2 on t1.room_model_id = t2.id
|
|
|
|
|
+ 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 (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
|
|
|
|
|
+ left join buss_room_status t5 on t1.id = t5.room_id and t5.voyage_id= #{voyageId}
|
|
|
|
|
+ where t1.ship_id = #{shipId}
|
|
|
|
|
+ and t1.deleted = 0
|
|
|
|
|
+ and t1.floors = #{floors}
|
|
|
|
|
+ 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
|
|
|
|
|
+ order by t1.room_num
|
|
|
|
|
+ </select>
|
|
|
</mapper>
|
|
</mapper>
|