|
|
@@ -20,4 +20,22 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</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>
|