支付
This commit is contained in:
@@ -0,0 +1,272 @@
|
||||
<?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.zhwl.cinema.mapper.TicketVoMapper">
|
||||
|
||||
<resultMap type = "CinemaTicketVo" id = "TicketResult">
|
||||
<result property = "id" column = "id"/>
|
||||
<result property = "ticketId" column = "ticket_id"/>
|
||||
<result property = "movieId" column = "movie_id"/>
|
||||
<result property = "movieName" column = "movie_name"/>
|
||||
<result property = "movieLength" column = "movie_length"/>
|
||||
<result property = "movieCategory" column = "movie_category"/>
|
||||
<collection property = "venueList" javaType = "java.util.List" column = "movie_id" ofType = "VenueVo" select = "selectVenueList"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type = "VenueVo" id = "VenueResult">
|
||||
<result property = "venueId" column = "venue_id"/>
|
||||
<result property = "venueBeginDate" column = "venue_begin_date"/>
|
||||
<result property = "venueEndDate" column = "venue_end_date"/>
|
||||
<result property = "venueWeek" column = "venue_week"/>
|
||||
<result property = "venueRest" column = "venue_rest"/>
|
||||
<collection property = "itemList" javaType = "java.util.List" column = "venue_id" ofType = "ItemVo" select = "selectItemList"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type = "ItemVo" id = "ItemResult">
|
||||
<result property = "itemId" column = "item_id"/>
|
||||
<result property = "hallId" column = "hall_id"/>
|
||||
<result property = "hallName" column = "hallName"/>
|
||||
<result property = "seatNumsRow" column = "seat_nums_row"/>
|
||||
<result property = "rowStart" column = "row_start"/>
|
||||
<result property = "itemBeginTime" column = "item_begin_time"/>
|
||||
<result property = "itemEndTime" column = "item_end_time"/>
|
||||
<result property = "itemName" column = "item_name"/>
|
||||
<result property = "itemRest" column = "item_rest"/>
|
||||
<result property = "venueSeats" column = "venue_seats"/>
|
||||
<result property = "seatNums" column = "seat_nums"/>
|
||||
<result property = "saleNums" column = "sale_nums"/>
|
||||
<collection property = "zoneList" column = "{hallId=hall_id,itemId=item_id}" ofType = "ZoneVo" select = "selectZoneList"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type = "ZoneVo" id = "ZoneResult">
|
||||
<result property = "zoneId" column = "zone_id"/>
|
||||
<result property = "zoneName" column = "zone_name"/>
|
||||
<result property = "seatSet" column = "seat_set"/>
|
||||
<association property = "price" javaType = "PriceVo" column = "{zoneId=zone_id,itemId=item_id}" select = "selectPriceInfo"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type = "PriceVo" id = "selectPriceResult">
|
||||
<result property = "id" column = "id"/>
|
||||
<result property = "price" column = "price"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type = "WindowHallVo" id = "WindowHallVoResult">
|
||||
<result property = "itemId" column = "item_id"/>
|
||||
<result property = "hallId" column = "hall_id"/>
|
||||
<result property = "venueSeats" column = "venue_seats"/>
|
||||
<result property = "seatNums" column = "seat_nums"/>
|
||||
<result property = "saleNums" column = "sale_nums"/>
|
||||
<result property = "seatNumsRow" column = "seat_nums_row"/>
|
||||
<result property = "rowStart" column = "row_start"/>
|
||||
<collection property = "saleList"
|
||||
column = "{hallId=hall_id,itemId=item_id}"
|
||||
ofType = "ZdyCinemaSaleTemp"
|
||||
select = "selectTempList"/>
|
||||
<collection property = "zoneList" javaType = "java.util.List" resultMap = "ZoneResult"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type = "ZdyCinemaSaleTemp" id = "ZdyCinemaSaleTempResult">
|
||||
<result property = "id" column = "id"/>
|
||||
<result property = "tikcetId" column = "tikcet_id"/>
|
||||
<result property = "movieId" column = "movie_id"/>
|
||||
<result property = "venueId" column = "venue_id"/>
|
||||
<result property = "itemId" column = "item_id"/>
|
||||
<result property = "hallId" column = "hall_id"/>
|
||||
<result property = "zoneId" column = "zone_id"/>
|
||||
<result property = "priceId" column = "price_id"/>
|
||||
<result property = "salePrice" column = "sale_price"/>
|
||||
<result property = "rowNum" column = "row_num"/>
|
||||
<result property = "seatNum" column = "seat_num"/>
|
||||
<result property = "seatState" column = "seat_state"/>
|
||||
<result property = "lockSeat" column = "lock_seat"/>
|
||||
<result property = "saleTime" column = "sale_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id = "ticketSql">
|
||||
SELECT a.id,
|
||||
a.ticket_id,
|
||||
a.movie_id,
|
||||
movie.movie_name,
|
||||
movie.movie_length,
|
||||
movie.movie_category
|
||||
FROM zdy_cinema_ticket a
|
||||
LEFT JOIN zdy_cinema_movie movie ON a.movie_id = movie.movie_id
|
||||
</sql>
|
||||
|
||||
<select id = "selectTicketVoList" parameterType = "CinemaTicketVo" resultMap = "TicketResult">
|
||||
<include refid = "ticketSql"/>
|
||||
<where>
|
||||
<if test = "movieId != null ">and movie_id = #{movieId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id = "selectVenueList" parameterType = "Long" resultMap = "VenueResult">
|
||||
select venue_id,
|
||||
venue_begin_date,
|
||||
venue_end_date,
|
||||
venue_week,
|
||||
venue_rest
|
||||
from zdy_cinema_movie_venue
|
||||
where movie_id = #{movieId}
|
||||
ORDER BY venue_begin_date
|
||||
</select>
|
||||
|
||||
<select id = "selectItemList" parameterType = "Long" resultMap = "ItemResult">
|
||||
SELECT b.item_id,
|
||||
b.hall_id,
|
||||
b.item_begin_time,
|
||||
b.item_end_time,
|
||||
b.item_name,
|
||||
b.item_rest,
|
||||
b.venue_seats,
|
||||
b.seat_nums,
|
||||
b.sale_nums,
|
||||
hall.seat_nums_row,
|
||||
hall.row_start,
|
||||
hall.hall_name AS hallName
|
||||
FROM zdy_cinema_movie_venue_item b
|
||||
LEFT JOIN zdy_cinema_hall hall ON b.hall_id = hall.hall_id
|
||||
where b.venue_id = #{venueId}
|
||||
ORDER BY b.item_begin_time
|
||||
</select>
|
||||
|
||||
<select id = "selectZoneList" resultMap = "ZoneResult">
|
||||
select a.zone_id,
|
||||
a.hall_id,
|
||||
a.zone_name,
|
||||
a.seat_set,
|
||||
zcmvi.item_id
|
||||
from zdy_cinema_hall_zone a
|
||||
left join zdy_cinema_movie_venue_item zcmvi on a.hall_id = zcmvi.hall_id
|
||||
where a.hall_id = #{hallId}
|
||||
and zcmvi.item_id = #{itemId}
|
||||
</select>
|
||||
|
||||
<select id = "selectTempList" resultMap = "ZdyCinemaSaleTempResult">
|
||||
select id,
|
||||
tikcet_id,
|
||||
movie_id,
|
||||
venue_id,
|
||||
item_id,
|
||||
hall_id,
|
||||
zone_id,
|
||||
price_id,
|
||||
sale_price,
|
||||
row_num,
|
||||
seat_num,
|
||||
seat_state,
|
||||
sale_time,
|
||||
lock_seat
|
||||
from zdy_cinema_sale_temp
|
||||
where hall_id = #{hallId}
|
||||
and item_id = #{itemId}
|
||||
order by row_num, id
|
||||
</select>
|
||||
|
||||
|
||||
<select id = "selectPriceInfo" parameterType = "java.util.Map" resultMap = "selectPriceResult">
|
||||
select id,
|
||||
zone_id,
|
||||
item_id,
|
||||
price
|
||||
from zdy_cinema_ticket_price
|
||||
where zone_id = #{zoneId}
|
||||
and item_id = #{itemId}
|
||||
</select>
|
||||
|
||||
<select id = "selectTicketVoInfo" parameterType = "Long" resultMap = "TicketResult">
|
||||
<include refid = "ticketSql"/>
|
||||
where a.ticket_id = #{ticketId}
|
||||
</select>
|
||||
|
||||
<select id = "checkMovieInTicket" parameterType = "Long" resultType = "Integer">
|
||||
select count(id)
|
||||
from zdy_cinema_ticket
|
||||
where movie_id = #{movieId}
|
||||
</select>
|
||||
|
||||
<select id = "selectItemInfo" parameterType = "ZdyCinemaSaleTemp" resultMap = "WindowHallVoResult">
|
||||
SELECT b.item_id,
|
||||
b.hall_id,
|
||||
b.item_begin_time,
|
||||
b.item_end_time,
|
||||
b.item_name,
|
||||
b.item_rest,
|
||||
b.venue_seats,
|
||||
b.seat_nums,
|
||||
b.sale_nums,
|
||||
hall.hall_name AS hallName,
|
||||
hall.seat_nums_row,
|
||||
hall.row_start,
|
||||
a.zone_id,
|
||||
a.hall_id,
|
||||
a.zone_name,
|
||||
a.seat_set
|
||||
FROM zdy_cinema_movie_venue_item b
|
||||
LEFT JOIN zdy_cinema_hall hall ON b.hall_id = hall.hall_id
|
||||
LEFT JOIN zdy_cinema_hall_zone a ON a.hall_id = hall.hall_id
|
||||
where b.hall_id = #{hallId}
|
||||
and b.item_id = #{itemId}
|
||||
</select>
|
||||
|
||||
<select id="existsByGroundingFlagAndMovieId" resultType="java.lang.Boolean">
|
||||
select exists(
|
||||
SELECT 1
|
||||
FROM zdy_cinema_ticket zct
|
||||
LEFT JOIN zdy_ticket zt on zct.ticket_id = zt.id
|
||||
WHERE zct.movie_id = #{movieId}
|
||||
AND zt.grounding_flag = #{groundingFlag})
|
||||
</select>
|
||||
|
||||
<select id="existsByGroundingFlagAndMovieIds" resultType="java.lang.Boolean">
|
||||
select exists(
|
||||
SELECT 1
|
||||
FROM zdy_cinema_ticket zct
|
||||
LEFT JOIN zdy_ticket zt on zct.ticket_id = zt.id
|
||||
WHERE zct.movie_id in
|
||||
<foreach item="movieId" collection="movieIds" open="(" separator="," close=")">
|
||||
#{movieId}
|
||||
</foreach>
|
||||
AND zt.grounding_flag = #{groundingFlag})
|
||||
</select>
|
||||
|
||||
<select id="existsByGroundingFlagAndHallId" resultType="java.lang.Boolean">
|
||||
select exists(SELECT 1
|
||||
FROM zdy_cinema_movie_venue_item zcmvi
|
||||
LEFT JOIN zdy_cinema_movie_venue zcmv ON zcmv.venue_id = zcmvi.venue_id
|
||||
LEFT JOIN zdy_cinema_ticket zct ON zct.movie_id = zcmv.movie_id
|
||||
LEFT JOIN zdy_ticket zt ON zct.ticket_id = zt.id
|
||||
WHERE zcmvi.hall_id = #{hallId}
|
||||
AND zt.grounding_flag = #{groundingFlag})
|
||||
</select>
|
||||
|
||||
<select id="existsByHallIds" resultType="java.lang.Boolean">
|
||||
select exists(
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
zdy_cinema_movie_venue_item zcmvi
|
||||
LEFT JOIN zdy_cinema_movie_venue zcmv ON zcmv.venue_id = zcmvi.venue_id
|
||||
LEFT JOIN zdy_cinema_movie zcm on zcm.movie_id = zcmv.movie_id
|
||||
LEFT JOIN zdy_cinema_ticket zct ON zct.movie_id = zcmv.movie_id
|
||||
LEFT JOIN zdy_ticket zt ON zct.ticket_id = zt.id
|
||||
WHERE
|
||||
zcm.del_state = 0
|
||||
AND zcmvi.hall_id in
|
||||
<foreach item="hallId" collection="hallIds" open="(" separator="," close=")">
|
||||
#{hallId}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="existsByHallId" parameterType="java.lang.Long" resultType="java.lang.Boolean">
|
||||
select exists(SELECT 1
|
||||
FROM zdy_cinema_movie_venue_item zcmvi
|
||||
LEFT JOIN zdy_cinema_movie_venue zcmv ON zcmv.venue_id = zcmvi.venue_id
|
||||
LEFT JOIN zdy_cinema_movie zcm on zcm.movie_id = zcmv.movie_id
|
||||
LEFT JOIN zdy_cinema_ticket zct ON zct.movie_id = zcmv.movie_id
|
||||
LEFT JOIN zdy_ticket zt ON zct.ticket_id = zt.id
|
||||
WHERE
|
||||
zcm.del_state = 0
|
||||
AND zcmvi.hall_id = #{hallId})
|
||||
</select>
|
||||
</mapper>
|
@@ -0,0 +1,225 @@
|
||||
<?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.zhwl.cinema.mapper.ZdyCinemaHallMapper">
|
||||
|
||||
<resultMap type = "ZdyCinemaHall" id = "ZdyCinemaHallResult">
|
||||
<result property = "hallId" column = "hall_id"/>
|
||||
<result property = "hallName" column = "hall_name"/>
|
||||
<result property = "hallAddress" column = "hall_address"/>
|
||||
<result property = "rowStart" column = "row_start"/>
|
||||
<result property = "rowNums" column = "row_nums"/>
|
||||
<result property = "seatNumsRow" column = "seat_nums_row"/>
|
||||
<result property = "seatNums" column = "seat_nums"/>
|
||||
<result property = "seatState" column = "seat_state"/>
|
||||
<result property = "delState" column = "del_state"/>
|
||||
<result property = "createTime" column = "create_time"/>
|
||||
<result property = "createBy" column = "create_by"/>
|
||||
<result property = "updateTime" column = "update_time"/>
|
||||
<result property = "updateBy" column = "update_by"/>
|
||||
<result property = "zoneCount" column = "zoneCount"/>
|
||||
<collection property = "zdyCinemaHallZoneList"
|
||||
javaType = "java.util.List"
|
||||
column = "hall_id"
|
||||
ofType = "ZdyCinemaHallZone"
|
||||
select = "selectZdyCinemaHallZoneList"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type = "ZdyCinemaHallZone" id = "ZdyCinemaHallZoneResult">
|
||||
<result property = "zoneId" column = "zone_id"/>
|
||||
<result property = "hallId" column = "hall_id"/>
|
||||
<result property = "zoneName" column = "zone_name"/>
|
||||
<result property = "seatSet" column = "seat_set"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id = "selectZdyCinemaHallVo">
|
||||
select a.hall_id,
|
||||
a.hall_name,
|
||||
a.hall_address,
|
||||
a.row_start,
|
||||
a.row_nums,
|
||||
a.seat_nums_row,
|
||||
a.seat_nums,
|
||||
a.seat_state,
|
||||
a.del_state,
|
||||
a.create_time,
|
||||
a.create_by,
|
||||
a.update_time,
|
||||
a.update_by
|
||||
from zdy_cinema_hall a
|
||||
</sql>
|
||||
|
||||
<select id = "selectZdyCinemaHallList" parameterType = "ZdyCinemaHall" resultMap = "ZdyCinemaHallResult">
|
||||
<include refid = "selectZdyCinemaHallVo"/>
|
||||
<where>
|
||||
<if test = "hallName != null and hallName != ''">
|
||||
and a.hall_name like concat('%', #{hallName}, '%')
|
||||
</if>
|
||||
<if test = "hallAddress != null and hallAddress != ''">
|
||||
and a.hall_address = #{hallAddress}
|
||||
</if>
|
||||
<if test = "rowStart != null ">
|
||||
and a.row_start = #{rowStart}
|
||||
</if>
|
||||
<if test = "rowNums != null ">
|
||||
and a.row_nums = #{rowNums}
|
||||
</if>
|
||||
<if test = "seatNumsRow != null ">
|
||||
and a.seat_nums_row = #{seatNumsRow}
|
||||
</if>
|
||||
<if test = "seatNums != null ">
|
||||
and a.seat_nums = #{seatNums}
|
||||
</if>
|
||||
<if test = "seatState != null and seatState != ''">
|
||||
and a.seat_state = #{seatState}
|
||||
</if>
|
||||
<if test = "delState != null ">
|
||||
and a.del_state = #{delState}
|
||||
</if>
|
||||
</where>
|
||||
order by a.update_time desc
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyCinemaHallZoneList" parameterType = "Long" resultMap = "ZdyCinemaHallZoneResult">
|
||||
select c.*
|
||||
from zdy_cinema_hall_zone c
|
||||
where c.hall_id = #{hallId}
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyCinemaHallByHallId" parameterType = "Long" resultMap = "ZdyCinemaHallResult">
|
||||
<include refid = "selectZdyCinemaHallVo"/>
|
||||
where a.hall_id = #{hallId}
|
||||
</select>
|
||||
|
||||
<insert id = "insertZdyCinemaHall" parameterType = "ZdyCinemaHall" useGeneratedKeys = "true" keyProperty = "hallId">
|
||||
insert into zdy_cinema_hall
|
||||
<trim prefix = "(" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "hallName != null and hallName != ''">hall_name,
|
||||
</if>
|
||||
<if test = "hallAddress != null and hallAddress != ''">hall_address,
|
||||
</if>
|
||||
<if test = "rowStart != null">row_start,
|
||||
</if>
|
||||
<if test = "rowNums != null">row_nums,
|
||||
</if>
|
||||
<if test = "seatNumsRow != null">seat_nums_row,
|
||||
</if>
|
||||
<if test = "seatNums != null">seat_nums,
|
||||
</if>
|
||||
<if test = "seatState != null and seatState != ''">seat_state,
|
||||
</if>
|
||||
<if test = "delState != null">del_state,
|
||||
</if>
|
||||
<if test = "createTime != null">create_time,
|
||||
</if>
|
||||
<if test = "createBy != null">create_by,
|
||||
</if>
|
||||
<if test = "updateTime != null">update_time,
|
||||
</if>
|
||||
<if test = "updateBy != null">update_by,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix = "values (" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "hallName != null and hallName != ''">#{hallName},
|
||||
</if>
|
||||
<if test = "hallAddress != null and hallAddress != ''">#{hallAddress},
|
||||
</if>
|
||||
<if test = "rowStart != null">#{rowStart},
|
||||
</if>
|
||||
<if test = "rowNums != null">#{rowNums},
|
||||
</if>
|
||||
<if test = "seatNumsRow != null">#{seatNumsRow},
|
||||
</if>
|
||||
<if test = "seatNums != null">#{seatNums},
|
||||
</if>
|
||||
<if test = "seatState != null and seatState != ''">#{seatState},</if>
|
||||
<if test = "delState != null">#{delState},</if>
|
||||
<if test = "createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test = "createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test = "updateTime != null">#{updateTime},
|
||||
</if>
|
||||
<if test = "updateBy != null">#{updateBy},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id = "updateZdyCinemaHall" parameterType = "ZdyCinemaHall">
|
||||
update zdy_cinema_hall
|
||||
<trim prefix = "SET" suffixOverrides = ",">
|
||||
<if test = "hallName != null and hallName != ''">hall_name = #{hallName},
|
||||
</if>
|
||||
<if test = "hallAddress != null and hallAddress != ''">hall_address = #{hallAddress},
|
||||
</if>
|
||||
<if test = "rowStart != null">row_start = #{rowStart},
|
||||
</if>
|
||||
<if test = "rowNums != null">row_nums = #{rowNums},
|
||||
</if>
|
||||
<if test = "seatNumsRow != null">seat_nums_row = #{seatNumsRow},
|
||||
</if>
|
||||
<if test = "seatNums != null">seat_nums = #{seatNums},
|
||||
</if>
|
||||
<if test = "seatState != null and seatState != ''">seat_state = #{seatState},
|
||||
</if>
|
||||
<if test = "delState != null">del_state = #{delState},
|
||||
</if>
|
||||
<if test = "createTime != null">create_time = #{createTime},
|
||||
</if>
|
||||
<if test = "createBy != null">create_by = #{createBy},
|
||||
</if>
|
||||
<if test = "updateTime != null">update_time = #{updateTime},
|
||||
</if>
|
||||
<if test = "updateBy != null">update_by = #{updateBy},
|
||||
</if>
|
||||
</trim>
|
||||
where hall_id = #{hallId}
|
||||
</update>
|
||||
|
||||
<delete id = "deleteZdyCinemaHallByHallId" parameterType = "Long">
|
||||
delete
|
||||
from zdy_cinema_hall
|
||||
where hall_id = #{hallId}
|
||||
</delete>
|
||||
|
||||
<delete id = "deleteZdyCinemaHallByHallIds" parameterType = "String">
|
||||
delete from zdy_cinema_hall where hall_id in
|
||||
<foreach item = "hallId" collection = "array" open = "(" separator = "," close = ")">
|
||||
#{hallId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id = "deleteZdyCinemaHallZoneByHallIds" parameterType = "String">
|
||||
delete from zdy_cinema_hall_zone where hall_id in
|
||||
<foreach item = "hallId" collection = "array" open = "(" separator = "," close = ")">
|
||||
#{hallId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id = "deleteZdyCinemaHallZoneByHallId" parameterType = "Long">
|
||||
delete
|
||||
from zdy_cinema_hall_zone
|
||||
where hall_id = #{hallId}
|
||||
</delete>
|
||||
|
||||
<insert id = "batchZdyCinemaHallZone">
|
||||
insert into zdy_cinema_hall_zone ( zone_id , hall_id , zone_name , seat_set) values
|
||||
<foreach item = "item" index = "index" collection = "list" separator = ",">
|
||||
( #{item.zoneId
|
||||
}, #{item.hallId
|
||||
}, #{item.zoneName
|
||||
}, #{item.seatSet
|
||||
})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="existsHallName" parameterType="ZdyCinemaHall" resultType="java.lang.Boolean">
|
||||
SELECT EXISTS(SELECT 1
|
||||
FROM zdy_cinema_hall
|
||||
WHERE hall_name = #{hallName}
|
||||
<if test="hallId != null">
|
||||
AND hall_id != #{hallId}
|
||||
</if>
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
@@ -0,0 +1,89 @@
|
||||
<?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.zhwl.cinema.mapper.ZdyCinemaHallZoneMapper">
|
||||
|
||||
<resultMap type="ZdyCinemaHallZone" id="ZdyCinemaHallZoneResult">
|
||||
<result property="zoneId" column="zone_id"/>
|
||||
<result property="hallId" column="hall_id"/>
|
||||
<result property="zoneName" column="zone_name"/>
|
||||
<result property="seatSet" column="seat_set"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectZdyCinemaHallZoneVo">
|
||||
select zone_id, hall_id, zone_name, seat_set
|
||||
from zdy_cinema_hall_zone
|
||||
</sql>
|
||||
|
||||
<select id="selectZdyCinemaHallZoneList" parameterType="ZdyCinemaHallZone" resultMap="ZdyCinemaHallZoneResult">
|
||||
<include refid="selectZdyCinemaHallZoneVo"/>
|
||||
<where>
|
||||
<if test="hallId != null ">
|
||||
and hall_id = #{hallId}
|
||||
</if>
|
||||
<if test="zoneName != null and zoneName != ''">
|
||||
and zone_name like concat('%', #{zoneName}, '%')
|
||||
</if>
|
||||
<if test="seatSet != null ">
|
||||
and seat_set = #{seatSet}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectZdyCinemaHallZoneByZoneId" parameterType="Long"
|
||||
resultMap="ZdyCinemaHallZoneResult">
|
||||
<include refid="selectZdyCinemaHallZoneVo"/>
|
||||
where zone_id = #{zoneId}
|
||||
</select>
|
||||
|
||||
<insert id="insertZdyCinemaHallZone" parameterType="ZdyCinemaHallZone" useGeneratedKeys="true"
|
||||
keyProperty="zoneId">
|
||||
insert into zdy_cinema_hall_zone
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="hallId != null">hall_id,
|
||||
</if>
|
||||
<if test="zoneName != null">zone_name,
|
||||
</if>
|
||||
<if test="seatSet != null">seat_set,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="hallId != null">#{hallId},
|
||||
</if>
|
||||
<if test="zoneName != null">#{zoneName},
|
||||
</if>
|
||||
<if test="seatSet != null">#{seatSet},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateZdyCinemaHallZone" parameterType="ZdyCinemaHallZone">
|
||||
update zdy_cinema_hall_zone
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="hallId != null">hall_id =
|
||||
#{hallId},
|
||||
</if>
|
||||
<if test="zoneName != null">zone_name =
|
||||
#{zoneName},
|
||||
</if>
|
||||
<if test="seatSet != null">seat_set =
|
||||
#{seatSet},
|
||||
</if>
|
||||
</trim>
|
||||
where zone_id = #{zoneId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteZdyCinemaHallZoneByZoneId" parameterType="Long">
|
||||
delete
|
||||
from zdy_cinema_hall_zone
|
||||
where zone_id = #{zoneId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteZdyCinemaHallZoneByZoneIds" parameterType="String">
|
||||
delete from zdy_cinema_hall_zone where zone_id in
|
||||
<foreach item="zoneId" collection="array" open="(" separator="," close=")">
|
||||
#{zoneId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@@ -0,0 +1,63 @@
|
||||
<?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.zhwl.cinema.mapper.ZdyCinemaMovieCategoryMapper">
|
||||
|
||||
<resultMap type = "ZdyCinemaMovieCategory" id = "ZdyCinemaMovieCategoryResult">
|
||||
<result property = "movieCategoryId" column = "movie_category_id"/>
|
||||
<result property = "movieCategoryName" column = "movie_category_name"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id = "selectZdyCinemaMovieCategoryVo">
|
||||
select movie_category_id, movie_category_name
|
||||
from zdy_cinema_movie_category
|
||||
</sql>
|
||||
|
||||
<select id = "selectZdyCinemaMovieCategoryList" parameterType = "ZdyCinemaMovieCategory" resultMap = "ZdyCinemaMovieCategoryResult">
|
||||
<include refid = "selectZdyCinemaMovieCategoryVo"/>
|
||||
<where>
|
||||
<if test = "movieCategoryName != null and movieCategoryName != ''">
|
||||
and movie_category_name like concat('%', #{movieCategoryName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyCinemaMovieCategoryByMovieCategoryId" parameterType = "Long" resultMap = "ZdyCinemaMovieCategoryResult">
|
||||
<include refid = "selectZdyCinemaMovieCategoryVo"/>
|
||||
where movie_category_id = #{movieCategoryId}
|
||||
</select>
|
||||
|
||||
<insert id = "insertZdyCinemaMovieCategory" parameterType = "ZdyCinemaMovieCategory" useGeneratedKeys = "true" keyProperty = "movieCategoryId">
|
||||
insert into zdy_cinema_movie_category
|
||||
<trim prefix = "(" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "movieCategoryName != null and movieCategoryName != ''">movie_category_name, </if>
|
||||
</trim>
|
||||
<trim prefix = "values (" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "movieCategoryName != null and movieCategoryName != ''">#{movieCategoryName},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id = "updateZdyCinemaMovieCategory" parameterType = "ZdyCinemaMovieCategory">
|
||||
update zdy_cinema_movie_category
|
||||
<trim prefix = "SET" suffixOverrides = ",">
|
||||
<if test = "movieCategoryName != null and movieCategoryName != ''">movie_category_name =
|
||||
#{movieCategoryName},
|
||||
</if>
|
||||
</trim>
|
||||
where movie_category_id = #{movieCategoryId}
|
||||
</update>
|
||||
|
||||
<delete id = "deleteZdyCinemaMovieCategoryByMovieCategoryId" parameterType = "Long">
|
||||
delete
|
||||
from zdy_cinema_movie_category
|
||||
where movie_category_id = #{movieCategoryId}
|
||||
</delete>
|
||||
|
||||
<delete id = "deleteZdyCinemaMovieCategoryByMovieCategoryIds" parameterType = "String">
|
||||
delete from zdy_cinema_movie_category where movie_category_id in
|
||||
<foreach item = "movieCategoryId" collection = "array" open = "(" separator = "," close = ")">
|
||||
#{movieCategoryId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@@ -0,0 +1,165 @@
|
||||
<?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.zhwl.cinema.mapper.ZdyCinemaMovieMapper">
|
||||
|
||||
<resultMap type = "ZdyCinemaMovie" id = "ZdyCinemaMovieResult">
|
||||
<result property = "movieId" column = "movie_id"/>
|
||||
<result property = "movieName" column = "movie_name"/>
|
||||
<result property = "movieLength" column = "movie_length"/>
|
||||
<result property = "movieBeginTime" column = "movie_begin_time"/>
|
||||
<result property = "movieEndTime" column = "movie_end_time"/>
|
||||
<result property = "movieCategory" column = "movie_category"/>
|
||||
<result property = "moviePoster" column = "movie_poster"/>
|
||||
<result property = "movieAdvise" column = "movie_advise"/>
|
||||
<result property = "moviePerformer" column = "movie_performer"/>
|
||||
<result property = "movieIntroduction" column = "movie_introduction"/>
|
||||
<result property = "movieStatus" column = "movie_status"/>
|
||||
<result property = "moviePictures" column = "movie_pictures"/>
|
||||
<result property = "delState" column = "del_state"/>
|
||||
<result property = "createTime" column = "create_time"/>
|
||||
<result property = "createBy" column = "create_by"/>
|
||||
<result property = "updateTime" column = "update_time"/>
|
||||
<result property = "updateBy" column = "update_by"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id = "selectZdyCinemaMovieVo">
|
||||
select movie_id,
|
||||
movie_name,
|
||||
movie_length,
|
||||
(select venue_begin_date from zdy_cinema_movie_venue where movie_id = a.movie_id order by venue_begin_date limit 1) as movie_begin_time,
|
||||
(select venue_end_date from zdy_cinema_movie_venue where movie_id = a.movie_id order by venue_begin_date desc limit 1) as movie_end_time,
|
||||
movie_category,
|
||||
movie_poster,
|
||||
movie_advise,
|
||||
movie_performer,
|
||||
movie_introduction,
|
||||
movie_status,
|
||||
movie_pictures,
|
||||
del_state,
|
||||
create_time,
|
||||
create_by,
|
||||
update_time,
|
||||
update_by
|
||||
from zdy_cinema_movie a
|
||||
</sql>
|
||||
|
||||
<select id = "selectZdyCinemaMovieList" parameterType = "ZdyCinemaMovie" resultMap = "ZdyCinemaMovieResult">
|
||||
<include refid = "selectZdyCinemaMovieVo"/>
|
||||
<where>
|
||||
a.del_state = 0
|
||||
<if test = "movieName != null and movieName != ''">and movie_name like concat('%', #{movieName}, '%')</if>
|
||||
<if test = "movieLength != null ">and movie_length = #{movieLength}</if>
|
||||
<if test = "movieBeginTime != null ">and movie_begin_time = #{movieBeginTime}</if>
|
||||
<if test = "movieEndTime != null ">and movie_end_time = #{movieEndTime}</if>
|
||||
<if test = "movieCategory != null and movieCategory != ''">and movie_category = #{movieCategory}</if>
|
||||
<if test = "moviePoster != null and moviePoster != ''">and movie_poster = #{moviePoster}</if>
|
||||
<if test = "movieAdvise != null and movieAdvise != ''">and movie_advise = #{movieAdvise}</if>
|
||||
<if test = "moviePerformer != null and moviePerformer != ''">and movie_performer = #{moviePerformer}</if>
|
||||
<if test = "movieIntroduction != null and movieIntroduction != ''">and movie_introduction =
|
||||
#{movieIntroduction}
|
||||
</if>
|
||||
<if test = "movieStatus != null ">and movie_status = #{movieStatus}</if>
|
||||
<if test = "moviePictures != null and moviePictures != ''">and movie_pictures = #{moviePictures}</if>
|
||||
<if test = "delState != null ">and del_state = #{delState}</if>
|
||||
<if test = "createTimeStart != null ">and create_time >= #{createTimeStart}</if>
|
||||
<if test = "createTimeEnd != null ">and create_time <= #{createTimeEnd}</if>
|
||||
<if test = "updateTimeStart != null ">and update_time >= #{updateTimeStart}</if>
|
||||
<if test = "updateTimeEnd != null ">and update_time <= #{updateTimeEnd}</if>
|
||||
</where>
|
||||
order by update_time desc
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyCinemaMovieByMovieId" parameterType = "Long" resultMap = "ZdyCinemaMovieResult">
|
||||
<include refid = "selectZdyCinemaMovieVo"/>
|
||||
where movie_id = #{movieId}
|
||||
</select>
|
||||
|
||||
<insert id = "insertZdyCinemaMovie" parameterType = "ZdyCinemaMovie" useGeneratedKeys = "true"
|
||||
keyProperty = "movieId">
|
||||
insert into zdy_cinema_movie
|
||||
<trim prefix = "(" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "movieName != null and movieName != ''">movie_name,</if>
|
||||
<if test = "movieLength != null">movie_length,</if>
|
||||
<if test = "movieBeginTime != null">movie_begin_time,</if>
|
||||
<if test = "movieEndTime != null">movie_end_time,</if>
|
||||
<if test = "movieCategory != null">movie_category,</if>
|
||||
<if test = "moviePoster != null">movie_poster,</if>
|
||||
<if test = "movieAdvise != null">movie_advise,</if>
|
||||
<if test = "moviePerformer != null">movie_performer,</if>
|
||||
<if test = "movieIntroduction != null">movie_introduction,</if>
|
||||
<if test = "movieStatus != null">movie_status,</if>
|
||||
<if test = "moviePictures != null">movie_pictures,</if>
|
||||
<if test = "delState != null">del_state,</if>
|
||||
<if test = "createTime != null">create_time,</if>
|
||||
<if test = "createBy != null">create_by,</if>
|
||||
<if test = "updateTime != null">update_time,</if>
|
||||
<if test = "updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix = "values (" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "movieName != null and movieName != ''">#{movieName},</if>
|
||||
<if test = "movieLength != null">#{movieLength},</if>
|
||||
<if test = "movieBeginTime != null">#{movieBeginTime},</if>
|
||||
<if test = "movieEndTime != null">#{movieEndTime},</if>
|
||||
<if test = "movieCategory != null">#{movieCategory},</if>
|
||||
<if test = "moviePoster != null">#{moviePoster},</if>
|
||||
<if test = "movieAdvise != null">#{movieAdvise},</if>
|
||||
<if test = "moviePerformer != null">#{moviePerformer},</if>
|
||||
<if test = "movieIntroduction != null">#{movieIntroduction},</if>
|
||||
<if test = "movieStatus != null">#{movieStatus},</if>
|
||||
<if test = "moviePictures != null">#{moviePictures},</if>
|
||||
<if test = "delState != null">#{delState},</if>
|
||||
<if test = "createTime != null">#{createTime},</if>
|
||||
<if test = "createBy != null">#{createBy},</if>
|
||||
<if test = "updateTime != null">#{updateTime},</if>
|
||||
<if test = "updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id = "updateZdyCinemaMovie" parameterType = "ZdyCinemaMovie">
|
||||
update zdy_cinema_movie
|
||||
<trim prefix = "SET" suffixOverrides = ",">
|
||||
<if test = "movieName != null and movieName != ''">movie_name = #{movieName},</if>
|
||||
<if test = "movieLength != null">movie_length = #{movieLength},</if>
|
||||
<if test = "movieBeginTime != null">movie_begin_time = #{movieBeginTime},</if>
|
||||
<if test = "movieEndTime != null">movie_end_time = #{movieEndTime},</if>
|
||||
<if test = "movieCategory != null">movie_category = #{movieCategory},</if>
|
||||
<if test = "moviePoster != null">movie_poster = #{moviePoster},</if>
|
||||
<if test = "movieAdvise != null">movie_advise = #{movieAdvise},</if>
|
||||
<if test = "moviePerformer != null">movie_performer = #{moviePerformer},</if>
|
||||
<if test = "movieIntroduction != null">movie_introduction = #{movieIntroduction},</if>
|
||||
<if test = "movieStatus != null">movie_status = #{movieStatus},</if>
|
||||
<if test = "moviePictures != null">movie_pictures = #{moviePictures},</if>
|
||||
<if test = "delState != null">del_state = #{delState},</if>
|
||||
<if test = "createTime != null">create_time = #{createTime},</if>
|
||||
<if test = "createBy != null">create_by = #{createBy},</if>
|
||||
<if test = "updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test = "updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where movie_id = #{movieId}
|
||||
</update>
|
||||
|
||||
<update id = "deleteZdyCinemaMovieByMovieId" parameterType = "Long">
|
||||
update zdy_cinema_movie
|
||||
set del_state = 1
|
||||
where movie_id = #{movieId}
|
||||
</update>
|
||||
|
||||
<update id = "deleteZdyCinemaMovieByMovieIds" parameterType = "String">
|
||||
update zdy_cinema_movie
|
||||
set del_state = 1
|
||||
where movie_id in
|
||||
<foreach item = "movieId" collection = "array" open = "(" separator = "," close = ")">
|
||||
#{movieId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="existsMovieName" parameterType="ZdyCinemaMovie" resultType="java.lang.Boolean">
|
||||
SELECT EXISTS(SELECT 1
|
||||
FROM zdy_cinema_movie
|
||||
WHERE movie_name = #{movieName}
|
||||
<if test="movieId != null">
|
||||
AND movie_id != #{movieId}
|
||||
</if>
|
||||
AND del_state = 0)
|
||||
</select>
|
||||
</mapper>
|
@@ -0,0 +1,279 @@
|
||||
<?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.zhwl.cinema.mapper.ZdyCinemaMovieVenueItemMapper">
|
||||
|
||||
<resultMap type = "ZdyCinemaMovieVenueItem" id = "ZdyCinemaMovieVenueItemResult">
|
||||
<result property = "itemId" column = "item_id"/>
|
||||
<result property = "hallId" column = "hall_id"/>
|
||||
<result property = "hallName" column = "hallName"/>
|
||||
<result property = "venueId" column = "venue_id"/>
|
||||
<result property = "itemBeginTime" column = "item_begin_time"/>
|
||||
<result property = "itemEndTime" column = "item_end_time"/>
|
||||
<result property = "itemName" column = "item_name"/>
|
||||
<result property = "itemRest" column = "item_rest"/>
|
||||
<result property = "venueSeats" column = "venue_seats"/>
|
||||
<result property = "seatNums" column = "seat_nums"/>
|
||||
<result property = "saleNums" column = "sale_nums"/>
|
||||
<result property = "createTime" column = "create_time"/>
|
||||
<result property = "createBy" column = "create_by"/>
|
||||
<result property = "updateTime" column = "update_time"/>
|
||||
<result property = "updateBy" column = "update_by"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="ZdyCinemaMovieVenueItemDTO" id="ZdyCinemaMovieVenueItemDTOResult">
|
||||
<result property="itemId" column="item_id"/>
|
||||
<result property="hallId" column="hall_id"/>
|
||||
<result property="hallName" column="hallName"/>
|
||||
<result property="venueId" column="venue_id"/>
|
||||
<result property="itemBeginTime" column="item_begin_time"/>
|
||||
<result property="itemEndTime" column="item_end_time"/>
|
||||
<result property="itemName" column="item_name"/>
|
||||
<result property="itemRest" column="item_rest"/>
|
||||
<result property="venueSeats" column="venue_seats"/>
|
||||
<result property="seatNums" column="seat_nums"/>
|
||||
<result property="saleNums" column="sale_nums"/>
|
||||
<result property="venueBeginDate" column="venue_begin_date"/>
|
||||
<result property="venueEndDate" column="venue_end_date"/>
|
||||
<result property="venueWeek" column="venue_week"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id = "selectZdyCinemaMovieVenueItemVo">
|
||||
select item.item_id,
|
||||
item.hall_id,
|
||||
item.venue_id,
|
||||
item.item_begin_time,
|
||||
item.item_end_time,
|
||||
item.item_name,
|
||||
item.item_rest,
|
||||
item.venue_seats,
|
||||
item.seat_nums,
|
||||
item.sale_nums,
|
||||
hall.hall_name as hallName
|
||||
from zdy_cinema_movie_venue_item item
|
||||
left join zdy_cinema_hall hall on hall.hall_id = item.hall_id
|
||||
</sql>
|
||||
|
||||
<select id = "selectZdyCinemaMovieVenueItemList" parameterType = "ZdyCinemaMovieVenueItem" resultMap = "ZdyCinemaMovieVenueItemResult">
|
||||
<include refid = "selectZdyCinemaMovieVenueItemVo"/>
|
||||
<where>
|
||||
<if test = "hallId != null ">
|
||||
and item.hall_id = #{hallId}
|
||||
</if>
|
||||
<if test = "venueId != null ">
|
||||
and item.venue_id = #{venueId}
|
||||
</if>
|
||||
<if test = "itemBeginTime != null and itemBeginTime != ''">
|
||||
and item.item_begin_time = #{itemBeginTime}
|
||||
</if>
|
||||
<if test = "itemEndTime != null and itemEndTime != ''">
|
||||
and item.item_end_time = #{itemEndTime}
|
||||
</if>
|
||||
<if test = "itemName != null and itemName != ''">
|
||||
and item.item_name like concat('%', #{itemName}, '%')
|
||||
</if>
|
||||
<if test = "itemRest != null and itemRest != ''">
|
||||
and item.item_rest = #{itemRest}
|
||||
</if>
|
||||
<if test = "venueRest != null and venueRest != ''">
|
||||
and item.venue_rest = #{venueRest}
|
||||
</if>
|
||||
<if test = "seatNums != null ">
|
||||
and item.seat_nums = #{seatNums}
|
||||
</if>
|
||||
<if test = "saleNums != null ">
|
||||
and item.sale_nums = #{saleNums}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyCinemaMovieVenueItemByItemId" parameterType = "Long" resultMap = "ZdyCinemaMovieVenueItemResult">
|
||||
<include refid = "selectZdyCinemaMovieVenueItemVo"/>
|
||||
where item.item_id = #{itemId}
|
||||
</select>
|
||||
|
||||
<insert id = "insertZdyCinemaMovieVenueItem" parameterType = "ZdyCinemaMovieVenueItem" useGeneratedKeys = "true"
|
||||
keyProperty = "itemId">
|
||||
insert into zdy_cinema_movie_venue_item
|
||||
<trim prefix = "(" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "hallId != null">hall_id,
|
||||
</if>
|
||||
<if test = "venueId != null">venue_id,
|
||||
</if>
|
||||
<if test = "itemBeginTime != null">item_begin_time,
|
||||
</if>
|
||||
<if test = "itemEndTime != null">item_end_time,
|
||||
</if>
|
||||
<if test = "itemName != null">item_name,
|
||||
</if>
|
||||
<if test = "itemRest != null">item_rest,
|
||||
</if>
|
||||
<if test = "venueSeats != null">venue_seats,
|
||||
</if>
|
||||
<if test = "seatNums != null">seat_nums,
|
||||
</if>
|
||||
<if test = "saleNums != null">sale_nums,
|
||||
</if>
|
||||
<if test = "createTime != null">create_time,</if>
|
||||
<if test = "createBy != null">create_by,</if>
|
||||
<if test = "updateTime != null">update_time,</if>
|
||||
<if test = "updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix = "values (" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "hallId != null">#{hallId},
|
||||
</if>
|
||||
<if test = "venueId != null">#{venueId},
|
||||
</if>
|
||||
<if test = "itemBeginTime != null">#{itemBeginTime},
|
||||
</if>
|
||||
<if test = "itemEndTime != null">#{itemEndTime},
|
||||
</if>
|
||||
<if test = "itemName != null">#{itemName},
|
||||
</if>
|
||||
<if test = "itemRest != null">#{itemRest},
|
||||
</if>
|
||||
<if test = "venueSeats != null">#{venueSeats},
|
||||
</if>
|
||||
<if test = "seatNums != null">#{seatNums},
|
||||
</if>
|
||||
<if test = "saleNums != null">#{saleNums},
|
||||
</if>
|
||||
<if test = "createTime != null">#{createTime},</if>
|
||||
<if test = "createBy != null">#{createBy},</if>
|
||||
<if test = "updateTime != null">#{updateTime},</if>
|
||||
<if test = "updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id = "updateZdyCinemaMovieVenueItem" parameterType = "ZdyCinemaMovieVenueItem">
|
||||
update zdy_cinema_movie_venue_item
|
||||
<trim prefix = "SET" suffixOverrides = ",">
|
||||
<if test = "hallId != null">hall_id = #{hallId},
|
||||
</if>
|
||||
<if test = "venueId != null">venue_id = #{venueId},
|
||||
</if>
|
||||
<if test = "itemBeginTime != null">item_begin_time = #{itemBeginTime},
|
||||
</if>
|
||||
<if test = "itemEndTime != null">item_end_time = #{itemEndTime},
|
||||
</if>
|
||||
<if test = "itemName != null">item_name = #{itemName},
|
||||
</if>
|
||||
<if test = "itemRest != null">item_rest = #{itemRest},
|
||||
</if>
|
||||
<if test = "venueSeats != null">venue_seats = #{venueSeats},
|
||||
</if>
|
||||
<if test = "seatNums != null">seat_nums = #{seatNums},
|
||||
</if>
|
||||
<if test = "saleNums != null">sale_nums = #{saleNums},
|
||||
</if>
|
||||
<if test = "createTime != null">create_time = #{createTime},</if>
|
||||
<if test = "createBy != null">create_by = #{createBy},</if>
|
||||
<if test = "updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test = "updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where item_id = #{itemId}
|
||||
</update>
|
||||
|
||||
<delete id = "deleteZdyCinemaMovieVenueItemByItemId" parameterType = "Long">
|
||||
delete
|
||||
from zdy_cinema_movie_venue_item
|
||||
where item_id = #{itemId}
|
||||
</delete>
|
||||
|
||||
<delete id = "deleteZdyCinemaMovieVenueItemByItemIds" parameterType = "String">
|
||||
delete from zdy_cinema_movie_venue_item where item_id in
|
||||
<foreach item = "itemId" collection = "array" open = "(" separator = "," close = ")">
|
||||
#{itemId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id = "selectVenueItemListByVenueId" parameterType = "Long" resultMap = "ZdyCinemaMovieVenueItemResult">
|
||||
select item_id,
|
||||
hall_id,
|
||||
venue_id,
|
||||
item_begin_time,
|
||||
item_end_time,
|
||||
item_name,
|
||||
item_rest,
|
||||
venue_seats,
|
||||
seat_nums,
|
||||
sale_nums
|
||||
from zdy_cinema_movie_venue_item
|
||||
where venue_id = #{venueId}
|
||||
</select>
|
||||
|
||||
<select id = "checkHallInVenueItem" parameterType = "Long" resultType = "Integer">
|
||||
select count(hall_id)
|
||||
from zdy_cinema_movie_venue_item
|
||||
where hall_id = #{hallId}
|
||||
</select>
|
||||
|
||||
<!-- 根据场次id查询该影厅是否有正在出售的票 -->
|
||||
<select id = "selectIsSaleByItemIds" parameterType = "String">
|
||||
select sum(sale_nums)
|
||||
from zdy_cinema_movie_venue_item where item_id in
|
||||
<foreach item = "itemId" collection = "array" open = "(" separator = "," close = ")">
|
||||
#{itemId}
|
||||
</foreach>
|
||||
</select>
|
||||
<!-- 根据场地id查询该影厅是否有正在出售的票 -->
|
||||
<select id = "selectIsSaleByHallId" parameterType = "Long">
|
||||
select IFNULL(sum(sale_nums), 0)
|
||||
from zdy_cinema_movie_venue_item where hall_id = #{hallId}
|
||||
</select>
|
||||
<!-- 根据场次id更新销量 -->
|
||||
<update id = "updateSaleNums">
|
||||
update zdy_cinema_movie_venue_item
|
||||
set sale_nums = sale_nums + #{nums}
|
||||
where item_id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="getOverlappingItems" parameterType="VenueItemOverlappingQueryDTO"
|
||||
resultMap="ZdyCinemaMovieVenueItemDTOResult">
|
||||
SELECT
|
||||
zcmvi.item_begin_time,
|
||||
zcmvi.item_end_time,
|
||||
zcmvi.item_rest,
|
||||
zcmv.venue_begin_date,
|
||||
zcmv.venue_end_date
|
||||
FROM zdy_cinema_movie_venue_item zcmvi
|
||||
INNER JOIN zdy_cinema_movie_venue zcmv ON zcmv.venue_id = zcmvi.venue_id
|
||||
WHERE
|
||||
DATE(zcmv.venue_begin_date) <= #{venueEndDate}
|
||||
AND DATE(zcmv.venue_end_date) >= #{venueBeginDate}
|
||||
AND TIME(zcmvi.item_begin_time) <= TIME(#{itemEndTime})
|
||||
AND TIME(zcmvi.item_end_time) > TIME(#{itemBeginTime})
|
||||
AND zcmvi.hall_id = #{hallId}
|
||||
<if test="itemId != null">
|
||||
AND zcmvi.item_id != #{itemId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="existsByHallIds" resultType="java.lang.Boolean">
|
||||
select exists(
|
||||
SELECT 1
|
||||
FROM zdy_cinema_movie_venue_item zcmvi
|
||||
LEFT JOIN zdy_cinema_movie_venue zcmv on zcmvi.venue_id = zcmv.venue_id
|
||||
LEFT JOIN zdy_cinema_movie zcm on zcm.movie_id = zcmv.movie_id
|
||||
WHERE
|
||||
zcm.del_state = 0
|
||||
AND hall_id in
|
||||
<foreach item="hallId" collection="array" open="(" separator="," close=")">
|
||||
#{hallId}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="existsByHallId" parameterType="java.lang.Long" resultType="java.lang.Boolean">
|
||||
select exists(
|
||||
SELECT 1
|
||||
FROM zdy_cinema_movie_venue_item zcmvi
|
||||
LEFT JOIN zdy_cinema_movie_venue zcmv on zcmvi.venue_id = zcmv.venue_id
|
||||
LEFT JOIN zdy_cinema_movie zcm on zcm.movie_id = zcmv.movie_id
|
||||
WHERE
|
||||
zcm.del_state = 0
|
||||
AND hall_id = #{hallId}
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
@@ -0,0 +1,189 @@
|
||||
<?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.zhwl.cinema.mapper.ZdyCinemaMovieVenueMapper">
|
||||
|
||||
<resultMap type = "ZdyCinemaMovieVenue" id = "ZdyCinemaMovieVenueResult">
|
||||
<result property = "venueId" column = "venue_id"/>
|
||||
<result property = "movieId" column = "movie_id"/>
|
||||
<result property = "venueBeginDate" column = "venue_begin_date"/>
|
||||
<result property = "venueEndDate" column = "venue_end_date"/>
|
||||
<result property = "venueWeek" column = "venue_week"/>
|
||||
<result property = "venueRest" column = "venue_rest"/>
|
||||
<result property = "venueStatus" column = "venue_status"/>
|
||||
<result property = "createTime" column = "create_time"/>
|
||||
<result property = "createBy" column = "create_by"/>
|
||||
<result property = "updateTime" column = "update_time"/>
|
||||
<result property = "updateBy" column = "update_by"/>
|
||||
<collection property = "zdyCinemaMovieVenueItemList"
|
||||
javaType = "java.util.List"
|
||||
column = "venue_id"
|
||||
ofType = "ZdyCinemaMovieVenueItem"
|
||||
select = "selectZdyCinemaMovieVenueItemList"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<resultMap type = "ZdyCinemaMovieVenueItem" id = "ZdyCinemaMovieVenueItemResult">
|
||||
<result property = "itemId" column = "item_id"/>
|
||||
<result property = "hallId" column = "hall_id"/>
|
||||
<result property = "hallName" column = "hallName"/>
|
||||
<result property = "venueId" column = "sub_venue_id"/>
|
||||
<result property = "itemBeginTime" column = "item_begin_time"/>
|
||||
<result property = "itemEndTime" column = "item_end_time"/>
|
||||
<result property = "itemName" column = "item_name"/>
|
||||
<result property = "itemRest" column = "item_rest"/>
|
||||
<result property = "createTime" column = "create_time"/>
|
||||
<result property = "createBy" column = "create_by"/>
|
||||
<result property = "updateTime" column = "update_time"/>
|
||||
<result property = "updateBy" column = "update_by"/>
|
||||
<collection property = "zdyCinemaHallZoneList"
|
||||
javaType = "java.util.List"
|
||||
column = "hall_id"
|
||||
ofType = "ZdyCinemaHallZone"
|
||||
select = "selectZdyCinemaHallZoneList"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type = "ZdyCinemaHallZone" id = "ZdyCinemaHallZoneResult">
|
||||
<result property = "zoneId" column = "zone_id"/>
|
||||
<result property = "hallId" column = "hall_id"/>
|
||||
<result property = "zoneName" column = "zone_name"/>
|
||||
<result property = "seatSet" column = "seat_set"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id = "selectZdyCinemaMovieVenueVo">
|
||||
select a.venue_id,
|
||||
a.movie_id,
|
||||
a.venue_begin_date,
|
||||
a.venue_end_date,
|
||||
a.venue_week,
|
||||
a.venue_rest,
|
||||
a.venue_status,
|
||||
a.create_time,
|
||||
a.create_by,
|
||||
a.update_time,
|
||||
a.update_by
|
||||
from zdy_cinema_movie_venue a
|
||||
</sql>
|
||||
|
||||
<select id = "selectZdyCinemaMovieVenueList" parameterType = "ZdyCinemaMovieVenue" resultMap = "ZdyCinemaMovieVenueResult">
|
||||
<include refid = "selectZdyCinemaMovieVenueVo"/>
|
||||
<where>
|
||||
<if test = "movieId != null ">and a.movie_id = #{movieId}</if>
|
||||
<if test = "venueBeginDate != null and venueEndDate != null ">
|
||||
and (#{venueBeginDate} between a.venue_begin_date and a.venue_end_date
|
||||
or #{venueEndDate} between a.venue_begin_date and a.venue_end_date)
|
||||
</if>
|
||||
<if test = "venueWeek != null and venueWeek != ''">and a.venue_week = #{venueWeek}</if>
|
||||
<if test = "venueRest != null and venueRest != ''">and a.venue_rest = #{venueRest}</if>
|
||||
<if test = "venueStatus != null ">and a.venue_status = #{venueStatus}</if>
|
||||
<if test="params.beginCreateTime != null and params.endCreateTime != null">
|
||||
and a.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
||||
</if>
|
||||
<if test="params.beginUpdateTime != null and params.endUpdateTime != null">
|
||||
and a.update_time between #{params.beginUpdateTime} and #{params.endUpdateTime}
|
||||
</if>
|
||||
</where>
|
||||
order by a.venue_begin_date desc
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyCinemaMovieVenueByVenueId" parameterType = "Long" resultMap = "ZdyCinemaMovieVenueResult">
|
||||
<include refid = "selectZdyCinemaMovieVenueVo"/>
|
||||
where a.venue_id = #{venueId}
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyCinemaMovieVenueItemList" parameterType = "Long"
|
||||
resultMap = "ZdyCinemaMovieVenueItemResult">
|
||||
select b.*,
|
||||
hall.hall_name as hallName
|
||||
from zdy_cinema_movie_venue_item b
|
||||
left join zdy_cinema_hall hall on b.hall_id = hall.hall_id
|
||||
where b.venue_id = #{venueId}
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyCinemaHallZoneList" parameterType = "Long" resultMap = "ZdyCinemaHallZoneResult">
|
||||
select c.*
|
||||
from zdy_cinema_hall_zone c
|
||||
where c.hall_id = #{hallId}
|
||||
</select>
|
||||
|
||||
<insert id = "insertZdyCinemaMovieVenue" parameterType = "ZdyCinemaMovieVenue" useGeneratedKeys = "true" keyProperty = "venueId">
|
||||
insert into zdy_cinema_movie_venue
|
||||
<trim prefix = "(" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "movieId != null">movie_id,</if>
|
||||
<if test = "venueBeginDate != null">venue_begin_date,</if>
|
||||
<if test = "venueEndDate != null">venue_end_date,</if>
|
||||
<if test = "venueWeek != null">venue_week,</if>
|
||||
<if test = "venueRest != null">venue_rest,</if>
|
||||
<if test = "venueStatus != null">venue_status,</if>
|
||||
<if test = "createTime != null">create_time,</if>
|
||||
<if test = "createBy != null">create_by,</if>
|
||||
<if test = "updateTime != null">update_time,</if>
|
||||
<if test = "updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
<trim prefix = "values (" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "movieId != null">#{movieId},</if>
|
||||
<if test = "venueBeginDate != null">#{venueBeginDate},</if>
|
||||
<if test = "venueEndDate != null">#{venueEndDate},</if>
|
||||
<if test = "venueWeek != null">#{venueWeek},</if>
|
||||
<if test = "venueRest != null">#{venueRest},</if>
|
||||
<if test = "venueStatus != null">#{venueStatus},</if>
|
||||
<if test = "createTime != null">#{createTime},</if>
|
||||
<if test = "createBy != null">#{createBy},</if>
|
||||
<if test = "updateTime != null">#{updateTime},</if>
|
||||
<if test = "updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id = "updateZdyCinemaMovieVenue" parameterType = "ZdyCinemaMovieVenue">
|
||||
update zdy_cinema_movie_venue
|
||||
<trim prefix = "SET" suffixOverrides = ",">
|
||||
<if test = "movieId != null">movie_id = #{movieId},</if>
|
||||
<if test = "venueBeginDate != null">venue_begin_date = #{venueBeginDate},</if>
|
||||
<if test = "venueEndDate != null">venue_end_date = #{venueEndDate},</if>
|
||||
<if test = "venueWeek != null">venue_week = #{venueWeek},</if>
|
||||
<if test = "venueRest != null">venue_rest = #{venueRest},</if>
|
||||
<if test = "venueStatus != null">venue_status = #{venueStatus},</if>
|
||||
<if test = "createTime != null">create_time = #{createTime},</if>
|
||||
<if test = "createBy != null">create_by = #{createBy},</if>
|
||||
<if test = "updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test = "updateBy != null">update_by = #{updateBy},</if>
|
||||
</trim>
|
||||
where venue_id = #{venueId}
|
||||
</update>
|
||||
|
||||
<delete id = "deleteZdyCinemaMovieVenueByVenueId" parameterType = "Long">
|
||||
delete
|
||||
from zdy_cinema_movie_venue
|
||||
where venue_id = #{venueId}
|
||||
</delete>
|
||||
|
||||
<delete id = "deleteZdyCinemaMovieVenueByVenueIds" parameterType = "String">
|
||||
delete from zdy_cinema_movie_venue where venue_id in
|
||||
<foreach item = "venueId" collection = "array" open = "(" separator = "," close = ")">
|
||||
#{venueId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id = "deleteZdyCinemaMovieVenueItemByItemIds" parameterType = "String">
|
||||
delete from zdy_cinema_movie_venue_item where item_id in
|
||||
<foreach item = "itemId" collection = "array" open = "(" separator = "," close = ")">
|
||||
#{itemId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id = "deleteZdyCinemaMovieVenueItemByItemId" parameterType = "Long">
|
||||
delete
|
||||
from zdy_cinema_movie_venue_item
|
||||
where venue_id = #{venueId}
|
||||
</delete>
|
||||
|
||||
<insert id = "batchZdyCinemaMovieVenueItem">
|
||||
insert into zdy_cinema_movie_venue_item (hall_id , venue_id , item_begin_time , item_end_time , item_name
|
||||
,item_rest,venue_seats,seat_nums,create_time,create_by,update_time,update_by) values
|
||||
<foreach item = "item" index = "index" collection = "list" separator = ",">
|
||||
(#{item.hallId},#{item.venueId},#{item.itemBeginTime},#{item.itemEndTime},#{item.itemName},
|
||||
#{item.itemRest},#{item.venueSeats},#{item.seatNums},#{item.createTime},#{item.createBy},
|
||||
#{item.updateTime},#{item.updateBy})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
@@ -0,0 +1,285 @@
|
||||
<?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.zhwl.cinema.mapper.ZdyCinemaSaleTempMapper">
|
||||
|
||||
<resultMap type = "ZdyCinemaSaleTemp" id = "ZdyCinemaSaleTempResult">
|
||||
<result property = "id" column = "id"/>
|
||||
<result property = "tikcetId" column = "tikcet_id"/>
|
||||
<result property = "movieId" column = "movie_id"/>
|
||||
<result property = "venueId" column = "venue_id"/>
|
||||
<result property = "itemId" column = "item_id"/>
|
||||
<result property = "hallId" column = "hall_id"/>
|
||||
<result property = "zoneId" column = "zone_id"/>
|
||||
<result property = "priceId" column = "price_id"/>
|
||||
<result property = "salePrice" column = "sale_price"/>
|
||||
<result property = "rowNum" column = "row_num"/>
|
||||
<result property = "seatNum" column = "seat_num"/>
|
||||
<result property = "seatState" column = "seat_state"/>
|
||||
<result property = "lockSeat" column = "lock_seat"/>
|
||||
<result property = "saleTime" column = "sale_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id = "selectZdyCinemaSaleTempVo">
|
||||
select id,
|
||||
tikcet_id,
|
||||
movie_id,
|
||||
venue_id,
|
||||
item_id,
|
||||
hall_id,
|
||||
zone_id,
|
||||
price_id,
|
||||
sale_price,
|
||||
row_num,
|
||||
seat_num,
|
||||
sale_time,
|
||||
lock_seat,
|
||||
seat_state
|
||||
from zdy_cinema_sale_temp
|
||||
</sql>
|
||||
|
||||
<select id = "selectZdyCinemaSaleTempList" parameterType = "ZdyCinemaSaleTemp" resultMap = "ZdyCinemaSaleTempResult">
|
||||
<include refid = "selectZdyCinemaSaleTempVo"/>
|
||||
<where>
|
||||
<if test = "tikcetId != null ">and tikcet_id = #{tikcetId}</if>
|
||||
<if test = "movieId != null ">and movie_id = #{movieId}</if>
|
||||
<if test = "venueId != null ">and venue_id = #{venueId}</if>
|
||||
<if test = "itemId != null ">and item_id = #{itemId}</if>
|
||||
<if test = "hallId != null ">and hall_id = #{hallId}</if>
|
||||
<if test = "zoneId != null ">and zone_id = #{zoneId}</if>
|
||||
<if test = "priceId != null ">and price_id = #{priceId}</if>
|
||||
<if test = "salePrice != null ">and sale_price = #{salePrice}</if>
|
||||
<if test = "rowNum != null ">and row_num = #{rowNum}</if>
|
||||
<if test = "seatNum != null ">and seat_num = #{seatNum}</if>
|
||||
<if test = "seatState != null ">and seat_state = #{seatState}</if>
|
||||
<if test = "saleTime != null ">and sale_time = #{saleTime}</if>
|
||||
</where>
|
||||
order by row_num, id
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyCinemaSaleTempById" parameterType = "Long" resultMap = "ZdyCinemaSaleTempResult">
|
||||
<include refid = "selectZdyCinemaSaleTempVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyCinemaSaleTempByIds" parameterType = "String" resultMap = "ZdyCinemaSaleTempResult">
|
||||
<include refid = "selectZdyCinemaSaleTempVo"/>
|
||||
where id in
|
||||
<foreach item = "id" collection = "ids" open = "(" separator = "," close = ")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<insert id = "insertZdyCinemaSaleTemp" parameterType = "ZdyCinemaSaleTemp" useGeneratedKeys = "true" keyProperty = "id">
|
||||
insert into zdy_cinema_sale_temp
|
||||
<trim prefix = "(" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "tikcetId != null">tikcet_id,</if>
|
||||
<if test = "movieId != null">movie_id,</if>
|
||||
<if test = "venueId != null">venue_id,</if>
|
||||
<if test = "itemId != null">item_id,</if>
|
||||
<if test = "hallId != null">hall_id,</if>
|
||||
<if test = "zoneId != null">zone_id,</if>
|
||||
<if test = "priceId != null">price_id,</if>
|
||||
<if test = "salePrice != null">sale_price,</if>
|
||||
<if test = "rowNum != null">row_num,</if>
|
||||
<if test = "seatNum != null">seat_num,</if>
|
||||
<if test = "seatState != null">seat_state,</if>
|
||||
<if test = "saleTime != null">sale_time,</if>
|
||||
</trim>
|
||||
<trim prefix = "values (" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "tikcetId != null">#{tikcetId},</if>
|
||||
<if test = "movieId != null">#{movieId},</if>
|
||||
<if test = "venueId != null">#{venueId},</if>
|
||||
<if test = "itemId != null">#{itemId},</if>
|
||||
<if test = "hallId != null">#{hallId},</if>
|
||||
<if test = "zoneId != null">#{zoneId},</if>
|
||||
<if test = "priceId != null">#{priceId},</if>
|
||||
<if test = "salePrice != null">#{salePrice},</if>
|
||||
<if test = "rowNum != null">#{rowNum},</if>
|
||||
<if test = "seatNum != null">#{seatNum},</if>
|
||||
<if test = "seatState != null">#{seatState},</if>
|
||||
<if test = "saleTime != null">#{saleTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id = "updateZdyCinemaSaleTemp" parameterType = "ZdyCinemaSaleTemp">
|
||||
update zdy_cinema_sale_temp
|
||||
<trim prefix = "SET" suffixOverrides = ",">
|
||||
<if test = "tikcetId != null">tikcet_id = #{tikcetId},</if>
|
||||
<if test = "movieId != null">movie_id = #{movieId},</if>
|
||||
<if test = "venueId != null">venue_id = #{venueId},</if>
|
||||
<if test = "itemId != null">item_id = #{itemId},</if>
|
||||
<if test = "hallId != null">hall_id = #{hallId},</if>
|
||||
<if test = "zoneId != null">zone_id = #{zoneId},</if>
|
||||
<if test = "priceId != null">price_id = #{priceId},</if>
|
||||
<if test = "salePrice != null">sale_price = #{salePrice},</if>
|
||||
<if test = "rowNum != null">row_num = #{rowNum},</if>
|
||||
<if test = "seatNum != null">seat_num = #{seatNum},</if>
|
||||
<if test = "seatState != null">seat_state = #{seatState},</if>
|
||||
<if test = "saleTime != null">sale_time = #{saleTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id = "deleteZdyCinemaSaleTempById" parameterType = "Long">
|
||||
delete
|
||||
from zdy_cinema_sale_temp
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id = "deleteZdyCinemaSaleTempByIds" parameterType = "String">
|
||||
delete from zdy_cinema_sale_temp where id in
|
||||
<foreach item = "id" collection = "array" open = "(" separator = "," close = ")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id = "batchZdyCinemaSaleTemp">
|
||||
insert into zdy_cinema_sale_temp (tikcet_id, movie_id, venue_id, item_id, hall_id, zone_id, price_id,
|
||||
sale_price, row_num, seat_num, seat_state, sale_time) values
|
||||
<foreach item = "item" index = "index" collection = "list" separator = ",">
|
||||
(#{item.tikcetId}, #{item.movieId}, #{item.venueId}, #{item.itemId}, #{item.hallId}, #{item.zoneId},
|
||||
#{item.priceId}, #{item.salePrice}, #{item.rowNum}, #{item.seatNum}, #{item.seatState}, #{item.saleTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
<!-- 付款成功后更新售价 -->
|
||||
<update id = "updateSalePrice" parameterType = "ZdyCinemaSaleTemp">
|
||||
update zdy_cinema_sale_temp
|
||||
set sale_price = #{salePrice},update_time = sysdate()
|
||||
where tikcet_id = #{tikcetId}
|
||||
and movie_id = #{movieId}
|
||||
and item_id = #{itemId}
|
||||
and zone_id = #{zoneId}
|
||||
and price_id = #{priceId}
|
||||
and row_num = #{rowNum}
|
||||
and seat_num = #{seatNum}
|
||||
and sale_time = #{saleTime}
|
||||
</update>
|
||||
<!-- 现金支付,直接修改为已售(窗口售票) -->
|
||||
<update id = "paySaleSeat" parameterType = "ZdyCinemaSaleTemp">
|
||||
update zdy_cinema_sale_temp
|
||||
set
|
||||
seat_state = 3,
|
||||
<if test="updateBy != null">
|
||||
update_by = #{updateBy},
|
||||
</if>
|
||||
update_time = sysdate()
|
||||
where seat_state = 1 and lock_seat = 1 and id in
|
||||
<foreach item = "id" collection = "ids" open = "(" separator = "," close = ")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
<!-- 占座(窗口售票) -->
|
||||
<update id = "holdSeat" parameterType = "ZdyCinemaSaleTemp">
|
||||
update zdy_cinema_sale_temp set seat_state = 2,update_by = #{updateBy},update_time = sysdate() where seat_state
|
||||
= 1 and lock_seat = 0 and id in
|
||||
<foreach item = "id" collection = "ids" open = "(" separator = "," close = ")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
<!-- 解除占座(窗口售票) -->
|
||||
<update id = "unholdSeat" parameterType = "ZdyCinemaSaleTemp">
|
||||
update zdy_cinema_sale_temp set seat_state = 1,update_by = #{updateBy},update_time = sysdate() where seat_state
|
||||
= 2 and id in
|
||||
<foreach item = "id" collection = "ids" open = "(" separator = "," close = ")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
<!-- 支付锁定(窗口售票) -->
|
||||
<update id = "payLockSeat" parameterType = "ZdyCinemaSaleTemp">
|
||||
update zdy_cinema_sale_temp set lock_seat = 1,update_by = #{updateBy},update_time = sysdate() where seat_state =
|
||||
1 and lock_seat = 0 and id in
|
||||
<foreach item = "id" collection = "ids" open = "(" separator = "," close = ")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
<!-- 支付超时解锁(窗口售票) -->
|
||||
<update id = "overtimeUnLockSeat" parameterType = "ZdyCinemaSaleTemp">
|
||||
update zdy_cinema_sale_temp set lock_seat = 0,update_time = sysdate() where seat_state = 1 and lock_seat = 1 and
|
||||
id in
|
||||
<foreach item = "id" collection = "ids" open = "(" separator = "," close = ")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
<!-- 支付超时解锁(窗口售票) -->
|
||||
<update id = "overtimeUnLockSeatById" parameterType="java.lang.Long">
|
||||
update zdy_cinema_sale_temp set lock_seat = 0,update_time = sysdate() where seat_state = 1 and lock_seat = 1 and
|
||||
id = #{id}
|
||||
</update>
|
||||
<!-- 支付成功解锁 -->
|
||||
<update id = "payUnLockSeat" parameterType = "ZdyCinemaSaleTemp">
|
||||
update zdy_cinema_sale_temp set lock_seat = 0,seat_state = 3 ,update_time = sysdate() where seat_state = 1 and
|
||||
lock_seat = 1 and id in
|
||||
<foreach item = "id" collection = "ids" open = "(" separator = "," close = ")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
<update id = "refundUnLockSeat" parameterType = "ZdyCinemaSaleTemp">
|
||||
update zdy_cinema_sale_temp
|
||||
set lock_seat = 0,
|
||||
seat_state = 1 ,
|
||||
update_by = #{updateBy},
|
||||
update_time = sysdate()
|
||||
where seat_state = 3
|
||||
and tikcet_id = #{ticketId}
|
||||
and item_id = #{itemId}
|
||||
and row_num = #{rowNum}
|
||||
and seat_num = #{seatNum}
|
||||
and zone_id = #{zoneId}
|
||||
and DATE(sale_time) = DATE(#{saleTime})
|
||||
</update>
|
||||
|
||||
<select id="isAnyItemOnSale" resultType="Integer">
|
||||
select exists(
|
||||
select 1
|
||||
from zdy_cinema_sale_temp
|
||||
where item_id in
|
||||
<foreach item="itemId" collection="array" open="(" separator="," close=")">
|
||||
#{itemId}
|
||||
</foreach>
|
||||
and (seat_state in (2, 3) or lock_seat = 1)
|
||||
)
|
||||
</select>
|
||||
|
||||
<select id="isHallOnSale" parameterType="Long" resultType="java.lang.Boolean">
|
||||
select exists(select 1
|
||||
from zdy_cinema_sale_temp
|
||||
where hall_id = #{hallId}
|
||||
and (seat_state in (2, 3) or lock_seat = 1))
|
||||
</select>
|
||||
|
||||
<select id="isAnyHallOnSale" parameterType="Long" resultType="java.lang.Boolean">
|
||||
select exists(select 1
|
||||
from zdy_cinema_sale_temp
|
||||
where hall_id in
|
||||
<foreach item="hallId" collection="array" open="(" separator="," close=")">
|
||||
#{hallId}
|
||||
</foreach>
|
||||
and (seat_state in (2, 3) or lock_seat = 1))
|
||||
</select>
|
||||
|
||||
<select id="lock" resultMap="ZdyCinemaSaleTempResult">
|
||||
select * from zdy_cinema_sale_temp
|
||||
where id in
|
||||
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
for update
|
||||
</select>
|
||||
|
||||
<select id="isMovieOnSale" parameterType="java.lang.Long" resultType="java.lang.Boolean">
|
||||
select exists(select 1
|
||||
from zdy_cinema_sale_temp
|
||||
where movie_id = #{movieId}
|
||||
and (seat_state in (2, 3) or lock_seat = 1))
|
||||
</select>
|
||||
|
||||
<select id="isAnyMovieOnSale" resultType="java.lang.Boolean">
|
||||
select exists(select 1
|
||||
from zdy_cinema_sale_temp
|
||||
where movie_id in
|
||||
<foreach item="movieId" collection="movieIds" open="(" separator="," close=")">
|
||||
#{movieId}
|
||||
</foreach>
|
||||
and (seat_state in (2, 3) or lock_seat = 1))
|
||||
</select>
|
||||
</mapper>
|
@@ -0,0 +1,343 @@
|
||||
<?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.zhwl.cinema.mapper.ZdyCinemaTicketMapper">
|
||||
|
||||
<resultMap type = "ZdyCinemaTicket" id = "ZdyCinemaTicketResult">
|
||||
<result property = "ticketId" column = "ticket_id"/>
|
||||
<result property = "movieId" column = "movie_id"/>
|
||||
<result property = "movieName" column = "movieName"/>
|
||||
<result property = "movieLength" column = "movieLength"/>
|
||||
<result property = "movieCategory" column = "movieCategory"/>
|
||||
<result property = "movieIntroduction" column = "movieIntroduction"/>
|
||||
<result property = "moviePerformer" column = "movie_performer"/>
|
||||
<result property = "cpsm" column = "cpsm"/>
|
||||
<result property = "qpxx" column = "qpxx"/>
|
||||
<result property = "sysm" column = "sysm"/>
|
||||
<result property = "wxts" column = "wxts"/>
|
||||
|
||||
<result property = "id" column = "id"/>
|
||||
<result property = "name" column = "name"/>
|
||||
<result property = "scenicId" column = "scenic_id"/>
|
||||
<result property = "salesRice" column = "sales_rice"/>
|
||||
<result property = "price" column = "price"/>
|
||||
<result property = "image" column = "image"/>
|
||||
<result property = "classify" column = "classify"/>
|
||||
<result property = "groundingFlag" column = "grounding_flag"/>
|
||||
<result property = "createTime" column = "create_time"/>
|
||||
<result property = "createBy" column = "create_by"/>
|
||||
<result property = "updateTime" column = "update_time"/>
|
||||
<result property = "updateBy" column = "update_by"/>
|
||||
<result property = "remark" column = "remark"/>
|
||||
<result property = "scenicName" column = "scenic_name"/>
|
||||
<result property = "delFlag" column = "del_flag"/>
|
||||
<result property = "inventory" column = "inventory"/>
|
||||
<result property = "flag" column = "flag"/>
|
||||
<result property = "minPrice" column = "minPrice"/>
|
||||
<result property = "refundRule" column = "refund_rule"/>
|
||||
<result property = "refundRuleName" column = "refundRuleName"/>
|
||||
<result property = "isFee" column = "is_fee"/>
|
||||
<result property = "classifyName" column = "classifyName"/>
|
||||
<result property = "isOrder" column = "is_order"/>
|
||||
<result property = "validityStartTime" column = "validity_start_time"/>
|
||||
<result property = "validityEndTime" column = "validity_end_time"/>
|
||||
<result property = "groupId" column = "group_id"/>
|
||||
<result property = "bookingNotice" column = "booking_notice"/>
|
||||
<result property = "beforeDay" column = "before_day"/>
|
||||
<result property = "isOrderQuantity" column = "is_order_quantity"/>
|
||||
<result property = "orderQuantity" column = "order_quantity"/>
|
||||
<result property = "authenticationType" column = "authentication_type"/>
|
||||
<result property = "verifySettings" column = "verify_settings"/>
|
||||
<result property = "isPurchaseDate" column = "is_purchase_date"/>
|
||||
<result property = "purchStartDate" column = "purch_start_date"/>
|
||||
<result property = "purchEndDate" column = "purch_end_date"/>
|
||||
<result property = "ticketValidityPeriod" column = "ticket_validity_period"/>
|
||||
<result property = "buyPeriodDay" column = "buy_period_day"/>
|
||||
<result property = "adjust" column = "adjust"/>
|
||||
<result property = "groupName" column = "groupName"/>
|
||||
<result property = "groupId" column = "group_id"/>
|
||||
<result property = "classifyName" column = "classifyName"/>
|
||||
<result property = "admissionAddress" column = "admission_address"/>
|
||||
<result property = "admissionTime" column = "admission_time"/>
|
||||
<result property = "sales" column = "sales"/>
|
||||
<result property = "image11" column = "image11"/>
|
||||
<result property = "image43" column = "image43"/>
|
||||
<result property = "feeType" column = "fee_type"/>
|
||||
<result property = "deductionFees" column = "deduction_fees"/>
|
||||
<result property = "deductionFeesUnit" column = "deduction_fees_unit"/>
|
||||
<result property = "refundDay" column = "refund_day"/>
|
||||
<result property = "qrcodeRule" column = "qrcode_rule"/>
|
||||
<result property = "isRefundCheck" column = "is_refund_check"/>
|
||||
<result property = "isReservation" column = "is_reservation"/>
|
||||
<result property = "applicablePeriod" column = "applicable_period"/>
|
||||
<result property = "sort" column = "sort"/>
|
||||
<result property = "saleResource" column = "sale_resource"/>
|
||||
<collection property = "childList"
|
||||
javaType = "java.util.List"
|
||||
column = "ticket_id"
|
||||
ofType = "ZdyTicketChild"
|
||||
select = "selectTicketChildList"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type = "ZdyTicketChild" id = "childResult">
|
||||
<result property = "ticketId" column = "ticket"/>
|
||||
<result property = "childTicketId" column = "child_ticket_id"/>
|
||||
<result property = "childTicketName" column = "child_ticket_name"/>
|
||||
<result property = "canVerificationNum" column = "can_verification_num"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type = "WindowTicketVo" id = "WindowTicketVoResult">
|
||||
<result property = "id" column = "id"/>
|
||||
<result property = "ticketId" column = "ticketId"/>
|
||||
<result property = "ticketName" column = "ticketName"/>
|
||||
<result property = "movieId" column = "movie_id"/>
|
||||
<result property = "movieName" column = "movie_name"/>
|
||||
<result property = "movieLength" column = "movie_length"/>
|
||||
<result property = "movieCategory" column = "movie_category"/>
|
||||
<result property = "venueId" column = "venue_id"/>
|
||||
<result property = "venueBeginDate" column = "venue_begin_date"/>
|
||||
<result property = "venueEndDate" column = "venue_end_date"/>
|
||||
<result property = "venueWeek" column = "venue_week"/>
|
||||
<result property = "venueRest" column = "venue_rest"/>
|
||||
<collection property = "childList" javaType = "java.util.List" resultMap = "childResult"/>
|
||||
<collection property = "itemList" javaType = "java.util.List" resultMap = "WindowItemVoResult"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type = "WindowItemVo" id = "WindowItemVoResult">
|
||||
<result property = "itemId" column = "item_id"/>
|
||||
<result property = "hallId" column = "hall_id"/>
|
||||
<result property = "hallName" column = "hallName"/>
|
||||
<result property = "itemBeginTime" column = "item_begin_time"/>
|
||||
<result property = "itemEndTime" column = "item_end_time"/>
|
||||
<result property = "itemName" column = "item_name"/>
|
||||
<result property = "itemRest" column = "item_rest"/>
|
||||
<result property = "venueSeats" column = "venue_seats"/>
|
||||
<result property = "seatNums" column = "seat_nums"/>
|
||||
<result property = "saleNums" column = "sale_nums"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id = "selectZdyCinemaTicketVo">
|
||||
select a.ticket_id,
|
||||
a.movie_id,
|
||||
movie.movie_name as movieName,
|
||||
movie.movie_length as movieLength,
|
||||
movie.movie_category as movieCategory,
|
||||
movie.movie_introduction as movieIntroduction,
|
||||
movie.movie_performer,
|
||||
a.qpxx,
|
||||
a.cpsm,
|
||||
a.sysm,
|
||||
a.wxts,
|
||||
ticket.id,
|
||||
ticket.NAME,
|
||||
ticket.sales_rice,
|
||||
ticket.price,
|
||||
ticket.image,
|
||||
ticket.classify,
|
||||
ticket.grounding_flag,
|
||||
ticket.create_time,
|
||||
ticket.create_by,
|
||||
ticket.update_time,
|
||||
ticket.update_by,
|
||||
ticket.remark,
|
||||
ticket.del_flag,
|
||||
ticket.inventory,
|
||||
ticket.flag,
|
||||
ticket.refund_rule,
|
||||
ticket.is_fee,
|
||||
ticket.is_order,
|
||||
ticket.validity_start_time,
|
||||
ticket.validity_end_time,
|
||||
ticket.booking_notice,
|
||||
ticket.group_id,
|
||||
ticket.before_day,
|
||||
ticket.is_order_quantity,
|
||||
ticket.order_quantity,
|
||||
ticket.authentication_type,
|
||||
ticket.verify_settings,
|
||||
ticket.is_purchase_date,
|
||||
ticket.purch_start_date,
|
||||
ticket.purch_end_date,
|
||||
ticket.ticket_validity_period,
|
||||
ticket.buy_period_day,
|
||||
ticket.admission_address,
|
||||
ticket.admission_time,
|
||||
ticket.sales,
|
||||
ticket.image43,
|
||||
ticket.image11,
|
||||
ticket.fee_type,
|
||||
ticket.deduction_fees,
|
||||
ticket.deduction_fees_unit,
|
||||
ticket.refund_day,
|
||||
ticket.qrcode_rule,
|
||||
ticket.is_refund_check,
|
||||
ticket.is_reservation,
|
||||
ticket.applicable_period,
|
||||
ticket.sale_resource,
|
||||
ticket.sort
|
||||
from zdy_cinema_ticket a
|
||||
left join zdy_ticket ticket on a.ticket_id = ticket.id
|
||||
left join zdy_cinema_movie movie on a.movie_id = movie.movie_id
|
||||
</sql>
|
||||
|
||||
<select id = "selectZdyCinemaTicketList" parameterType = "ZdyCinemaTicket" resultMap = "ZdyCinemaTicketResult">
|
||||
<include refid = "selectZdyCinemaTicketVo"/>
|
||||
<where>
|
||||
ticket.classify = 3
|
||||
<if test = "name != null and name != ''">
|
||||
and ticket.name like concat('%', #{name}, '%')
|
||||
</if>
|
||||
<if test = "movieName != null and movieName != ''">
|
||||
and movie.movie_name like concat('%', #{movieName}, '%')
|
||||
</if>
|
||||
<if test = "classify != null and classify != ''">and ticket.classify = #{classify}</if>
|
||||
<if test = "groundingFlag != null">and ticket.grounding_flag = #{groundingFlag}</if>
|
||||
<if test = "saleResource != null and saleResource != ''">AND FIND_IN_SET( #{saleResource},ticket.sale_resource)</if>
|
||||
<if test = "id != null">and ticket.id = #{id}</if>
|
||||
<if test = "childTicketId != null">and ticket.id in (
|
||||
select ticket_id from zdy_ticket_child where child_ticket_id = #{childTicketId}
|
||||
)
|
||||
</if>
|
||||
<if test = "createTimeStart != null ">and ticket.create_time >= #{createTimeStart}</if>
|
||||
<if test = "createTimeEnd != null ">and ticket.create_time <= #{createTimeEnd}</if>
|
||||
<if test = "updateTimeStart != null ">and ticket.update_time >= #{updateTimeStart}</if>
|
||||
<if test = "updateTimeEnd != null ">and ticket.update_time <= #{updateTimeEnd}</if>
|
||||
</where>
|
||||
order by ticket.update_time desc
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyCinemaTicketById" parameterType = "Long" resultMap = "ZdyCinemaTicketResult">
|
||||
<include refid = "selectZdyCinemaTicketVo"/>
|
||||
where ticket.id = #{id} and ticket.classify = 3
|
||||
</select>
|
||||
|
||||
<insert id = "insertZdyCinemaTicket" parameterType = "ZdyCinemaTicket" useGeneratedKeys = "true" keyProperty = "id">
|
||||
insert into zdy_cinema_ticket
|
||||
<trim prefix = "(" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "ticketId != null">ticket_id,</if>
|
||||
<if test = "movieId != null">movie_id,</if>
|
||||
<if test = "cpsm != null">cpsm,</if>
|
||||
<if test = "qpxx != null">qpxx,</if>
|
||||
<if test = "sysm != null">sysm,</if>
|
||||
<if test = "wxts != null">wxts,</if>
|
||||
</trim>
|
||||
<trim prefix = "values (" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "ticketId != null">#{ticketId},</if>
|
||||
<if test = "movieId != null">#{movieId},</if>
|
||||
<if test = "cpsm != null">#{cpsm},</if>
|
||||
<if test = "qpxx != null">#{qpxx},</if>
|
||||
<if test = "sysm != null">#{sysm},</if>
|
||||
<if test = "wxts != null">#{wxts},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id = "updateZdyCinemaTicket" parameterType = "ZdyCinemaTicket">
|
||||
update zdy_cinema_ticket
|
||||
<trim prefix = "SET" suffixOverrides = ",">
|
||||
<if test = "ticketId != null">ticket_id = #{ticketId},</if>
|
||||
<if test = "movieId != null">movie_id = #{movieId},</if>
|
||||
<if test = "cpsm != null">cpsm = #{cpsm},</if>
|
||||
<if test = "qpxx != null">qpxx = #{qpxx},</if>
|
||||
<if test = "sysm != null">sysm = #{sysm},</if>
|
||||
<if test = "wxts != null">wxts = #{wxts},</if>
|
||||
</trim>
|
||||
where ticket_id = #{ticketId}
|
||||
</update>
|
||||
|
||||
<delete id = "deleteZdyCinemaTicketById" parameterType = "Long">
|
||||
delete
|
||||
from zdy_cinema_ticket
|
||||
where ticket_id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id = "deleteZdyCinemaTicketByIds" parameterType = "String">
|
||||
delete from zdy_cinema_ticket where id in
|
||||
<foreach item = "id" collection = "array" open = "(" separator = "," close = ")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<sql id = "selectWindowTicketListVo">
|
||||
select cinema.id,
|
||||
ticket.id as ticketId,
|
||||
ticket.name as ticketName,
|
||||
movie.movie_id,
|
||||
movie.movie_name,
|
||||
movie.movie_length,
|
||||
movie.movie_category,
|
||||
child.ticket_id as ticket_id,
|
||||
child.child_ticket_id as child_ticket_id,
|
||||
child.child_ticket_name as child_ticket_name,
|
||||
child.can_verification_num as can_verification_num,
|
||||
venue.venue_id,
|
||||
venue.venue_begin_date,
|
||||
venue.venue_end_date,
|
||||
venue.venue_week,
|
||||
venue.venue_rest,
|
||||
item.item_id,
|
||||
item.hall_id,
|
||||
zch.hall_name as hallName,
|
||||
item.item_begin_time,
|
||||
item.item_end_time,
|
||||
item.item_name,
|
||||
item.item_rest,
|
||||
item.venue_seats,
|
||||
item.sale_nums,
|
||||
item.seat_nums
|
||||
from zdy_cinema_ticket cinema
|
||||
left join zdy_ticket ticket on cinema.ticket_id = ticket.id
|
||||
left join zdy_cinema_movie movie on cinema.movie_id = movie.movie_id
|
||||
left join zdy_ticket_child child on cinema.ticket_id = child.ticket_id
|
||||
left join zdy_cinema_movie_venue venue on cinema.movie_id = venue.movie_id
|
||||
left join zdy_cinema_movie_venue_item item on venue.venue_id = item.venue_id
|
||||
left join zdy_cinema_hall zch on item.hall_id = zch.hall_id
|
||||
</sql>
|
||||
|
||||
<select id = "selectWindowTicketList" parameterType = "WindowTicketVo" resultMap = "WindowTicketVoResult">
|
||||
<include refid = "selectWindowTicketListVo"/>
|
||||
where ticket.classify = 3 and venue.venue_status = 1
|
||||
AND movie.movie_status = 1
|
||||
AND movie.del_state = 0
|
||||
AND ticket.grounding_flag = 1
|
||||
and EXISTS (
|
||||
SELECT 1
|
||||
FROM zdy_cinema_ticket_price zctp
|
||||
WHERE item.item_id = zctp.item_id
|
||||
)
|
||||
<if test = "id != null and id != ''">
|
||||
and ticket.id =#{id}
|
||||
</if>
|
||||
<if test = "ticketName != null and ticketName != ''">
|
||||
and ticket.name like concat('%', #{ticketName}, '%')
|
||||
</if>
|
||||
<if test = "searchTime != null ">
|
||||
and #{searchTime} between venue.venue_begin_date and venue.venue_end_date
|
||||
</if>
|
||||
<if test = "searchTime != null ">
|
||||
and item.item_rest not like concat('%',DATE_FORMAT(#{searchTime}, '%Y-%m-%d'),'%')
|
||||
</if>
|
||||
ORDER BY venue.venue_begin_date,item.item_begin_time
|
||||
</select>
|
||||
|
||||
<select id = "selectTicketChildList" parameterType = "Long" resultMap = "childResult">
|
||||
select child.*
|
||||
from zdy_ticket_child child
|
||||
where child.ticket_id = #{ticketId}
|
||||
</select>
|
||||
|
||||
<select id = "selectWindowTicketByTicketId" parameterType = "WindowTicketVo" resultMap = "WindowTicketVoResult">
|
||||
<include refid = "selectWindowTicketListVo"/>
|
||||
where ticket.classify = 3 and venue.venue_status = 1
|
||||
<if test = "id != null and id != ''">
|
||||
and ticket.id =#{id}
|
||||
</if>
|
||||
<if test = "searchTime != null ">
|
||||
and #{searchTime} between venue.venue_begin_date and venue.venue_end_date
|
||||
</if>
|
||||
<if test = "searchTime != null ">
|
||||
and item.item_rest not like concat('%',DATE_FORMAT(#{searchTime}, '%Y-%m-%d'),'%')
|
||||
</if>
|
||||
ORDER BY venue.venue_begin_date,item.item_begin_time
|
||||
</select>
|
||||
|
||||
</mapper>
|
@@ -0,0 +1,87 @@
|
||||
<?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.zhwl.cinema.mapper.ZdyCinemaTicketPriceMapper">
|
||||
|
||||
<resultMap type = "ZdyCinemaTicketPrice" id = "ZdyCinemaTicketPriceResult">
|
||||
<result property = "id" column = "id"/>
|
||||
<result property = "itemId" column = "item_id"/>
|
||||
<result property = "zoneId" column = "zone_id"/>
|
||||
<result property = "price" column = "price"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id = "selectZdyCinemaTicketPriceVo">
|
||||
select id,
|
||||
zone_id,
|
||||
item_id,
|
||||
price
|
||||
from zdy_cinema_ticket_price
|
||||
</sql>
|
||||
|
||||
<select id = "selectZdyCinemaTicketPriceList" parameterType = "ZdyCinemaTicketPrice" resultMap = "ZdyCinemaTicketPriceResult">
|
||||
<include refid = "selectZdyCinemaTicketPriceVo"/>
|
||||
<where>
|
||||
<if test = "zoneId != null ">and zone_id = #{zoneId}</if>
|
||||
<if test = "itemId != null ">and item_id = #{itemId}</if>
|
||||
<if test = "price != null ">and price = #{price}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id = "selectZdyCinemaTicketPriceById" parameterType = "Long" resultMap = "ZdyCinemaTicketPriceResult">
|
||||
<include refid = "selectZdyCinemaTicketPriceVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id = "insertZdyCinemaTicketPrice" parameterType = "ZdyCinemaTicketPrice" useGeneratedKeys = "true" keyProperty = "id">
|
||||
insert into zdy_cinema_ticket_price
|
||||
<trim prefix = "(" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "zoneId != null">zone_id,</if>
|
||||
<if test = "itemId != null">item_id,</if>
|
||||
<if test = "price != null">price,</if>
|
||||
</trim>
|
||||
<trim prefix = "values (" suffix = ")" suffixOverrides = ",">
|
||||
<if test = "zoneId != null">#{zoneId},</if>
|
||||
<if test = "itemId != null">#{itemId},</if>
|
||||
<if test = "price != null">#{price},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id = "updateZdyCinemaTicketPrice" parameterType = "ZdyCinemaTicketPrice">
|
||||
update zdy_cinema_ticket_price
|
||||
<trim prefix = "SET" suffixOverrides = ",">
|
||||
<if test = "zoneId != null">zone_id = #{zoneId},</if>
|
||||
<if test = "itemId != null">item_id = #{itemId},</if>
|
||||
<if test = "price != null">price = #{price},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id = "deleteZdyCinemaTicketPriceById" parameterType = "Long">
|
||||
delete
|
||||
from zdy_cinema_ticket_price
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id = "deleteZdyCinemaTicketPriceByIds" parameterType = "String">
|
||||
delete from zdy_cinema_ticket_price where id in
|
||||
<foreach item = "id" collection = "array" open = "(" separator = "," close = ")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id = "batchZdyCinemaTicketPrice">
|
||||
insert into zdy_cinema_ticket_price (zone_id,item_id, price) values
|
||||
<foreach item = "item" index = "index" collection = "list" separator = ",">
|
||||
( #{item.zoneId},#{item.itemId},#{item.price})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="existsPrice" parameterType="java.lang.Long" resultType="java.lang.Boolean">
|
||||
SELECT EXISTS(
|
||||
SELECT 1 FROM zdy_cinema_ticket_price zctp
|
||||
LEFT JOIN zdy_cinema_movie_venue_item zcmvi on zcmvi.item_id = zctp.item_id
|
||||
LEFT JOIN zdy_cinema_movie_venue zcmv on zcmvi.venue_id = zcmv.venue_id
|
||||
LEFT JOIN zdy_cinema_movie zcm on zcm.movie_id = zcmv.movie_id
|
||||
LEFT JOIN zdy_cinema_ticket zct on zcm.movie_id = zct.movie_id
|
||||
WHERE zct.ticket_id = #{id})
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user