2024-02-25 11:18:52 +08:00
|
|
|
<?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.ics.admin.mapper.meeting.ReservationMapper">
|
|
|
|
|
|
|
|
<resultMap type="com.ics.admin.domain.meeting.Reservation" id="ReservationResult">
|
|
|
|
<result property="id" column="id" />
|
|
|
|
<result property="roomContentId" column="room_content_id" />
|
|
|
|
<result property="userId" column="user_id" />
|
|
|
|
<result property="ticketId" column="ticket_id" />
|
|
|
|
<result property="customerId" column="customer_id" />
|
2024-03-01 08:52:44 +08:00
|
|
|
<result property="serveId" column="serve_id" />
|
2024-02-25 11:18:52 +08:00
|
|
|
<result property="title" column="title" />
|
|
|
|
<result property="stauts" column="stauts" />
|
|
|
|
<result property="isAfterSale" column="is_after_sale" />
|
|
|
|
<result property="oderNumber" column="oder_number" />
|
|
|
|
<result property="orderMoney" column="order_money" />
|
|
|
|
<result property="cancelTime" column="cancel_time" />
|
2024-03-08 08:33:31 +08:00
|
|
|
<result property="orderTime" column="order_time" />
|
2024-02-25 11:18:52 +08:00
|
|
|
<result property="cancelResaon" column="cancel_resaon" />
|
|
|
|
<result property="visitType" column="visit_type" />
|
2024-03-19 11:18:09 +08:00
|
|
|
<result property="prepayId" column="prepay_id" />
|
2024-03-08 08:33:31 +08:00
|
|
|
<result property="reservationNumber" column="reservation_number" />
|
2024-02-25 11:18:52 +08:00
|
|
|
<result property="explainNeedType" column="explain_need_type" />
|
|
|
|
<result property="meetingNeedType" column="meeting_need_type" />
|
|
|
|
<result property="photographType" column="photograph_type" />
|
|
|
|
<result property="startTime" column="start_time" />
|
2024-03-04 16:43:40 +08:00
|
|
|
<result property="endDate" column="end_date" />
|
2024-02-25 11:18:52 +08:00
|
|
|
<result property="deleteFlag" column="delete_flag" />
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
<result property="remake" column="remake" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectReservationVo">
|
2024-03-12 14:09:50 +08:00
|
|
|
SELECT id, room_content_id, user_id, ticket_id,
|
|
|
|
customer_id, title, stauts,serve_id,end_date, is_after_sale,
|
2024-03-19 11:18:09 +08:00
|
|
|
oder_number,reservation_number, order_money, cancel_time,prepay_id,
|
2024-03-15 08:51:14 +08:00
|
|
|
cancel_resaon, visit_type, explain_need_type, meeting_need_type, photograph_type, start_time,
|
|
|
|
delete_flag, create_by, create_time, update_by, update_time, remake FROM tb_reservation
|
2024-02-25 11:18:52 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectReservationList" parameterType="Reservation" resultMap="ReservationResult">
|
|
|
|
<include refid="selectReservationVo"/>
|
|
|
|
<where>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectReservationById" parameterType="Long" resultMap="ReservationResult">
|
|
|
|
<include refid="selectReservationVo"/>
|
|
|
|
WHERE id = #{id}
|
|
|
|
</select>
|
2024-03-08 08:33:31 +08:00
|
|
|
<select id="selectListByDate" resultType="java.util.Date">
|
|
|
|
select date_format(start_time, '%Y-%m-%d') from tb_reservation where start_time >= date_format(now(), '%Y-%m-%d')
|
2024-03-12 14:09:50 +08:00
|
|
|
and room_content_id = #{roomContentId} group by date_format(start_time, '%Y-%m-%d');
|
2024-03-08 08:33:31 +08:00
|
|
|
</select>
|
2024-03-15 08:51:14 +08:00
|
|
|
<select id="todayMeeting" resultType="com.ics.admin.domain.meeting.Reservation">
|
|
|
|
<include refid="selectReservationVo"/>
|
|
|
|
WHERE
|
|
|
|
(
|
|
|
|
DATE_FORMAT( start_time, '%Y-%m-%d' ) =
|
|
|
|
DATE_FORMAT( NOW(), '%Y-%m-%d' ))
|
|
|
|
and
|
2024-03-22 14:24:36 +08:00
|
|
|
((DATE_FORMAT( start_time, '%Y-%m-%d %H:%i:%S' ) <
|
|
|
|
DATE_FORMAT( NOW(), '%Y-%m-%d %H:%i:%S' )
|
|
|
|
and
|
|
|
|
DATE_FORMAT( end_date, '%Y-%m-%d %H:%i:%S' ) >
|
|
|
|
DATE_FORMAT( NOW(), '%Y-%m-%d %H:%i:%S' ))
|
|
|
|
or
|
|
|
|
(
|
|
|
|
DATE_FORMAT( start_time, '%Y-%m-%d %H:%i:%S' ) >
|
2024-03-15 08:51:14 +08:00
|
|
|
DATE_FORMAT( NOW(), '%Y-%m-%d %H:%i:%S' )))
|
|
|
|
and room_content_id =#{id}
|
|
|
|
ORDER BY start_time ASC
|
|
|
|
|
|
|
|
</select>
|
2024-03-08 08:33:31 +08:00
|
|
|
|
2024-02-25 11:18:52 +08:00
|
|
|
<insert id="insertReservation" parameterType="Reservation">
|
|
|
|
INSERT INTO tb_reservation
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null ">id,</if>
|
|
|
|
<if test="roomContentId != null ">room_content_id,</if>
|
|
|
|
<if test="userId != null ">user_id,</if>
|
|
|
|
<if test="ticketId != null ">ticket_id,</if>
|
|
|
|
<if test="customerId != null ">customer_id,</if>
|
2024-03-01 08:52:44 +08:00
|
|
|
<if test="serveId != null ">serve_id,</if>
|
2024-02-25 11:18:52 +08:00
|
|
|
<if test="title != null and title != ''">title,</if>
|
|
|
|
<if test="stauts != null ">stauts,</if>
|
|
|
|
<if test="isAfterSale != null and isAfterSale != ''">is_after_sale,</if>
|
|
|
|
<if test="oderNumber != null and oderNumber != ''">oder_number,</if>
|
|
|
|
<if test="orderMoney != null and orderMoney != ''">order_money,</if>
|
2024-03-19 11:18:09 +08:00
|
|
|
<if test="prepayId != null and prepayId != ''">prepay_id,</if>
|
2024-02-25 11:18:52 +08:00
|
|
|
<if test="cancelTime != null ">cancel_time,</if>
|
2024-03-08 08:33:31 +08:00
|
|
|
<if test="orderTime != null ">order_time,</if>
|
2024-02-25 11:18:52 +08:00
|
|
|
<if test="cancelResaon != null and cancelResaon != ''">cancel_resaon,</if>
|
|
|
|
<if test="visitType != null and visitType != ''">visit_type,</if>
|
|
|
|
<if test="explainNeedType != null and explainNeedType != ''">explain_need_type,</if>
|
|
|
|
<if test="meetingNeedType != null and meetingNeedType != ''">meeting_need_type,</if>
|
|
|
|
<if test="photographType != null and photographType != ''">photograph_type,</if>
|
|
|
|
<if test="startTime != null ">start_time,</if>
|
2024-03-04 16:43:40 +08:00
|
|
|
<if test="endDate != null ">end_date,</if>
|
2024-03-08 08:33:31 +08:00
|
|
|
<if test="reservationNumber != null ">reservation_number,</if>
|
2024-02-25 11:18:52 +08:00
|
|
|
<if test="deleteFlag != null ">delete_flag,</if>
|
|
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
|
<if test="createTime != null ">create_time,</if>
|
|
|
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
|
|
|
<if test="updateTime != null ">update_time,</if>
|
|
|
|
<if test="remake != null and remake != ''">remake,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="id != null ">#{id},</if>
|
|
|
|
<if test="roomContentId != null ">#{roomContentId},</if>
|
|
|
|
<if test="userId != null ">#{userId},</if>
|
|
|
|
<if test="ticketId != null ">#{ticketId},</if>
|
|
|
|
<if test="customerId != null ">#{customerId},</if>
|
2024-03-01 08:52:44 +08:00
|
|
|
<if test="serveId != null ">#{serveId},</if>
|
2024-02-25 11:18:52 +08:00
|
|
|
<if test="title != null and title != ''">#{title},</if>
|
|
|
|
<if test="stauts != null ">#{stauts},</if>
|
2024-03-08 08:33:31 +08:00
|
|
|
<if test="reservationNumber != null ">#{reservationNumber},</if>
|
2024-02-25 11:18:52 +08:00
|
|
|
<if test="isAfterSale != null and isAfterSale != ''">#{isAfterSale},</if>
|
|
|
|
<if test="oderNumber != null and oderNumber != ''">#{oderNumber},</if>
|
|
|
|
<if test="orderMoney != null and orderMoney != ''">#{orderMoney},</if>
|
2024-03-19 11:18:09 +08:00
|
|
|
<if test="prepayId != null and prepayId != ''">#{prepayId},</if>
|
2024-02-25 11:18:52 +08:00
|
|
|
<if test="cancelTime != null ">#{cancelTime},</if>
|
2024-03-08 08:33:31 +08:00
|
|
|
<if test="orderTime != null ">#{orderTime},</if>
|
2024-02-25 11:18:52 +08:00
|
|
|
<if test="cancelResaon != null and cancelResaon != ''">#{cancelResaon},</if>
|
|
|
|
<if test="visitType != null and visitType != ''">#{visitType},</if>
|
|
|
|
<if test="explainNeedType != null and explainNeedType != ''">#{explainNeedType},</if>
|
|
|
|
<if test="meetingNeedType != null and meetingNeedType != ''">#{meetingNeedType},</if>
|
|
|
|
<if test="photographType != null and photographType != ''">#{photographType},</if>
|
|
|
|
<if test="startTime != null ">#{startTime},</if>
|
2024-03-04 16:43:40 +08:00
|
|
|
<if test="endDate != null ">#{endDate},</if>
|
2024-02-25 11:18:52 +08:00
|
|
|
<if test="deleteFlag != null ">#{deleteFlag},</if>
|
|
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
|
<if test="createTime != null ">#{createTime},</if>
|
|
|
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
|
|
|
<if test="updateTime != null ">#{updateTime},</if>
|
|
|
|
<if test="remake != null and remake != ''">#{remake},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateReservation" parameterType="Reservation">
|
|
|
|
UPDATE tb_reservation
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="roomContentId != null ">room_content_id = #{roomContentId},</if>
|
|
|
|
<if test="userId != null ">user_id = #{userId},</if>
|
|
|
|
<if test="ticketId != null ">ticket_id = #{ticketId},</if>
|
|
|
|
<if test="customerId != null ">customer_id = #{customerId},</if>
|
2024-03-01 08:52:44 +08:00
|
|
|
<if test="serveId != null ">serve_id = #{serveId},</if>
|
2024-02-25 11:18:52 +08:00
|
|
|
<if test="title != null and title != ''">title = #{title},</if>
|
|
|
|
<if test="stauts != null ">stauts = #{stauts},</if>
|
|
|
|
<if test="isAfterSale != null and isAfterSale != ''">is_after_sale = #{isAfterSale},</if>
|
|
|
|
<if test="oderNumber != null and oderNumber != ''">oder_number = #{oderNumber},</if>
|
|
|
|
<if test="orderMoney != null and orderMoney != ''">order_money = #{orderMoney},</if>
|
2024-03-19 11:18:09 +08:00
|
|
|
<if test="prepayId != null and prepayId != ''">prepay_id = #{prepayId},</if>
|
2024-02-25 11:18:52 +08:00
|
|
|
<if test="cancelTime != null ">cancel_time = #{cancelTime},</if>
|
2024-03-08 08:33:31 +08:00
|
|
|
<if test="reservationNumber != null ">reservation_number = #{reservationNumber},</if>
|
2024-02-25 11:18:52 +08:00
|
|
|
<if test="cancelResaon != null and cancelResaon != ''">cancel_resaon = #{cancelResaon},</if>
|
|
|
|
<if test="visitType != null and visitType != ''">visit_type = #{visitType},</if>
|
|
|
|
<if test="explainNeedType != null and explainNeedType != ''">explain_need_type = #{explainNeedType},</if>
|
|
|
|
<if test="meetingNeedType != null and meetingNeedType != ''">meeting_need_type = #{meetingNeedType},</if>
|
|
|
|
<if test="photographType != null and photographType != ''">photograph_type = #{photographType},</if>
|
|
|
|
<if test="startTime != null ">start_time = #{startTime},</if>
|
2024-03-04 16:43:40 +08:00
|
|
|
<if test="endDate != null ">end_date = #{endDate},</if>
|
2024-03-08 08:33:31 +08:00
|
|
|
<if test="orderTime != null ">order_time = #{orderTime},</if>
|
2024-02-25 11:18:52 +08:00
|
|
|
<if test="deleteFlag != null ">delete_flag = #{deleteFlag},</if>
|
|
|
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
|
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
|
|
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
|
|
|
<if test="remake != null and remake != ''">remake = #{remake},</if>
|
|
|
|
</trim>
|
|
|
|
WHERE id = #{id}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteReservationById" parameterType="Long">
|
|
|
|
DELETE FROM tb_reservation WHERE id = #{id}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteReservationByIds" parameterType="String">
|
|
|
|
DELETE FROM tb_reservation where id in
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
</mapper>
|