|
@@ -21,13 +21,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<select id="customPageList" resultType="org.dromara.hotel.domain.vo.KfGuestVo">
|
|
<select id="customPageList" resultType="org.dromara.hotel.domain.vo.KfGuestVo">
|
|
|
- select g.*,
|
|
|
|
|
- (CASE o.order_status WHEN '1' THEN '已预定' WHEN '3' THEN '已入住' else '未入住' END) AS checkInStatus
|
|
|
|
|
- from t_kf_guest_team_r tgr
|
|
|
|
|
- left join t_kf_guest g on tgr.guest_id = g.id
|
|
|
|
|
- left join t_kf_order o on g.id = o.guest_id
|
|
|
|
|
|
|
+ select g.*,'未入住' AS checkInStatus
|
|
|
|
|
+ from t_kf_guest g
|
|
|
|
|
+ left join t_kf_guest_team_r tgr on tgr.guest_id = g.id
|
|
|
<where>
|
|
<where>
|
|
|
- tgr.del_flag = '0' and (o.order_status not in ('1','3') or o.order_status is null)
|
|
|
|
|
|
|
+ tgr.del_flag = '0' and g.del_flag = '0'
|
|
|
|
|
+ AND g."id" NOT IN (
|
|
|
|
|
+ SELECT "guest_id" FROM "t_kf_order" WHERE team_id = #{bo.teamId} AND order_status in ('1','3'))
|
|
|
<if test="bo.teamId != null">
|
|
<if test="bo.teamId != null">
|
|
|
and tgr.team_id = #{bo.teamId}
|
|
and tgr.team_id = #{bo.teamId}
|
|
|
</if>
|
|
</if>
|