HotelMapper.xml
2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sibu.orderHelper.hotel.dao.HotelDao">
<select id="listHotel" resultMap="listHotelResponse" parameterType="map">
SELECT
ho.hotel_id,ho.hotel_name,ho.short_name,ho.thumb_url,ho.sort_index
FROM
hotel ho
WHERE
ho.is_show = 1 and ho.is_delete = 1
ORDER BY
ho.sort_index asc
LIMIT 0,30
</select>
<resultMap type="com.sibu.orderHelper.hotel.response.HotelListResponse" id="listHotelResponse">
<id column="hotel_id" property="hotelId" />
<result column="hotel_name" property="hotelName" />
<result column="short_name" property="shortName" />
<result column="thumb_url" property="thumbUrl" />
<result column="sort_index" property="sortIndex" />
</resultMap>
<!-- 酒店详情 -->
<select id="getHotelDetail" resultMap="hotelDetailResponse" parameterType="map">
SELECT
ho.*
FROM
hotel ho
WHERE ho.hotel_id = #{hotelId}
</select>
<select id="getHotelBySubOrderId" resultMap="hotelDetailResponse" parameterType="map">
select * from hotel where hotel_id = (select hotel_id from room_type where room_id =
(select room_id from room_order_detail where sub_order_id = #{subOrderId}))
</select>
<resultMap type="com.sibu.orderHelper.hotel.response.HotelDetailResponse" id="hotelDetailResponse">
<id column="hotel_id" property="hotelId" />
<result column="hotel_name" property="hotelName" />
<result column="open_time" property="openTime" />
<result column="hotel_star" property="hotelStar" />
<result column="hotel_address" property="hotelAddress" />
<result column="hotel_telphone" property="hotelTelphone" />
<result column="check_in_time" property="checkInTime" />
<result column="check_out_time" property="checkOutTime" />
<result column="intro" property="intro" />
<result column="room_equipment" property="roomEquipment" />
<result column="hotel_service" property="hotelService" />
<result column="short_name" property="shortName" />
</resultMap>
<!-- 酒店图片 -->
<select id="listHotelImage" resultType="String" parameterType="map">
select image_url from hotel_image where hotel_id = #{hotelId}
</select>
</mapper>