|
@@ -0,0 +1,140 @@
|
|
|
|
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
|
+<!DOCTYPE mapper
|
|
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
+ "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
+<mapper namespace="com.poyee.mapper.LotOrderMapper">
|
|
|
|
|
+
|
|
|
|
|
+ <resultMap id="lotOrderListMap" type="com.poyee.dto.LotOrderListDTO">
|
|
|
|
|
+ <id column="id" property="id"/>
|
|
|
|
|
+ <result column="order_no" property="orderNo"/>
|
|
|
|
|
+ <result column="auction_name" property="auctionName"/>
|
|
|
|
|
+ <result column="lot_name" property="lotName"/>
|
|
|
|
|
+ <result column="status" property="status"/>
|
|
|
|
|
+ <result column="payment_amount" property="paymentAmount"/>
|
|
|
|
|
+ <result column="create_time" property="createTime"/>
|
|
|
|
|
+ <result column="pay_time" property="payTime"/>
|
|
|
|
|
+ <association property="buyerUserInfo" javaType="com.poyee.dto.LotOrderListDTO$BuyerUserInfo">
|
|
|
|
|
+ <result column="buyer_nickname" property="nickname"/>
|
|
|
|
|
+ <result column="buyer_phone" property="phone"/>
|
|
|
|
|
+ </association>
|
|
|
|
|
+ <association property="buyerShippingAddress" javaType="com.poyee.dto.LotOrderListDTO$BuyerShippingAddressInfo">
|
|
|
|
|
+ <result column="shipping_link_name" property="linkName"/>
|
|
|
|
|
+ <result column="shipping_phone" property="phone"/>
|
|
|
|
|
+ <result column="shipping_address" property="address"/>
|
|
|
|
|
+ </association>
|
|
|
|
|
+ <association property="logisticsInfo" javaType="com.poyee.dto.LotOrderListDTO$LogisticsInfo">
|
|
|
|
|
+ <result column="logistics_name" property="logisticsName"/>
|
|
|
|
|
+ <result column="tracking_no" property="trackingNo"/>
|
|
|
|
|
+ </association>
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <resultMap id="lotOrderDetailMap" type="com.poyee.dto.LotOrderDetailDTO">
|
|
|
|
|
+ <id column="order_id" property="orderId"/>
|
|
|
|
|
+ <result column="auction_name" property="auctionName"/>
|
|
|
|
|
+ <result column="auction_start_time" property="auctionStartTime"/>
|
|
|
|
|
+ <result column="auction_end_time" property="auctionEndTime"/>
|
|
|
|
|
+ <result column="auction_desc" property="auctionDesc"/>
|
|
|
|
|
+ <result column="lot_name" property="lotName"/>
|
|
|
|
|
+ <result column="lot_start_time" property="lotStartTime"/>
|
|
|
|
|
+ <result column="lot_end_time" property="lotEndTime"/>
|
|
|
|
|
+ <result column="margin_deposit" property="marginDeposit"/>
|
|
|
|
|
+ <result column="service_fee" property="serviceFee"/>
|
|
|
|
|
+ <result column="order_no" property="orderNo"/>
|
|
|
|
|
+ <result column="transaction_amount" property="transactionAmount"/>
|
|
|
|
|
+ <result column="payment_time" property="paymentTime"/>
|
|
|
|
|
+ <result column="nickname" property="nickname"/>
|
|
|
|
|
+ <result column="phone" property="phone"/>
|
|
|
|
|
+ <result column="buyer_name" property="buyerName"/>
|
|
|
|
|
+ <result column="buyer_phone" property="buyerPhone"/>
|
|
|
|
|
+ <result column="buyer_address" property="buyerAddress"/>
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="listSelect">
|
|
|
|
|
+ select
|
|
|
|
|
+ lo.id,
|
|
|
|
|
+ lo.order_no,
|
|
|
|
|
+ lo.auction_name,
|
|
|
|
|
+ lo.lot_name,
|
|
|
|
|
+ lo.status,
|
|
|
|
|
+ lo.payment_amount,
|
|
|
|
|
+ lo.create_time,
|
|
|
|
|
+ lo.pay_time,
|
|
|
|
|
+ abu.nickname as buyer_nickname,
|
|
|
|
|
+ aa.phone as buyer_phone,
|
|
|
|
|
+ lo.shipping_address_likename as shipping_link_name,
|
|
|
|
|
+ lo.shipping_address_phone as shipping_phone,
|
|
|
|
|
+ lo.shipping_address,
|
|
|
|
|
+ goe.logistics_company as logistics_name,
|
|
|
|
|
+ goe.courier_no tracking_no
|
|
|
|
|
+ from lot_order_info lo
|
|
|
|
|
+ left join app_base_user abu on abu.id = lo.user_id
|
|
|
|
|
+ left join app_account aa on aa.account = abu.username and aa.status = 0
|
|
|
|
|
+ left join group_order_express goe on lo.order_no=goe.order_no
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="detailSelect">
|
|
|
|
|
+ select lo.auction_name as auction_name,
|
|
|
|
|
+ lo.lot_name as lot_name,
|
|
|
|
|
+ lo.service_expense as service_fee,
|
|
|
|
|
+ lo.id as order_id,
|
|
|
|
|
+ lo.order_no,
|
|
|
|
|
+ lo.payment_amount as transaction_amount,
|
|
|
|
|
+ lo.pay_time as payment_time,
|
|
|
|
|
+ abu.nickname,
|
|
|
|
|
+ aa.phone,
|
|
|
|
|
+ lo.shipping_address_likename as buyer_name,
|
|
|
|
|
+ lo.shipping_address_phone as buyer_phone,
|
|
|
|
|
+ lo.shipping_address as buyer_address,
|
|
|
|
|
+ l.start_time as lot_start_time,
|
|
|
|
|
+ l.end_time as lot_end_time,
|
|
|
|
|
+ auc.start_time as auction_start_time,
|
|
|
|
|
+ auc.end_time as auction_end_time,
|
|
|
|
|
+ auc.description as auction_desc,
|
|
|
|
|
+ coalesce(l.deposit, auc.deposit) as margin_deposit
|
|
|
|
|
+ from lot_order_info lo
|
|
|
|
|
+ left join app_base_user abu on abu.id = lo.user_id
|
|
|
|
|
+ left join app_account aa on aa.account = abu.username and aa.status = 0
|
|
|
|
|
+ left join lot l on lo.lot_id = l.id
|
|
|
|
|
+ left join auction auc on auc.id = l.auction_id
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectList" resultMap="lotOrderListMap">
|
|
|
|
|
+ <include refid="listSelect"/>
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="lotOrder.orderNo != null and lotOrder.orderNo != ''">
|
|
|
|
|
+ and lo.order_no = #{lotOrder.orderNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="lotOrder.status != null">
|
|
|
|
|
+ and lo.status = #{lotOrder.status}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="lotOrder.merchantId != null">
|
|
|
|
|
+ and lo.merchant_id = #{lotOrder.merchantId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ order by lo.create_time desc
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectDetail" resultMap="lotOrderDetailMap">
|
|
|
|
|
+ <include refid="detailSelect"/>
|
|
|
|
|
+ <where>
|
|
|
|
|
+ and lo.order_no = #{orderNo}
|
|
|
|
|
+ <if test="merchantId != null">
|
|
|
|
|
+ and lo.merchant_id = #{merchantId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectByOrderNo" resultType="com.poyee.domain.LotOrder">
|
|
|
|
|
+ select id, order_no, status
|
|
|
|
|
+ from lot_order_info
|
|
|
|
|
+ where order_no = #{orderNo}
|
|
|
|
|
+ limit 1
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="updateStatusByOrderNo">
|
|
|
|
|
+ update lot_order_info
|
|
|
|
|
+ set status = #{targetStatus}
|
|
|
|
|
+ where order_no = #{orderNo}
|
|
|
|
|
+ and status = #{sourceStatus}
|
|
|
|
|
+ </update>
|
|
|
|
|
+</mapper>
|