275 lines
12 KiB
XML
275 lines
12 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.ZdyTripOrderMapper">
|
||
|
|
||
|
<resultMap type = "ZdyTripOrder" id = "ZdyTripOrderResult">
|
||
|
<result property = "id" column = "id"/>
|
||
|
<result property = "sequenceId" column = "sequence_id"/>
|
||
|
<result property = "otaOrderId" column = "ota_order_id"/>
|
||
|
<result property = "ticketOrderId" column = "ticket_order_id"/>
|
||
|
<result property = "supplierOrderId" column = "supplier_order_id"/>
|
||
|
<result property = "confirmType" column = "confirm_type"/>
|
||
|
<result property = "orderQuantity" column = "order_quantity"/>
|
||
|
<result property = "serviceName" column = "service_name"/>
|
||
|
<result property = "quantity" column = "quantity"/>
|
||
|
<result property = "totalAmount" column = "total_amount"/>
|
||
|
<result property = "totalAmountCurrency" column = "total_amount_currency"/>
|
||
|
<result property = "orderStatus" column = "order_status"/>
|
||
|
<result property = "createTime" column = "create_time"/>
|
||
|
<result property = "updateTime" column = "update_time"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id = "selectZdyTripOrderVo">
|
||
|
select id,
|
||
|
sequence_id,
|
||
|
ota_order_id,
|
||
|
ticket_order_id,
|
||
|
total_amount,
|
||
|
total_amount_currency,
|
||
|
order_status,
|
||
|
supplier_order_id,
|
||
|
confirm_type,
|
||
|
order_quantity,
|
||
|
quantity,
|
||
|
service_name,
|
||
|
create_time,
|
||
|
update_time
|
||
|
from zdy_trip_order
|
||
|
</sql>
|
||
|
|
||
|
<resultMap type = "ZdyTripOrder" id = "ZdyTripOrderColumnResult">
|
||
|
<result property = "id" column = "id"/>
|
||
|
<result property = "sequenceId" column = "sequence_id"/>
|
||
|
<result property = "otaOrderId" column = "ota_order_id"/>
|
||
|
<result property = "ticketOrderId" column = "ticket_order_id"/>
|
||
|
<result property = "supplierOrderId" column = "supplier_order_id"/>
|
||
|
<result property = "confirmType" column = "confirm_type"/>
|
||
|
<result property = "orderQuantity" column = "order_quantity"/>
|
||
|
<result property = "serviceName" column = "service_name"/>
|
||
|
<result property = "quantity" column = "quantity"/>
|
||
|
<result property = "totalAmount" column = "total_amount"/>
|
||
|
<result property = "totalAmountCurrency" column = "total_amount_currency"/>
|
||
|
<result property = "orderStatus" column = "order_status"/>
|
||
|
<result property = "createTime" column = "create_time"/>
|
||
|
<result property = "updateTime" column = "update_time"/>
|
||
|
<collection property = "tripOrderDetailList" ofType = "ZdyTripOrderDetail" resultMap = "ZdyTripOrderDetailResult">
|
||
|
</collection>
|
||
|
</resultMap>
|
||
|
|
||
|
<resultMap type = "ZdyTripOrderDetail" id = "ZdyTripOrderDetailResult">
|
||
|
<result property = "id" column = "column_id"/>
|
||
|
<result property = "tripOrderId" column = "trip_order_id"/>
|
||
|
<result property = "ticketOrderItemId" column = "ticket_order_item_id"/>
|
||
|
<result property = "ticketOrderDetailId" column = "ticket_order_detail_id"/>
|
||
|
<result property = "ticketId" column = "ticket_id"/>
|
||
|
<result property = "itemId" column = "item_id"/>
|
||
|
<result property = "userTouristId" column = "user_tourist_id"/>
|
||
|
<result property = "ticketOrderItemCode" column = "ticket_order_item_code"/>
|
||
|
<result property = "qrcodeRule" column = "qrcode_rule"/>
|
||
|
<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 = "amount" column = "amount"/>
|
||
|
<result property = "amountCurrency" column = "amount_currency"/>
|
||
|
<result property = "orderStatus" column = "column_order_status"/>
|
||
|
<result property = "createTime" column = "create_time"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id = "selectZdyTripOrderColumnVo">
|
||
|
select a.id,
|
||
|
a.sequence_id,
|
||
|
a.ota_order_id,
|
||
|
a.total_amount,
|
||
|
a.total_amount_currency,
|
||
|
a.ticket_order_id,
|
||
|
a.order_status,
|
||
|
a.supplier_order_id,
|
||
|
a.confirm_type,
|
||
|
a.quantity,
|
||
|
a.order_quantity,
|
||
|
a.service_name,
|
||
|
a.create_time,
|
||
|
a.update_time,
|
||
|
b.id as column_id,
|
||
|
b.trip_order_id,
|
||
|
b.amount,
|
||
|
b.amount_currency,
|
||
|
b.qrcode_rule,
|
||
|
b.ticket_order_item_id,
|
||
|
b.order_status as column_order_status,
|
||
|
b.ticket_order_item_code,
|
||
|
b.ticket_id,
|
||
|
b.ticket_order_detail_id,
|
||
|
b.user_tourist_id,
|
||
|
b.passenger_id,
|
||
|
b.voucher_id,
|
||
|
b.use_date,
|
||
|
b.item_id,
|
||
|
b.quantity as column_quantity
|
||
|
from zdy_trip_order a
|
||
|
left join zdy_trip_order_detail b on b.trip_order_id = a.id
|
||
|
</sql>
|
||
|
|
||
|
<select id = "selectZdyTripOrderList" parameterType = "ZdyTripOrder" resultMap = "ZdyTripOrderResult">
|
||
|
<include refid = "selectZdyTripOrderVo"/>
|
||
|
<where>
|
||
|
<if test = "sequenceId != null and sequenceId != ''">
|
||
|
and sequence_id = #{sequenceId}
|
||
|
</if>
|
||
|
<if test = "otaOrderId != null and otaOrderId != ''">
|
||
|
and ota_order_id = #{otaOrderId}
|
||
|
</if>
|
||
|
<if test = "ticketOrderId != null ">
|
||
|
and ticket_order_id = #{ticketOrderId}
|
||
|
</if>
|
||
|
<if test = "supplierOrderId != null and supplierOrderId != ''">
|
||
|
and supplier_order_id = #{supplierOrderId}
|
||
|
</if>
|
||
|
<if test = "confirmType != null ">
|
||
|
and confirm_type = #{confirmType}
|
||
|
</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id = "selectZdyTripOrderColumnList" parameterType = "ZdyTripOrder" resultMap = "ZdyTripOrderColumnResult">
|
||
|
<include refid = "selectZdyTripOrderColumnVo"/>
|
||
|
<where>
|
||
|
<if test = "sequenceId != null and sequenceId != ''">
|
||
|
and a.sequence_id = #{sequenceId}
|
||
|
</if>
|
||
|
<if test = "otaOrderId != null and otaOrderId != ''">
|
||
|
and a.ota_order_id = #{otaOrderId}
|
||
|
</if>
|
||
|
<if test = "ticketOrderId != null ">
|
||
|
and a.ticket_order_id = #{ticketOrderId}
|
||
|
</if>
|
||
|
<if test = "supplierOrderId != null and supplierOrderId != ''">
|
||
|
and a.supplier_order_id = #{supplierOrderId}
|
||
|
</if>
|
||
|
<if test = "confirmType != null ">
|
||
|
and a.confirm_type = #{confirmType}
|
||
|
</if>
|
||
|
<if test = "orderStatus != null ">
|
||
|
and a.order_status = #{orderStatus}
|
||
|
</if>
|
||
|
<if test = "orderItemId != null ">
|
||
|
and b.ticket_order_item_id = #{orderItemId}
|
||
|
</if>
|
||
|
<if test = "orderDetailId != null ">
|
||
|
and b.ticket_order_detail_id = #{orderDetailId}
|
||
|
</if>
|
||
|
</where>
|
||
|
group by b.ticket_order_detail_id,a.id,b.id
|
||
|
</select>
|
||
|
|
||
|
<select id = "selectZdyTripOrderById" parameterType = "Long" resultMap = "ZdyTripOrderResult">
|
||
|
<include refid = "selectZdyTripOrderVo"/>
|
||
|
where id = #{id}
|
||
|
</select>
|
||
|
|
||
|
<select id = "selectZdyTripOrderByOrderCode" parameterType = "String" resultMap = "ZdyTripOrderResult">
|
||
|
<include refid = "selectZdyTripOrderVo"/>
|
||
|
where supplier_order_id = #{supplierOrderId}
|
||
|
</select>
|
||
|
|
||
|
<insert id = "insertZdyTripOrder" parameterType = "ZdyTripOrder" useGeneratedKeys = "true"
|
||
|
keyProperty = "id">
|
||
|
insert into zdy_trip_order
|
||
|
<trim prefix = "(" suffix = ")" suffixOverrides = ",">
|
||
|
<if test = "sequenceId != null">sequence_id,
|
||
|
</if>
|
||
|
<if test = "otaOrderId != null">ota_order_id,
|
||
|
</if>
|
||
|
<if test = "ticketOrderId != null">ticket_order_id,
|
||
|
</if>
|
||
|
<if test = "supplierOrderId != null">supplier_order_id,
|
||
|
</if>
|
||
|
<if test = "confirmType != null">confirm_type,
|
||
|
</if>
|
||
|
<if test = "quantity != null">quantity,
|
||
|
</if>
|
||
|
<if test = "orderQuantity != null">order_quantity,
|
||
|
</if>
|
||
|
<if test = "serviceName != null">service_name,
|
||
|
</if>
|
||
|
<if test = "orderStatus != null">order_status,
|
||
|
</if>
|
||
|
<if test = "totalAmount != null">total_amount,
|
||
|
</if>
|
||
|
<if test = "totalAmountCurrency != null">total_amount_currency,
|
||
|
</if>
|
||
|
create_time,
|
||
|
</trim>
|
||
|
<trim prefix = "values (" suffix = ")" suffixOverrides = ",">
|
||
|
<if test = "sequenceId != null">#{sequenceId},
|
||
|
</if>
|
||
|
<if test = "otaOrderId != null">#{otaOrderId},
|
||
|
</if>
|
||
|
<if test = "ticketOrderId != null">#{ticketOrderId},
|
||
|
</if>
|
||
|
<if test = "supplierOrderId != null">#{supplierOrderId},
|
||
|
</if>
|
||
|
<if test = "confirmType != null">#{confirmType},
|
||
|
</if>
|
||
|
<if test = "quantity != null">#{quantity},
|
||
|
</if>
|
||
|
<if test = "orderQuantity != null">#{orderQuantity},
|
||
|
</if>
|
||
|
<if test = "serviceName != null">#{serviceName},
|
||
|
</if>
|
||
|
<if test = "orderStatus != null">#{orderStatus},
|
||
|
</if>
|
||
|
<if test = "totalAmount != null">#{totalAmount},
|
||
|
</if>
|
||
|
<if test = "totalAmountCurrency != null">#{totalAmountCurrency},
|
||
|
</if>
|
||
|
sysdate(),
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<update id = "updateZdyTripOrder" parameterType = "ZdyTripOrder">
|
||
|
update zdy_trip_order
|
||
|
<trim prefix = "SET" suffixOverrides = ",">
|
||
|
<if test = "sequenceId != null">sequence_id = #{sequenceId},
|
||
|
</if>
|
||
|
<if test = "otaOrderId != null">ota_order_id = #{otaOrderId},
|
||
|
</if>
|
||
|
<if test = "ticketOrderId != null">ticket_order_id = #{ticketOrderId},
|
||
|
</if>
|
||
|
<if test = "supplierOrderId != null">supplier_order_id = #{supplierOrderId},
|
||
|
</if>
|
||
|
<if test = "confirmType != null">confirm_type = #{confirmType},
|
||
|
</if>
|
||
|
<if test = "quantity != null">quantity = #{quantity},
|
||
|
</if>
|
||
|
<if test = "orderQuantity != null">order_quantity = #{orderQuantity},
|
||
|
</if>
|
||
|
<if test = "serviceName != null">service_name = #{serviceName},
|
||
|
</if>
|
||
|
<if test = "orderStatus != null">order_status = #{orderStatus},
|
||
|
</if>
|
||
|
<if test = "totalAmount != null">total_amount = #{totalAmount},
|
||
|
</if>
|
||
|
<if test = "totalAmountCurrency != null">total_amount_currency = #{totalAmountCurrency},
|
||
|
</if>
|
||
|
update_time = sysdate(),
|
||
|
</trim>
|
||
|
where id = #{id}
|
||
|
</update>
|
||
|
|
||
|
<delete id = "deleteZdyTripOrderById" parameterType = "Long">
|
||
|
delete
|
||
|
from zdy_trip_order
|
||
|
where id = #{id}
|
||
|
</delete>
|
||
|
|
||
|
<delete id = "deleteZdyTripOrderByIds" parameterType = "String">
|
||
|
delete from zdy_trip_order where id in
|
||
|
<foreach item = "id" collection = "array" open = "(" separator = "," close = ")">
|
||
|
#{id}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
</mapper>
|