212 lines
8.7 KiB
XML
212 lines
8.7 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.trip.mapper.ZdyTripOrderDetailMapper">
|
||
|
|
||
|
<resultMap type="ZdyTripOrderDetail" id="ZdyTripOrderDetailResult">
|
||
|
<result property="id" column="id"/>
|
||
|
<result property="tripOrderId" column="trip_order_id"/>
|
||
|
<result property="ticketOrderItemId" column="ticket_order_item_id"/>
|
||
|
<result property="ticketOrderItemCode" column="ticket_order_item_code"/>
|
||
|
<result property="ticketOrderDetailId" column="ticket_order_detail_id"/>
|
||
|
<result property="ticketId" column="ticket_id"/>
|
||
|
<result property="qrcodeRule" column="qrcode_rule"/>
|
||
|
<result property="itemId" column="item_id"/>
|
||
|
<result property="userTouristId" column="user_tourist_id"/>
|
||
|
<result property="passengerId" column="passenger_id"/>
|
||
|
<result property="voucherId" column="voucher_id"/>
|
||
|
<result property="useDate" column="use_date"/>
|
||
|
<result property="quantity" column="quantity"/>
|
||
|
<result property="orderStatus" column="column_order_status"/>
|
||
|
<result property="amount" column="amount"/>
|
||
|
<result property="amountCurrency" column="amount_currency"/>
|
||
|
<result property="createTime" column="create_time"/>
|
||
|
<result property="orderStatus" column="order_status"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="selectZdyTripOrderDetailVo">
|
||
|
select id, trip_order_id, ticket_order_item_id,amount,amount_currency,order_status,qrcode_rule,ticket_order_detail_id,ticket_order_item_code,ticket_id, user_tourist_id, passenger_id, voucher_id, use_date,quantity,item_id, create_time
|
||
|
from zdy_trip_order_detail
|
||
|
</sql>
|
||
|
|
||
|
|
||
|
|
||
|
<select id="selectZdyTripOrderDetailList" parameterType="ZdyTripOrderDetail" resultMap="ZdyTripOrderDetailResult">
|
||
|
<include refid="selectZdyTripOrderDetailVo"/>
|
||
|
<where>
|
||
|
<if test="tripOrderId != null ">
|
||
|
and trip_order_id = #{tripOrderId}
|
||
|
</if>
|
||
|
<if test="ticketOrderDetailId != null ">
|
||
|
and ticket_order_detail_id = #{ticketOrderDetailId}
|
||
|
</if>
|
||
|
<if test="ticketOrderItemId != null ">
|
||
|
and ticket_order_item_id = #{ticketOrderItemId}
|
||
|
</if>
|
||
|
<if test="userTouristId != null ">
|
||
|
and user_tourist_id = #{userTouristId}
|
||
|
</if>
|
||
|
<if test="passengerId != null and passengerId != ''">
|
||
|
and passenger_id = #{passengerId}
|
||
|
</if>
|
||
|
<if test="voucherId != null and voucherId != ''">
|
||
|
and voucher_id = #{voucherId}
|
||
|
</if>
|
||
|
<if test="useDate != null and useDate != ''">
|
||
|
and use_date = #{useDate}
|
||
|
</if>
|
||
|
<if test="itemId != null and itemId != ''">
|
||
|
and item_id = #{itemId}
|
||
|
</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="selectZdyTripOrderDetailListByTripOrderId" parameterType="Long" resultMap="ZdyTripOrderDetailResult">
|
||
|
<include refid="selectZdyTripOrderDetailVo"/>
|
||
|
where trip_order_id = #{tripOrderId}
|
||
|
</select>
|
||
|
|
||
|
<select id="selectZdyTripOrderDetailById" parameterType="Long"
|
||
|
resultMap="ZdyTripOrderDetailResult">
|
||
|
<include refid="selectZdyTripOrderDetailVo"/>
|
||
|
where id = #{id}
|
||
|
</select>
|
||
|
|
||
|
<select id="selectZdyTripOrderDetailByItemId" parameterType="Long"
|
||
|
resultMap="ZdyTripOrderDetailResult">
|
||
|
<include refid="selectZdyTripOrderDetailVo"/>
|
||
|
where item_id = #{itemId}
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertZdyTripOrderDetail" parameterType="ZdyTripOrderDetail" useGeneratedKeys="true"
|
||
|
keyProperty="id">
|
||
|
insert into zdy_trip_order_detail
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="tripOrderId != null">trip_order_id,
|
||
|
</if>
|
||
|
<if test="ticketOrderDetailId != null">ticket_order_detail_id,
|
||
|
</if>
|
||
|
<if test="ticketOrderItemId != null">ticket_order_item_id,
|
||
|
</if>
|
||
|
<if test="userTouristId != null">user_tourist_id,
|
||
|
</if>
|
||
|
<if test="ticketId != null">ticket_id,
|
||
|
</if>
|
||
|
<if test="passengerId != null">passenger_id,
|
||
|
</if>
|
||
|
<if test="voucherId != null">voucher_id,
|
||
|
</if>
|
||
|
<if test="useDate != null">use_date,
|
||
|
</if>
|
||
|
<if test="quantity != null">quantity,
|
||
|
</if>
|
||
|
<if test="itemId != null">item_id,
|
||
|
</if>
|
||
|
<if test="ticketOrderItemCode != null">ticket_order_item_code,
|
||
|
</if>
|
||
|
<if test="qrcodeRule != null">qrcode_rule,
|
||
|
</if>
|
||
|
<if test="orderStatus != null">order_status,
|
||
|
</if>
|
||
|
<if test="amount != null">amount,
|
||
|
</if>
|
||
|
<if test="amountCurrency != null">amount_currency,
|
||
|
</if>
|
||
|
create_time,
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="tripOrderId != null">#{tripOrderId},
|
||
|
</if>
|
||
|
<if test="ticketOrderDetailId != null">#{ticketOrderDetailId},
|
||
|
</if>
|
||
|
<if test="ticketOrderItemId != null">#{ticketOrderItemId},
|
||
|
</if>
|
||
|
<if test="userTouristId != null">#{userTouristId},
|
||
|
</if>
|
||
|
<if test="ticketId != null">#{ticketId},
|
||
|
</if>
|
||
|
<if test="passengerId != null">#{passengerId},
|
||
|
</if>
|
||
|
<if test="voucherId != null">#{voucherId},
|
||
|
</if>
|
||
|
<if test="useDate != null">#{useDate},
|
||
|
</if>
|
||
|
<if test="quantity != null">#{quantity},
|
||
|
</if>
|
||
|
<if test="itemId != null">#{itemId},
|
||
|
</if>
|
||
|
<if test="ticketOrderItemCode != null">#{ticketOrderItemCode},
|
||
|
</if>
|
||
|
<if test="qrcodeRule != null">#{qrcodeRule},
|
||
|
</if>
|
||
|
<if test="orderStatus != null">#{orderStatus},
|
||
|
</if>
|
||
|
<if test="amount != null">#{amount},
|
||
|
</if>
|
||
|
<if test="amountCurrency != null">#{amountCurrency},
|
||
|
</if>
|
||
|
sysdate(),
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<update id="updateZdyTripOrderDetail" parameterType="ZdyTripOrderDetail">
|
||
|
update zdy_trip_order_detail
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="tripOrderId != null">trip_order_id =
|
||
|
#{tripOrderId},
|
||
|
</if>
|
||
|
<if test="ticketOrderDetailId != null">ticket_order_detail_id =
|
||
|
#{ticketOrderDetailId},
|
||
|
</if>
|
||
|
<if test="ticketOrderItemId != null">ticket_order_item_id =
|
||
|
#{ticketOrderItemId},
|
||
|
</if>
|
||
|
<if test="userTouristId != null">user_tourist_id =
|
||
|
#{userTouristId},
|
||
|
</if>
|
||
|
<if test="ticketId != null">ticket_id =
|
||
|
#{ticketId},
|
||
|
</if>
|
||
|
<if test="passengerId != null">passenger_id =
|
||
|
#{passengerId},
|
||
|
</if>
|
||
|
<if test="voucherId != null">voucher_id =
|
||
|
#{voucherId},
|
||
|
</if>
|
||
|
<if test="useDate != null">use_date =
|
||
|
#{useDate},
|
||
|
</if>
|
||
|
<if test="quantity != null">quantity =
|
||
|
#{quantity},
|
||
|
</if>
|
||
|
<if test="itemId != null">item_id =
|
||
|
#{itemId},
|
||
|
</if>
|
||
|
<if test="qrcodeRule != null">qrcode_rule =
|
||
|
#{qrcodeRule},
|
||
|
</if>
|
||
|
<if test="orderStatus != null">order_status =
|
||
|
#{orderStatus},
|
||
|
</if>
|
||
|
<if test="amount != null">amount =
|
||
|
#{amount},
|
||
|
</if>
|
||
|
<if test="amountCurrency != null">amount_currency =
|
||
|
#{amountCurrency},
|
||
|
</if>
|
||
|
</trim>
|
||
|
where id = #{id}
|
||
|
</update>
|
||
|
|
||
|
<delete id="deleteZdyTripOrderDetailById" parameterType="Long">
|
||
|
delete from zdy_trip_order_detail where id = #{id}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteZdyTripOrderDetailByIds" parameterType="String">
|
||
|
delete from zdy_trip_order_detail where id in
|
||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
#{id}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
</mapper>
|