预约段 接口
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
<?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.czg.service.account.mapper.BkOrderTableMapper">
|
||||
|
||||
<insert id="customInsertBatch">
|
||||
insert into bk_order_table (shop_id, book_order_id, table_area_id ,table_area_name,table_id,table_name)
|
||||
values
|
||||
<foreach collection="bkOrderTables" item="item" separator=",">
|
||||
(#{shopId}, #{bookOrderId}, #{item.tableAreaId}, #{item.tableAreaName}, #{item.tableId}, #{item.tableName})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="table" resultMap="BkTableVOResultMap">
|
||||
SELECT
|
||||
`table`.area_id,
|
||||
`area`.`name` as area_name,
|
||||
`table`.id as table_id,
|
||||
`table`.`name` as table_name,
|
||||
`order`.call_phone,
|
||||
`order`.call_username,
|
||||
`order`.booking_phone,
|
||||
`order`.booking_username,
|
||||
`order`.booking_time
|
||||
FROM
|
||||
`tb_shop_table` `table`
|
||||
LEFT JOIN tb_shop_table_area `area` on `table`.area_id = `area`.id
|
||||
LEFT JOIN bk_order `order` ON `table`.shop_id = `order`.shop_id
|
||||
AND DATE(`order`.booking_time) = #{day}
|
||||
<if test="seatTimeType != null and seatTimeType != ''">
|
||||
AND `order`.seat_time_type = #{seatTimeType}
|
||||
</if>
|
||||
LEFT JOIN bk_order_table oTable on oTable.book_order_id = `order`.id
|
||||
and `table`.id = oTable.table_id
|
||||
WHERE
|
||||
`table`.shop_id = #{shopId}
|
||||
AND `table`.`status` != 'unbound'
|
||||
<if test="areaId != null">
|
||||
AND `table`.area_id = #{areaId}
|
||||
</if>
|
||||
ORDER BY `table`.area_id, `table`.id
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<resultMap id="BkTableVOResultMap" type="com.czg.account.vo.BkTableVO">
|
||||
<result property="areaId" column="area_id"/>
|
||||
<result property="areaName" column="area_name"/>
|
||||
<collection property="tables" ofType="com.czg.account.vo.BkTableVO$tableVO">
|
||||
<result property="tableName" column="table_name"/>
|
||||
<collection property="bkOrders" ofType="com.czg.account.vo.BkTableVO$BkOrder">
|
||||
<result property="callPhone" column="call_phone"/>
|
||||
<result property="callUsername" column="call_username"/>
|
||||
<result property="bookingPhone" column="booking_phone"/>
|
||||
<result property="bookingUsername" column="booking_username"/>
|
||||
</collection>
|
||||
</collection>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user