|
|
@@ -30,15 +30,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="selectPageByBo" resultType="org.dromara.hotel.domain.vo.KfOrderVo">
|
|
|
select
|
|
|
- o.id,o.guest_id,g.name as guestName,o.team_id,o.team_name,o.room_code,o.room_name,o.start_time,o.end_time
|
|
|
- ,o.order_status,o.plan_money,o.actual_money,o.remark,g.phone,g.sex,g.id_card as idCard from t_kf_order o
|
|
|
- left join
|
|
|
- t_kf_guest g on o.guest_id = g.id
|
|
|
+ o.id,o.guest_id,g.name as guestName,o.team_id,o.team_name,o.room_code,o.room_name,o.start_time
|
|
|
+ ,o.end_time, o.order_status,o.plan_money,o.actual_money,o.remark,g.phone,g.sex,g.id_card as idCard,
|
|
|
+ rt.room_type_name as guestRoomType, rt.bed_number as bedQuantity, o.order_index as orderIndex
|
|
|
+ from t_kf_order o
|
|
|
+ left join t_kf_guest g on o.guest_id = g.id
|
|
|
+ left join t_pt_room r on r.room_code = o.room_code
|
|
|
+ left join t_pt_room_type rt on r.guest_room_type = rt.room_type_id
|
|
|
<where>
|
|
|
o.del_flag = '0'
|
|
|
<if test="bo.guestName != null and bo.guestName != ''">
|
|
|
and g.name like concat('%', #{bo.guestName}, '%')
|
|
|
</if>
|
|
|
+ <if test="bo.teamId != null and bo.teamId != ''">
|
|
|
+ and o.team_id = #{bo.teamId}
|
|
|
+ </if>
|
|
|
+
|
|
|
<if test="bo.teamName != null and bo.teamName != ''">
|
|
|
and o.team_name like concat('%', #{bo.teamName}, '%')
|
|
|
</if>
|
|
|
@@ -57,23 +64,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="bo.orderType != null and bo.orderType != ''">
|
|
|
and o.order_type = #{bo.orderType}
|
|
|
</if>
|
|
|
- order by o.create_time desc
|
|
|
+ order by o.order_index asc, o.create_time desc
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
<select id="queryListByGuestName" resultType="org.dromara.hotel.domain.vo.KfOrderVo">
|
|
|
- select g.id as guestId,
|
|
|
- concat_ws(' | ',g.name, g.phone, g.id_card, CASE o.order_status
|
|
|
- WHEN '1' THEN '当前已预定'
|
|
|
- WHEN '3' THEN '当前已入住'
|
|
|
- else ''
|
|
|
- END) AS guestName
|
|
|
+ select g.id as guestId, g.name as guestName,
|
|
|
+ concat('姓名: ',g.name,' | 手机号: ',g.phone, ' | '
|
|
|
+ , CASE o.order_status WHEN '1' THEN '当前已预定' WHEN '3' THEN '当前已入住' else '' END
|
|
|
+ ) AS phone
|
|
|
from t_kf_guest g left join t_kf_order o on g.id = o.guest_id and o.order_status in ('1','3')
|
|
|
<where>
|
|
|
g.del_flag = '0'
|
|
|
- and g.name like concat('%', #{guestName}, '%')
|
|
|
+ <if test="guestName != null and guestName != ''">
|
|
|
+ and g.name like concat('%', #{guestName}, '%')
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="queryTeamGuest" resultType="org.dromara.hotel.domain.vo.KfOrderVo">
|
|
|
+ select g.id as guestId, g.name as guestName,
|
|
|
+ concat('姓名: ',g.name,' | 手机号: ',g.phone, ' | '
|
|
|
+ , CASE o.order_status WHEN '1' THEN '当前已预定' WHEN '3' THEN '当前已入住' else '' END
|
|
|
+ ) AS phone
|
|
|
+ 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 and o.order_status in ('1','3')
|
|
|
+ <where>
|
|
|
+ tgr.del_flag = '0'
|
|
|
+ <if test="teamId != null">
|
|
|
+ and tgr.team_id = #{teamId}
|
|
|
+ </if>
|
|
|
+ <if test="guestName != null">
|
|
|
+ and g.name like concat('%', #{guestName}, '%')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectByBo" resultType="org.dromara.hotel.api.domain.vo.RemoteOrderVo">
|
|
|
SELECT tkg.id AS guestId, tkg.name, tkg.sex, tkg.id_card AS idCard, tkg.phone, tkg.other_id AS otherId, tkgtr.team_id AS teamId,
|
|
|
tko.room_code AS roomCode, tpr.room_id AS roomId, tko.start_time AS checkinDate, tko.end_time AS checkoutDate,
|