343 lines
16 KiB
XML
343 lines
16 KiB
XML
|
<?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>
|