|
|
@@ -35,6 +35,11 @@
|
|
|
<result column="user_mobile" jdbcType="VARCHAR" property="userMobile"/>
|
|
|
<result column="receiver" jdbcType="VARCHAR" property="receiver"/>
|
|
|
<result column="shop_name" jdbcType="VARCHAR" property="shopName"/>
|
|
|
+ <result column="split_status" property="splitStatus"/>
|
|
|
+ <result column="auto_split" property="autoSplit"/>
|
|
|
+ <result column="order_level" property="orderLevel"/>
|
|
|
+ <result column="order_split_number" property="orderSplitNumber"/>
|
|
|
+ <result column="order_split_status" property="orderSplitStatus"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap id="MyOrderMap" type="com.yami.shop.bean.app.dto.MyOrderDto">
|
|
|
@@ -196,7 +201,7 @@
|
|
|
<result column="shop_id" jdbcType="BIGINT" property="shopId"/>
|
|
|
<result column="order_number" jdbcType="VARCHAR" property="orderNumber"/>
|
|
|
<result column="prod_id" jdbcType="BIGINT" property="prodId"/>
|
|
|
-<!-- <result column="prod_name" jdbcType="BIGINT" property="prodName"/>-->
|
|
|
+ <!-- <result column="prod_name" jdbcType="BIGINT" property="prodName"/>-->
|
|
|
<result column="sku_id" jdbcType="BIGINT" property="skuId"/>
|
|
|
<result column="prod_count" jdbcType="INTEGER" property="prodCount"/>
|
|
|
<result column="use_score" jdbcType="INTEGER" property="useScore"/>
|
|
|
@@ -219,25 +224,32 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="getOrderByOrderNumber" resultType="com.yami.shop.bean.model.Order">
|
|
|
- select * from tz_order o where o.order_number = #{orderNumber}
|
|
|
- </select>
|
|
|
+ select *
|
|
|
+ from tz_order o
|
|
|
+ where o.order_number = #{orderNumber}
|
|
|
+ </select>
|
|
|
|
|
|
<select id="listUnRefundOrderAndOrderItems" resultMap="orderAndOrderItemMap">
|
|
|
- select o.*,oi.*,tor.return_money_sts,oi.prod_name oi_prod_name,oi.actual_total as oi_actual_total from tz_order o
|
|
|
- join tz_order_item oi on o.order_number = oi.order_number
|
|
|
- left join tz_order_refund tor on tor.order_id = o.order_id
|
|
|
- where o.hb_order_status = #{orderStatus} and (refund_status IS NULL OR o.refund_status <> 1)
|
|
|
- and o.dvy_time < #{lessThanUpdateTime}
|
|
|
- </select>
|
|
|
+ select o.*, oi.*, tor.return_money_sts, oi.prod_name oi_prod_name, oi.actual_total as oi_actual_total
|
|
|
+ from tz_order o
|
|
|
+ join tz_order_item oi on o.order_number = oi.order_number
|
|
|
+ left join tz_order_refund tor on tor.order_id = o.order_id
|
|
|
+ where o.hb_order_status = #{orderStatus}
|
|
|
+ and (refund_status IS NULL OR o.refund_status <> 1)
|
|
|
+ and o.dvy_time < #{lessThanUpdateTime}
|
|
|
+ </select>
|
|
|
|
|
|
<select id="selectCancelOrders" resultMap="orderAndOrderItemMap">
|
|
|
- select o.*,oi.*,oi.prod_name oi_prod_name,oi.actual_total as oi_actual_total from tz_order o
|
|
|
- join tz_order_item oi on o.order_number = oi.order_number
|
|
|
- where o.hb_order_status = #{orderStatus} and o.create_time < #{lessThanUpdateTime}
|
|
|
- </select>
|
|
|
+ select o.*, oi.*, oi.prod_name oi_prod_name, oi.actual_total as oi_actual_total
|
|
|
+ from tz_order o
|
|
|
+ join tz_order_item oi on o.order_number = oi.order_number
|
|
|
+ where o.hb_order_status = #{orderStatus}
|
|
|
+ and o.create_time < #{lessThanUpdateTime}
|
|
|
+ </select>
|
|
|
|
|
|
<update id="cancelOrders">
|
|
|
- update tz_order set `hb_order_status`=60,close_type = 1,cancel_reason = #{cancelReason}, cancel_time = NOW(),update_time=NOW(),close_type=4 where order_id in
|
|
|
+ update tz_order set `hb_order_status`=60,close_type = 1,cancel_reason = #{cancelReason}, cancel_time =
|
|
|
+ NOW(),update_time=NOW(),close_type=4 where order_id in
|
|
|
<foreach collection="orders" item="order" open="(" close=")" separator=",">
|
|
|
#{order.orderId}
|
|
|
</foreach>
|
|
|
@@ -251,7 +263,8 @@
|
|
|
</update>
|
|
|
|
|
|
<update id="updateByToPaySuccess">
|
|
|
- update tz_order set `hb_order_status` = 20,is_payed =1,update_time=NOW(),pay_time=NOW(),pay_type =#{payType} where dvy_type=3 and
|
|
|
+ update tz_order set `hb_order_status` = 20,is_payed =1,update_time=NOW(),pay_time=NOW(),pay_type =#{payType}
|
|
|
+ where dvy_type=3 and
|
|
|
order_number in
|
|
|
<foreach collection="orderNumbers" item="orderNumber" separator="," open="(" close=")">
|
|
|
#{orderNumber}
|
|
|
@@ -259,7 +272,8 @@
|
|
|
</update>
|
|
|
|
|
|
<update id="updateByToPaySuccessDelivery">
|
|
|
- update tz_order set `hb_order_status` = 1,is_payed =1,update_time=NOW(),pay_time=NOW(),pay_type =#{payType} where dvy_type=1 and
|
|
|
+ update tz_order set `hb_order_status` = 1,is_payed =1,update_time=NOW(),pay_time=NOW(),pay_type =#{payType}
|
|
|
+ where dvy_type=1 and
|
|
|
order_number in
|
|
|
<foreach collection="orderNumbers" item="orderNumber" separator="," open="(" close=")">
|
|
|
#{orderNumber}
|
|
|
@@ -268,7 +282,8 @@
|
|
|
|
|
|
|
|
|
<select id="listOrdersDetialByOrder" resultMap="orderAndOrderItemAndUserAddrMap">
|
|
|
- select o.*,oi.*,oi.prod_name as item_prod_name,o.prod_name as order_prod_name,uao.* ,o.hb_order_status as oi_status
|
|
|
+ select o.*,oi.*,oi.prod_name as item_prod_name,o.prod_name as order_prod_name,uao.* ,o.hb_order_status as
|
|
|
+ oi_status
|
|
|
from tz_order o
|
|
|
left join tz_order_item oi on o.order_number = oi.order_number
|
|
|
left join tz_user_addr_order uao on o.addr_order_id = uao.addr_order_id
|
|
|
@@ -305,21 +320,20 @@
|
|
|
</select>
|
|
|
|
|
|
|
|
|
-
|
|
|
<select id="getOrderCountByShopId" resultType="com.yami.shop.bean.param.OrderPayParam">
|
|
|
SELECT SUM(actual_total) as payActualTotal,COUNT(DISTINCT user_id) as payUserCount,
|
|
|
COUNT(*) as payOrderCount
|
|
|
FROM tz_order o
|
|
|
<where>
|
|
|
- <if test="shopId != null">
|
|
|
- and o.shop_id = #{shopId}
|
|
|
- </if>
|
|
|
- <if test="startTime != null">
|
|
|
- and o.pay_time >= #{startTime}
|
|
|
- </if>
|
|
|
- <if test="endTime != null">
|
|
|
- and o.pay_time <= #{endTime}
|
|
|
- </if>
|
|
|
+ <if test="shopId != null">
|
|
|
+ and o.shop_id = #{shopId}
|
|
|
+ </if>
|
|
|
+ <if test="startTime != null">
|
|
|
+ and o.pay_time >= #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null">
|
|
|
+ and o.pay_time <= #{endTime}
|
|
|
+ </if>
|
|
|
AND o.is_payed =1
|
|
|
</where>
|
|
|
</select>
|
|
|
@@ -348,13 +362,13 @@
|
|
|
</if>
|
|
|
AND o.is_payed =1
|
|
|
</where>
|
|
|
- GROUP BY dates) _tmpAllTable GROUP BY dates
|
|
|
+ GROUP BY dates) _tmpAllTable GROUP BY dates
|
|
|
ORDER BY dates
|
|
|
</select>
|
|
|
|
|
|
<select id="getActualTotalByHour" resultType="com.yami.shop.bean.param.OrderPayParam">
|
|
|
- SELECT DATE_FORMAT(o.pay_time, '%k') AS dates,SUM(actual_total) as payActualTotal
|
|
|
- FROM tz_order o
|
|
|
+ SELECT DATE_FORMAT(o.pay_time, '%k') AS dates,SUM(actual_total) as payActualTotal
|
|
|
+ FROM tz_order o
|
|
|
<where>
|
|
|
<if test="shopId != null">
|
|
|
and o.shop_id = #{shopId}
|
|
|
@@ -367,7 +381,7 @@
|
|
|
</if>
|
|
|
AND o.is_payed =1
|
|
|
</where>
|
|
|
- GROUP BY dates
|
|
|
+ GROUP BY dates
|
|
|
</select>
|
|
|
|
|
|
<select id="getActualTotalByDay" resultType="com.yami.shop.bean.param.OrderPayParam">
|
|
|
@@ -390,8 +404,10 @@
|
|
|
|
|
|
|
|
|
<select id="listOrdersDetialByOrderParam" resultMap="orderAndOrderItemAndUserAddrMap">
|
|
|
- SELECT *,oi.prod_name as item_prod_name,oi.actual_total as oi_actual_total,IF(r.refund_type = 2,r.return_money_sts,IF(ar.refund_type = 1,ar.return_money_sts,NULL)) AS oi_return_money_sts,
|
|
|
- temp.prod_name as order_prod_name,temp.hb_order_status as oi_status, IF(os.pay_score IS NULL,0,os.pay_score) as pay_score
|
|
|
+ SELECT *,oi.prod_name as item_prod_name,oi.actual_total as oi_actual_total,IF(r.refund_type =
|
|
|
+ 2,r.return_money_sts,IF(ar.refund_type = 1,ar.return_money_sts,NULL)) AS oi_return_money_sts,
|
|
|
+ temp.prod_name as order_prod_name,temp.hb_order_status as oi_status, IF(os.pay_score IS NULL,0,os.pay_score) as
|
|
|
+ pay_score
|
|
|
FROM
|
|
|
(
|
|
|
SELECT o.*,sd.shop_name,uao.receiver,uao.mobile,u.user_mobile,u.nick_name FROM tz_order o
|
|
|
@@ -399,31 +415,19 @@
|
|
|
LEFT JOIN tz_user_addr_order uao ON o.addr_order_id = uao.addr_order_id
|
|
|
LEFT JOIN tz_user u on u.user_id=o.user_id
|
|
|
<where>
|
|
|
-<!-- <if test="orderParam.type!=null and orderParam.type==1 and orderParam.content != null and orderParam.content != ''">-->
|
|
|
-<!-- and o.order_number = #{orderParam.content}-->
|
|
|
-<!-- </if>-->
|
|
|
+ <!-- <if test="orderParam.type!=null and orderParam.type==1 and orderParam.content != null and orderParam.content != ''">-->
|
|
|
+ <!-- and o.order_number = #{orderParam.content}-->
|
|
|
+ <!-- </if>-->
|
|
|
|
|
|
+ <if test="orderParam.parentOrderNumber != null and orderParam.parentOrderNumber != ''">
|
|
|
+ and o.parent_order_number = #{orderParam.parentOrderNumber}
|
|
|
+ </if>
|
|
|
<if test="orderParam.orderNumber != null and orderParam.orderNumber != ''">
|
|
|
and o.order_number = #{orderParam.orderNumber}
|
|
|
</if>
|
|
|
-<!-- <if test="orderParam.type!=null and orderParam.type==2 and orderParam.orderNumber != null and orderParam.orderNumber != ''">-->
|
|
|
-<!-- and o.order_number = #{orderParam.orderNumber}-->
|
|
|
-<!-- </if>-->
|
|
|
-<!-- <if test="orderParam.type!=null and orderParam.type==4 and orderParam.content != null and orderParam.content != ''">-->
|
|
|
-<!-- and u.nick_name LIKE concat("%",#{orderParam.content},"%")-->
|
|
|
-<!-- </if>-->
|
|
|
-<!-- <if test="orderParam.type!=null and orderParam.type==5 and orderParam.content != null and orderParam.content != ''">-->
|
|
|
-<!-- and u.user_mobile LIKE concat("%",#{orderParam.content},"%")-->
|
|
|
-<!-- </if>-->
|
|
|
-<!-- <if test="orderParam.type!=null and orderParam.type==6 and orderParam.content != null and orderParam.content != ''">-->
|
|
|
-<!-- and u.dvy_flow_id = #{orderParam.content}-->
|
|
|
-<!-- </if>-->
|
|
|
<if test="orderParam.hbOrderStatus != null">
|
|
|
and o.hb_order_status = #{orderParam.hbOrderStatus}
|
|
|
</if>
|
|
|
-<!-- <if test="orderParam.payType != null">-->
|
|
|
-<!-- and o.pay_type = #{orderParam.payType}-->
|
|
|
-<!-- </if>-->
|
|
|
<if test="orderParam.dvyType != null">
|
|
|
and o.dvy_type = #{orderParam.dvyType}
|
|
|
</if>
|
|
|
@@ -447,13 +451,13 @@
|
|
|
and o.order_type = #{orderParam.orderType}
|
|
|
</if>
|
|
|
<if test="orderParam.orderType == null">
|
|
|
- and (o.order_type <![CDATA[ <> ]]> 3 OR o.order_type IS NULL)
|
|
|
+ and (o.order_type <![CDATA[ <> ]]> 3 OR o.order_type IS NULL)
|
|
|
</if>
|
|
|
<if test="orderParam.shopName != null">
|
|
|
and sd.shop_name LIKE concat("%",#{orderParam.shopName},"%")
|
|
|
</if>
|
|
|
<if test="orderParam.refundStatus == 0">
|
|
|
- and o.refund_status IS NULL
|
|
|
+ and o.refund_status IS NULL
|
|
|
</if>
|
|
|
<if test="orderParam.refundStatus != null and orderParam.refundStatus != 0">
|
|
|
and o.refund_status = #{orderParam.refundStatus}
|
|
|
@@ -461,21 +465,17 @@
|
|
|
<if test="orderParam.prodName != null">
|
|
|
and o.prod_name LIKE concat("%",#{orderParam.prodName},"%")
|
|
|
</if>
|
|
|
-<!-- <if test="orderParam.type!=null and orderParam.type==2 and orderParam.content != null and orderParam.content != ''">-->
|
|
|
-<!-- and uao.receiver LIKE concat("%",#{orderParam.content},"%")-->
|
|
|
-<!-- </if>-->
|
|
|
-<!-- <if test="orderParam.type!=null and orderParam.type==3 and orderParam.content != null and orderParam.content != ''">-->
|
|
|
-<!-- and uao.mobile LIKE concat("%",#{orderParam.content},"%")-->
|
|
|
-<!-- </if>-->
|
|
|
</where>
|
|
|
ORDER BY o.create_time DESC
|
|
|
LIMIT #{adapter.begin} , #{adapter.size}
|
|
|
) AS temp
|
|
|
LEFT JOIN tz_order_item oi ON temp.order_number = oi.order_number
|
|
|
<!--连接单个物品退款的退款信息-->
|
|
|
- LEFT JOIN tz_order_refund r ON r.order_item_id = oi.order_item_id AND r.refund_type = 2 AND r.return_money_sts > 0 AND r.return_money_sts < 6
|
|
|
+ LEFT JOIN tz_order_refund r ON r.order_item_id = oi.order_item_id AND r.refund_type = 2 AND r.return_money_sts
|
|
|
+ > 0 AND r.return_money_sts < 6
|
|
|
<!--连接整单退款的退款信息-->
|
|
|
- LEFT JOIN tz_order_refund ar ON ar.order_id = temp.order_id AND ar.refund_type = 1 AND ar.return_money_sts > 0 AND ar.return_money_sts < 6
|
|
|
+ LEFT JOIN tz_order_refund ar ON ar.order_id = temp.order_id AND ar.refund_type = 1 AND ar.return_money_sts >
|
|
|
+ 0 AND ar.return_money_sts < 6
|
|
|
LEFT JOIN tz_order_settlement os ON temp.order_number = os.order_number
|
|
|
ORDER BY temp.create_time DESC
|
|
|
</select>
|
|
|
@@ -484,13 +484,17 @@
|
|
|
SELECT a.*,b.receiver,b.mobile user_mobile,c.shop_name FROM tz_order a
|
|
|
LEFT JOIN tz_user_addr_order b on a.addr_order_id=b.addr_order_id
|
|
|
LEFT JOIN tz_shop_detail c on a.shop_id=c.shop_id
|
|
|
- left join tz_user d on a.user_id = d.user_id
|
|
|
+ left join tz_user d on a.user_id = d.user_id
|
|
|
<where>
|
|
|
<if test="orderParam.orderNumber != null and orderParam.orderNumber != ''">
|
|
|
and a.order_number = #{orderParam.orderNumber}
|
|
|
</if>
|
|
|
+
|
|
|
+ <if test="orderParam.parentOrderNumber != null and orderParam.parentOrderNumber != ''">
|
|
|
+ and a.parent_order_number = #{orderParam.parentOrderNumber}
|
|
|
+ </if>
|
|
|
<if test="orderParam.channelIdList != null and !orderParam.channelIdList.isEmpty()">
|
|
|
- and a.channel_id in
|
|
|
+ and a.channel_id in
|
|
|
<foreach collection="orderParam.channelIdList" item="channelId" open="(" close=")" separator=",">
|
|
|
#{channelId}
|
|
|
</foreach>
|
|
|
@@ -516,6 +520,7 @@
|
|
|
<if test="orderParam.receiver != null">
|
|
|
and b.receiver LIKE concat("%",#{orderParam.receiver},"%")
|
|
|
</if>
|
|
|
+
|
|
|
<if test="orderParam.userMobile != null">
|
|
|
and b.mobile LIKE concat("%",#{orderParam.userMobile},"%")
|
|
|
</if>
|
|
|
@@ -540,79 +545,33 @@
|
|
|
<if test="orderParam.orderStatus == 'cancel'">
|
|
|
AND a.hb_order_status in (50,60)
|
|
|
</if>
|
|
|
+ <if test="orderParam.orderStatus == 'split'">
|
|
|
+ AND a.hb_order_status in (1,20) and a.split_status in(2,3)
|
|
|
+ </if>
|
|
|
</if>
|
|
|
- </where>
|
|
|
- order by a.create_time desc,a.order_id desc
|
|
|
- LIMIT #{adapter.begin} , #{adapter.size}
|
|
|
- </select>
|
|
|
|
|
|
- <select id="deliverListCount" resultType="integer">
|
|
|
- SELECT count(1) FROM tz_order a
|
|
|
- LEFT JOIN tz_user_addr_order b on a.addr_order_id=b.addr_order_id
|
|
|
- LEFT JOIN tz_shop_detail c on a.shop_id=c.shop_id
|
|
|
- left join tz_user d on a.user_id = d.user_id
|
|
|
- <where>
|
|
|
- <if test="orderParam.orderNumber != null and orderParam.orderNumber != ''">
|
|
|
- and a.order_number = #{orderParam.orderNumber}
|
|
|
+ <if test="orderParam.orderSplitStatus != null">
|
|
|
+ and a.order_split_Status = #{orderParam.orderSplitStatus}
|
|
|
</if>
|
|
|
- <if test="orderParam.channelIdList != null and !orderParam.channelIdList.isEmpty()">
|
|
|
- and a.channel_id in
|
|
|
- <foreach collection="orderParam.channelIdList" item="channelId" open="(" close=")" separator=",">
|
|
|
- #{channelId}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="orderParam.dvyType != null and orderParam.dvyType != ''">
|
|
|
- and a.dvy_type = #{orderParam.dvyType}
|
|
|
- </if>
|
|
|
- <if test="orderParam.userAttrType != null and orderParam.userAttrType != '' and orderParam.userAttrType != 0">
|
|
|
- AND d.user_attr_type = #{orderParam.userAttrType}
|
|
|
+ <if test="orderParam.autoSplit != null">
|
|
|
+ and a.auto_split = #{orderParam.autoSplit}
|
|
|
</if>
|
|
|
- <if test="orderParam.shopId != null">
|
|
|
- and a.shop_id = #{orderParam.shopId}
|
|
|
- </if>
|
|
|
- <if test="orderParam.startTime != null">
|
|
|
- and a.create_time > #{orderParam.startTime}
|
|
|
- </if>
|
|
|
- <if test="orderParam.endTime != null">
|
|
|
- and a.create_time < #{orderParam.endTime}
|
|
|
- </if>
|
|
|
- <if test="orderParam.refundStatus != null and orderParam.refundStatus != 0">
|
|
|
- and a.refund_status = #{orderParam.refundStatus}
|
|
|
- </if>
|
|
|
- <if test="orderParam.receiver != null">
|
|
|
- and b.receiver LIKE concat("%",#{orderParam.receiver},"%")
|
|
|
- </if>
|
|
|
- <if test="orderParam.userMobile != null">
|
|
|
- and b.mobile LIKE concat("%",#{orderParam.userMobile},"%")
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="orderParam.orderStatus != null and orderParam.orderStatus != ''">
|
|
|
- <if test="orderParam.orderStatus == 'all'">
|
|
|
- AND a.hb_order_status in (0, 1,20,30,40,50,60,70,80)
|
|
|
+ <if test="orderParam.splitStatus != null">
|
|
|
+ <if test="orderParam.splitStatus == 2">
|
|
|
+ and a.split_status in (2,3)
|
|
|
</if>
|
|
|
- <if test="orderParam.orderStatus == 'paddingPay'">
|
|
|
- AND a.hb_order_status in (0)
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="orderParam.orderStatus == 'paddingShipped'">
|
|
|
- AND a.hb_order_status in (1)
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="orderParam.orderStatus == 'paddingReceived'">
|
|
|
- AND a.hb_order_status in (20,30,40,70)
|
|
|
- </if>
|
|
|
- <if test="orderParam.orderStatus == 'completed'">
|
|
|
- AND a.hb_order_status in (80)
|
|
|
- </if>
|
|
|
- <if test="orderParam.orderStatus == 'cancel'">
|
|
|
- AND a.hb_order_status in (50,60)
|
|
|
+ <if test="orderParam.splitStatus != 2">
|
|
|
+ and a.split_status = #{orderParam.splitStatus}
|
|
|
</if>
|
|
|
</if>
|
|
|
+ <if test="orderParam.orderLevel != null">
|
|
|
+ and a.order_level = #{orderParam.orderLevel}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
+ order by a.create_time desc,a.order_id desc
|
|
|
</select>
|
|
|
|
|
|
|
|
|
-
|
|
|
<select id="countOrderDetial" resultType="long">
|
|
|
SELECT count(0)
|
|
|
FROM tz_order o
|
|
|
@@ -656,7 +615,7 @@
|
|
|
and sd.shop_name LIKE concat("%",#{orderParam.shopName},"%")
|
|
|
</if>
|
|
|
<if test="orderParam.refundStatus == 0">
|
|
|
- and o.refund_status IS NULL
|
|
|
+ and o.refund_status IS NULL
|
|
|
</if>
|
|
|
<if test="orderParam.refundStatus != null and orderParam.refundStatus != 0">
|
|
|
and o.refund_status = #{orderParam.refundStatus}
|
|
|
@@ -675,11 +634,12 @@
|
|
|
|
|
|
|
|
|
<select id="calculateUserInShopData" resultType="com.yami.shop.bean.distribution.UserShoppingDataDto">
|
|
|
- select
|
|
|
- count(o.order_number) as expense_number,
|
|
|
- ifnull(SUM(o.actual_total),0) as expense_amount
|
|
|
+ select count(o.order_number) as expense_number,
|
|
|
+ ifnull(SUM(o.actual_total), 0) as expense_amount
|
|
|
from tz_order o
|
|
|
- where o.user_id=#{userId} and o.shop_id = #{shopId} and (o.hb_order_status = 45 or o.hb_order_status = 80)
|
|
|
+ where o.user_id = #{userId}
|
|
|
+ and o.shop_id = #{shopId}
|
|
|
+ and (o.hb_order_status = 45 or o.hb_order_status = 80)
|
|
|
</select>
|
|
|
|
|
|
<select id="listMyOrderByUserIdAndStatus" resultMap="MyOrderMap">
|
|
|
@@ -691,20 +651,25 @@
|
|
|
o.pay_time,
|
|
|
o.dvy_type,
|
|
|
o.comm_sts,
|
|
|
- (SELECT r.refund_type FROM tz_order_refund r WHERE r.order_id =o.order_id ORDER BY r.update_time DESC LIMIT 0,1) AS refund_type,
|
|
|
- (SELECT r.return_money_sts FROM tz_order_refund r WHERE r.order_id =o.order_id ORDER BY r.update_time DESC LIMIT 0,1) AS return_money_sts,
|
|
|
- oi.pic,oi.price,oi.prod_name,oi.pic,oi.sku_name,ifnull(oi.use_score,0) as use_score,oi.prod_id,oi.rec_time,oi.prod_count,oi.order_item_id,oi.comm_sts,
|
|
|
+ (SELECT r.refund_type FROM tz_order_refund r WHERE r.order_id =o.order_id ORDER BY r.update_time DESC LIMIT 0,1)
|
|
|
+ AS refund_type,
|
|
|
+ (SELECT r.return_money_sts FROM tz_order_refund r WHERE r.order_id =o.order_id ORDER BY r.update_time DESC LIMIT
|
|
|
+ 0,1) AS return_money_sts,
|
|
|
+ oi.pic,oi.price,oi.prod_name,oi.pic,oi.sku_name,ifnull(oi.use_score,0) as
|
|
|
+ use_score,oi.prod_id,oi.rec_time,oi.prod_count,oi.order_item_id,oi.comm_sts,
|
|
|
sd.shop_id,sd.shop_name,oi.actual_total as oi_actual_total,ad.longitude,ad.latitude
|
|
|
FROM (
|
|
|
SELECT temp.order_type,
|
|
|
- temp.hb_order_status,
|
|
|
- temp.hb_logistic_status,
|
|
|
- temp.offset_points,
|
|
|
- temp.pay_time,
|
|
|
- temp.dvy_type,
|
|
|
- temp.comm_sts,
|
|
|
- temp.order_id, temp.create_time, temp.freight_amount,temp.order_number,temp.actual_total,temp.shop_id,temp.addr_order_id FROM tz_order temp
|
|
|
+ temp.hb_order_status,
|
|
|
+ temp.hb_logistic_status,
|
|
|
+ temp.offset_points,
|
|
|
+ temp.pay_time,
|
|
|
+ temp.dvy_type,
|
|
|
+ temp.comm_sts,
|
|
|
+ temp.order_id, temp.create_time,
|
|
|
+ temp.freight_amount,temp.order_number,temp.actual_total,temp.shop_id,temp.addr_order_id FROM tz_order temp
|
|
|
WHERE temp.user_id = #{userId} and temp.delete_status=0
|
|
|
+ and (temp.order_level != 0 OR temp.split_status != 4) and (temp.order_level != 1 OR temp.split_status != 3)
|
|
|
<if test="status != null">
|
|
|
AND
|
|
|
<choose>
|
|
|
@@ -732,22 +697,18 @@
|
|
|
|
|
|
|
|
|
<select id="countMyOrderByUserIdAndStatus" resultType="Long">
|
|
|
- SELECT count(*)
|
|
|
- FROM (
|
|
|
- SELECT count(*) FROM tz_order temp
|
|
|
- JOIN tz_order_item oi ON temp.order_number = oi.order_number
|
|
|
+ SELECT count(temp.order_id) FROM tz_order temp
|
|
|
WHERE temp.user_id = #{userId} and temp.delete_status = 0
|
|
|
- <if test="status != null and status != 0">
|
|
|
- AND temp.hb_order_status = #{status}
|
|
|
- </if>
|
|
|
- <if test="isComm != null">
|
|
|
- AND temp.hb_order_status = 80
|
|
|
- </if>
|
|
|
- <if test="isComm != null">
|
|
|
- AND oi.comm_sts = #{isComm}
|
|
|
+ <if test="status != null">
|
|
|
+ <if test="20 == status">
|
|
|
+ and temp.hb_order_status IN (1,20,30,40,50,70)
|
|
|
+
|
|
|
+ </if>
|
|
|
+ <if test="20 != status">
|
|
|
+ AND temp.hb_order_status = #{status}
|
|
|
+ </if>
|
|
|
</if>
|
|
|
- group by temp.order_id
|
|
|
- )AS o
|
|
|
+ and (temp.order_level != 0 OR temp.split_status != 4) and (temp.order_level != 1 OR temp.split_status != 3)
|
|
|
</select>
|
|
|
|
|
|
|
|
|
@@ -760,65 +721,83 @@
|
|
|
</update>
|
|
|
|
|
|
<select id="getOrderCount" resultType="com.yami.shop.bean.app.dto.OrderCountData">
|
|
|
- SELECT
|
|
|
- COUNT(o.order_id) all_count,
|
|
|
- COUNT( CASE WHEN o.hb_order_status = 0 THEN o.order_id ELSE NULL END ) AS unPay,
|
|
|
- COUNT( CASE WHEN o.hb_order_status = 1 THEN o.order_id ELSE NULL END ) AS payed,
|
|
|
- COUNT( CASE WHEN o.hb_order_status in (1,20,30,40,50,70) THEN o.order_id ELSE NULL END ) AS consignment,
|
|
|
- COUNT( CASE WHEN o.hb_order_status = 40 THEN o.order_id ELSE NULL END ) AS confirm,
|
|
|
- COUNT( CASE WHEN o.hb_order_status = 80 THEN o.order_id ELSE NULL END ) AS success,
|
|
|
- COUNT( CASE WHEN o.hb_order_status = 60 THEN o.order_id ELSE NULL END ) AS `close`
|
|
|
+ SELECT COUNT(o.order_id) all_count,
|
|
|
+ COUNT(CASE WHEN o.hb_order_status = 0 THEN o.order_id ELSE NULL END) AS unPay,
|
|
|
+ COUNT(CASE WHEN o.hb_order_status = 1 THEN o.order_id ELSE NULL END) AS payed,
|
|
|
+ COUNT(CASE
|
|
|
+ WHEN o.hb_order_status in (1, 20, 30, 40, 50, 70) THEN o.order_id
|
|
|
+ ELSE NULL END) AS consignment,
|
|
|
+ COUNT(CASE WHEN o.hb_order_status = 40 THEN o.order_id ELSE NULL END) AS confirm,
|
|
|
+ COUNT(CASE WHEN o.hb_order_status = 80 THEN o.order_id ELSE NULL END) AS success,
|
|
|
+ COUNT(CASE WHEN o.hb_order_status = 60 THEN o.order_id ELSE NULL END) AS `close`
|
|
|
FROM tz_order o
|
|
|
- WHERE o.user_id =#{userId} AND o.delete_status = 0
|
|
|
+ WHERE o.user_id = #{userId}
|
|
|
+ AND o.delete_status = 0
|
|
|
+ and (o.order_level != 0 OR o.split_status != 4)
|
|
|
+ and (o.order_level != 1 OR o.split_status != 3)
|
|
|
</select>
|
|
|
<update id="cancelSeckillOrderByTime">
|
|
|
UPDATE tz_order o JOIN (
|
|
|
- SELECT so.order_number FROM tz_seckill_order so JOIN
|
|
|
+ SELECT so.order_number FROM tz_seckill_order so JOIN
|
|
|
tz_seckill s ON s.seckill_id = so.seckill_id
|
|
|
- AND (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(so.`create_time`))/60 > s.`max_cancel_time` and so.state = 0 ) t
|
|
|
- ON o.order_number = t.order_number
|
|
|
- SET o.`hb_order_status`=60,o.cancel_time = NOW(),o.update_time=NOW()
|
|
|
+ AND (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(so.`create_time`))/60 > s.`max_cancel_time` and so.state = 0 ) t
|
|
|
+ ON o.order_number = t.order_number
|
|
|
+ SET o.`hb_order_status`=60, o.cancel_time = NOW(), o.update_time=NOW()
|
|
|
</update>
|
|
|
|
|
|
<update id="updateToWaitGroup">
|
|
|
- UPDATE tz_order SET hb_order_status = 7,update_time=NOW() WHERE order_number = #{orderNumber}
|
|
|
+ UPDATE tz_order
|
|
|
+ SET hb_order_status = 7,
|
|
|
+ update_time=NOW()
|
|
|
+ WHERE order_number = #{orderNumber}
|
|
|
</update>
|
|
|
|
|
|
<update id="updateToWaitDelivery">
|
|
|
- UPDATE tz_order SET `hb_order_status` = 20, `update_time` = NOW()
|
|
|
+ UPDATE tz_order
|
|
|
+ SET `hb_order_status` = 20,
|
|
|
+ `update_time` = NOW()
|
|
|
WHERE `order_number` IN
|
|
|
- (
|
|
|
- SELECT order_number FROM
|
|
|
- (SELECT o.`order_number` FROM tz_order o
|
|
|
- LEFT JOIN tz_group_order go ON go.`order_number` = o.`order_number`
|
|
|
- LEFT JOIN tz_group_team gt ON gt.`group_team_id` = go.`group_team_id`
|
|
|
- WHERE gt.`group_team_id` = #{groupTeamId}) temp
|
|
|
- )
|
|
|
+ (SELECT order_number
|
|
|
+ FROM (SELECT o.`order_number`
|
|
|
+ FROM tz_order o
|
|
|
+ LEFT JOIN tz_group_order go
|
|
|
+ ON go.`order_number` = o.`order_number`
|
|
|
+ LEFT JOIN tz_group_team gt ON gt.`group_team_id` = go.`group_team_id`
|
|
|
+ WHERE gt.`group_team_id` = #{groupTeamId}) temp)
|
|
|
</update>
|
|
|
|
|
|
<select id="getOrderByOrderNumberAndUserId" resultType="com.yami.shop.bean.model.Order">
|
|
|
- select o.* from tz_order o where o.order_number = #{orderNumber} and o.user_id = #{userId}
|
|
|
+ select o.*
|
|
|
+ from tz_order o
|
|
|
+ where o.order_number = #{orderNumber}
|
|
|
+ and o.user_id = #{userId}
|
|
|
</select>
|
|
|
|
|
|
<select id="getOrderAndOrderItemByOrderNumber" resultMap="orderAndOrderItemMap">
|
|
|
- select o.*,oi.*,oi.prod_name oi_prod_name,oi.actual_total as oi_actual_total from tz_order o
|
|
|
- left join tz_order_item oi on o.order_number = oi.order_number
|
|
|
+ select o.*, oi.*, oi.prod_name oi_prod_name, oi.actual_total as oi_actual_total
|
|
|
+ from tz_order o
|
|
|
+ left join tz_order_item oi on o.order_number = oi.order_number
|
|
|
where o.order_number = #{orderNumber}
|
|
|
</select>
|
|
|
|
|
|
<select id="hasBuySuccessProd" resultType="java.lang.Integer">
|
|
|
- select count(*) from tz_order_item oi
|
|
|
+ select count(*)
|
|
|
+ from tz_order_item oi
|
|
|
join tz_order o on o.order_number = oi.order_number
|
|
|
- where o.user_id=#{userId} and o.hb_order_status = 50 and oi.prod_id = #{prodId}
|
|
|
+ where o.user_id = #{userId}
|
|
|
+ and o.hb_order_status = 50
|
|
|
+ and oi.prod_id = #{prodId}
|
|
|
</select>
|
|
|
|
|
|
<select id="listMyOrderByParams" resultMap="MyOrderMap">
|
|
|
SELECT
|
|
|
o.order_type,o.actual_total,
|
|
|
- oi.pic,oi.price,oi.prod_id,oi.prod_name,oi.sku_name,ifnull(oi.use_score,0) as use_score,oi.prod_count,oi.order_item_id,o.hb_order_status,o.order_number,oi.comm_sts,
|
|
|
+ oi.pic,oi.price,oi.prod_id,oi.prod_name,oi.sku_name,ifnull(oi.use_score,0) as
|
|
|
+ use_score,oi.prod_count,oi.order_item_id,o.hb_order_status,o.order_number,oi.comm_sts,
|
|
|
sd.shop_id,sd.shop_name
|
|
|
FROM (
|
|
|
- SELECT temp.order_type, temp.create_time, temp.order_number,temp.actual_total,temp.hb_order_status,temp.shop_id,prod_name
|
|
|
+ SELECT temp.order_type, temp.create_time,
|
|
|
+ temp.order_number,temp.actual_total,temp.hb_order_status,temp.shop_id,prod_name
|
|
|
FROM tz_order temp
|
|
|
WHERE temp.user_id = #{userId} and temp.delete_status = 0
|
|
|
<if test="status != null and status != 0">
|
|
|
@@ -852,38 +831,39 @@
|
|
|
|
|
|
<select id="countMyOrderByParams" resultType="Long">
|
|
|
SELECT COUNT(*) FROM(
|
|
|
- SELECT
|
|
|
- count(1)
|
|
|
- FROM tz_order o
|
|
|
- JOIN tz_order_item oi ON o.order_number = oi.order_number
|
|
|
- join tz_shop_detail sd on o.shop_id = sd.shop_id
|
|
|
- WHERE o.user_id = #{userId} and o.delete_status = 0
|
|
|
- <if test="status != null and status != 0">
|
|
|
- AND o.hb_order_status = #{status}
|
|
|
- </if>
|
|
|
- <if test="orderNumber != null and orderNumber != ''">
|
|
|
- AND o.order_number LIKE CONCAT("%",#{orderNumber},"%")
|
|
|
- </if>
|
|
|
- <if test="orderType == 0">
|
|
|
- AND (o.order_type = 0 or o.order_type is null)
|
|
|
- </if>
|
|
|
- <if test="orderType != null and orderType !='' and orderType != 0">
|
|
|
- AND o.order_type = #{orderType}
|
|
|
- </if>
|
|
|
- <if test="orderTimeStatus == 1 or orderTimeStatus == 2">
|
|
|
- AND o.create_time >= #{preTime}
|
|
|
- </if>
|
|
|
- <if test="orderTimeStatus == 3">
|
|
|
- AND o.create_time <= #{preTime}
|
|
|
- </if>
|
|
|
- <if test="orderName != null and orderName != ''">
|
|
|
- AND (o.prod_name LIKE concat('%',#{orderName},'%') OR oi.prod_name LIKE concat('%',#{orderName},'%'))
|
|
|
- </if>
|
|
|
- GROUP BY o.order_number
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ FROM tz_order o
|
|
|
+ JOIN tz_order_item oi ON o.order_number = oi.order_number
|
|
|
+ join tz_shop_detail sd on o.shop_id = sd.shop_id
|
|
|
+ WHERE o.user_id = #{userId} and o.delete_status = 0
|
|
|
+ <if test="status != null and status != 0">
|
|
|
+ AND o.hb_order_status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="orderNumber != null and orderNumber != ''">
|
|
|
+ AND o.order_number LIKE CONCAT("%",#{orderNumber},"%")
|
|
|
+ </if>
|
|
|
+ <if test="orderType == 0">
|
|
|
+ AND (o.order_type = 0 or o.order_type is null)
|
|
|
+ </if>
|
|
|
+ <if test="orderType != null and orderType !='' and orderType != 0">
|
|
|
+ AND o.order_type = #{orderType}
|
|
|
+ </if>
|
|
|
+ <if test="orderTimeStatus == 1 or orderTimeStatus == 2">
|
|
|
+ AND o.create_time >= #{preTime}
|
|
|
+ </if>
|
|
|
+ <if test="orderTimeStatus == 3">
|
|
|
+ AND o.create_time <= #{preTime}
|
|
|
+ </if>
|
|
|
+ <if test="orderName != null and orderName != ''">
|
|
|
+ AND (o.prod_name LIKE concat('%',#{orderName},'%') OR oi.prod_name LIKE concat('%',#{orderName},'%'))
|
|
|
+ </if>
|
|
|
+ GROUP BY o.order_number
|
|
|
) AS temp
|
|
|
</select>
|
|
|
<select id="listOrdersDetialByOrderInfo" resultMap="orderAndOrderItemAndUserAddrMap">
|
|
|
- SELECT *,oi.prod_name,uao.address,uao.address_name,uao.addr_detail as item_prod_name,oi.actual_total as oi_actual_total,temp.prod_name as order_prod_name,temp.hb_order_status as oi_status
|
|
|
+ SELECT *,oi.prod_name,uao.address,uao.address_name,uao.addr_detail as item_prod_name,oi.actual_total as
|
|
|
+ oi_actual_total,temp.prod_name as order_prod_name,temp.hb_order_status as oi_status
|
|
|
FROM
|
|
|
(
|
|
|
SELECT o.*,sd.shop_name FROM tz_order o
|
|
|
@@ -918,7 +898,7 @@
|
|
|
and sd.shop_name LIKE concat("%",#{orderParam.shopName},"%")
|
|
|
</if>
|
|
|
<if test="orderParam.refundStatus == 0">
|
|
|
- and o.refund_status IS NULL
|
|
|
+ and o.refund_status IS NULL
|
|
|
</if>
|
|
|
<if test="orderParam.refundStatus != null and orderParam.refundStatus != 0">
|
|
|
and o.refund_status = #{orderParam.refundStatus}
|
|
|
@@ -953,39 +933,64 @@
|
|
|
</foreach>
|
|
|
</select>
|
|
|
<select id="getOrderDetailByOrderNumberAndShopId" resultMap="orderAndOrderItemAndUserAddrMap">
|
|
|
- SELECT o.*,oi.prod_name as item_prod_name,oi.*,uao.*,u.`nick_name`,u.user_mobile,o.hb_order_status as oi_status, IF(o.refund_type = 1,
|
|
|
- o.rms,r.return_money_sts) AS oi_return_money_sts
|
|
|
+ SELECT o.*,oi.prod_name as item_prod_name,oi.*,uao.*,u.`nick_name`,u.user_mobile,o.hb_order_status as oi_status,
|
|
|
+ IF(o.refund_type = 1,
|
|
|
+ o.rms,r.return_money_sts) AS oi_return_money_sts
|
|
|
FROM (
|
|
|
- SELECT temp.*,tr.refund_type,tr.return_money_sts rms
|
|
|
- FROM tz_order temp
|
|
|
- LEFT JOIN tz_order_refund tr ON tr.order_id = temp.order_id AND tr.return_money_sts > 0 AND
|
|
|
- tr.return_money_sts < 6
|
|
|
- WHERE temp.order_number =#{orderNumber}
|
|
|
- <if test="shopId != null">
|
|
|
- and temp.shop_id =#{shopId}
|
|
|
- </if>
|
|
|
+ SELECT temp.*,tr.refund_type,tr.return_money_sts rms
|
|
|
+ FROM tz_order temp
|
|
|
+ LEFT JOIN tz_order_refund tr ON tr.order_id = temp.order_id AND tr.return_money_sts > 0 AND
|
|
|
+ tr.return_money_sts < 6
|
|
|
+ WHERE temp.order_number =#{orderNumber}
|
|
|
+ <if test="shopId != null">
|
|
|
+ and temp.shop_id =#{shopId}
|
|
|
+ </if>
|
|
|
) as o
|
|
|
LEFT JOIN tz_order_item oi ON oi.order_number = o.order_number
|
|
|
- LEFT JOIN tz_order_refund r ON r.order_item_id = oi.order_item_id AND r.return_money_sts > 0 AND r.return_money_sts < 6
|
|
|
+ LEFT JOIN tz_order_refund r ON r.order_item_id = oi.order_item_id AND r.return_money_sts > 0 AND
|
|
|
+ r.return_money_sts < 6
|
|
|
LEFT JOIN tz_user_addr_order uao ON o.addr_order_id = uao.addr_order_id
|
|
|
LEFT JOIN tz_user u ON u.user_id = o.user_id
|
|
|
</select>
|
|
|
<select id="OrderCommentByUserIdAndStatus" resultMap="MyOrderMap">
|
|
|
- SELECT
|
|
|
- o.order_type,o.actual_total,o.hb_order_status,o.order_number,o.freight_amount,o.create_time,
|
|
|
- pc.rec_time,
|
|
|
- oi.pic,oi.price,oi.prod_name,oi.pic,oi.sku_name,oi.use_score,oi.prod_id,oi.rec_time,oi.prod_count,oi.order_item_id,oi.comm_sts,
|
|
|
- sd.shop_id,sd.shop_name,oi.actual_total as oi_actual_total
|
|
|
- FROM (
|
|
|
- SELECT DISTINCT temp.order_type, temp.create_time, temp.freight_amount,temp.order_number,temp.actual_total,temp.hb_order_status,temp.shop_id FROM tz_order temp
|
|
|
- JOIN tz_order_item toi ON temp.order_number = toi.order_number AND toi.comm_sts = #{isComm}
|
|
|
- WHERE temp.user_id = #{userId} and temp.delete_status = 0 AND temp.hb_order_status = 80
|
|
|
- ORDER BY temp.create_time DESC
|
|
|
- LIMIT #{adapter.begin} , #{adapter.size}
|
|
|
- )AS o
|
|
|
- JOIN tz_order_item oi ON o.order_number = oi.order_number AND oi.comm_sts = #{isComm}
|
|
|
- left JOIN tz_prod_comm pc ON pc.order_item_id = oi.order_item_id
|
|
|
- left join tz_shop_detail sd on o.shop_id = sd.shop_id
|
|
|
+ SELECT o.order_type,
|
|
|
+ o.actual_total,
|
|
|
+ o.hb_order_status,
|
|
|
+ o.order_number,
|
|
|
+ o.freight_amount,
|
|
|
+ o.create_time,
|
|
|
+ pc.rec_time,
|
|
|
+ oi.pic,
|
|
|
+ oi.price,
|
|
|
+ oi.prod_name,
|
|
|
+ oi.pic,
|
|
|
+ oi.sku_name,
|
|
|
+ oi.use_score,
|
|
|
+ oi.prod_id,
|
|
|
+ oi.rec_time,
|
|
|
+ oi.prod_count,
|
|
|
+ oi.order_item_id,
|
|
|
+ oi.comm_sts,
|
|
|
+ sd.shop_id,
|
|
|
+ sd.shop_name,
|
|
|
+ oi.actual_total as oi_actual_total
|
|
|
+ FROM (SELECT DISTINCT temp.order_type,
|
|
|
+ temp.create_time,
|
|
|
+ temp.freight_amount,
|
|
|
+ temp.order_number,
|
|
|
+ temp.actual_total,
|
|
|
+ temp.hb_order_status,
|
|
|
+ temp.shop_id
|
|
|
+ FROM tz_order temp
|
|
|
+ JOIN tz_order_item toi ON temp.order_number = toi.order_number AND toi.comm_sts = #{isComm}
|
|
|
+ WHERE temp.user_id = #{userId}
|
|
|
+ and temp.delete_status = 0
|
|
|
+ AND temp.hb_order_status = 80
|
|
|
+ ORDER BY temp.create_time DESC
|
|
|
+ LIMIT #{adapter.begin}, #{adapter.size}) AS o
|
|
|
+ JOIN tz_order_item oi ON o.order_number = oi.order_number AND oi.comm_sts = #{isComm}
|
|
|
+ left JOIN tz_prod_comm pc ON pc.order_item_id = oi.order_item_id
|
|
|
+ left join tz_shop_detail sd on o.shop_id = sd.shop_id
|
|
|
ORDER BY o.create_time DESC
|
|
|
</select>
|
|
|
<select id="orderItemCommentByUserIdAndStatus" resultMap="MyOrderItemMap">
|
|
|
@@ -1017,7 +1022,7 @@
|
|
|
SELECT count(a.order_id) FROM `tz_order` a
|
|
|
LEFT JOIN tz_user_addr_order b on a.addr_order_id=b.addr_order_id
|
|
|
LEFT JOIN tz_shop_detail c on a.shop_id=c.shop_id
|
|
|
- left join tz_user d on a.user_id = d.user_id
|
|
|
+ left join tz_user d on a.user_id = d.user_id
|
|
|
<where>
|
|
|
hb_order_status in
|
|
|
<foreach collection="status" item="status" separator="," open="(" close=")">
|
|
|
@@ -1026,8 +1031,11 @@
|
|
|
<if test="orderParam.orderNumber != null and orderParam.orderNumber != ''">
|
|
|
and a.order_number = #{orderParam.orderNumber}
|
|
|
</if>
|
|
|
+ <if test="orderParam.parentOrderNumber != null and orderParam.parentOrderNumber != ''">
|
|
|
+ and a.parent_order_number = #{orderParam.parentOrderNumber}
|
|
|
+ </if>
|
|
|
<if test="orderParam.channelIdList != null and !orderParam.channelIdList.isEmpty()">
|
|
|
- and a.channel_id in
|
|
|
+ and a.channel_id in
|
|
|
<foreach collection="orderParam.channelIdList" item="channelId" open="(" close=")" separator=",">
|
|
|
#{channelId}
|
|
|
</foreach>
|
|
|
@@ -1079,6 +1087,25 @@
|
|
|
AND a.hb_order_status in (50,60)
|
|
|
</if>
|
|
|
</if>
|
|
|
+
|
|
|
+
|
|
|
+ <if test="orderParam.orderSplitStatus != null">
|
|
|
+ and a.order_split_Status = #{orderParam.orderSplitStatus}
|
|
|
+ </if>
|
|
|
+ <if test="orderParam.autoSplit != null">
|
|
|
+ and a.auto_split = #{orderParam.autoSplit}
|
|
|
+ </if>
|
|
|
+ <if test="orderParam.splitStatus != null">
|
|
|
+ <if test="orderParam.splitStatus == 2">
|
|
|
+ and a.split_status in (2,3)
|
|
|
+ </if>
|
|
|
+ <if test="orderParam.splitStatus != 2">
|
|
|
+ and a.split_status = #{orderParam.splitStatus}
|
|
|
+ </if>
|
|
|
+ </if>
|
|
|
+ <if test="orderParam.orderLevel != null">
|
|
|
+ and a.order_level = #{orderParam.orderLevel}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
<select id="selectOrderCount" resultType="com.yami.shop.bean.param.OrderCountParam">
|
|
|
@@ -1121,7 +1148,7 @@
|
|
|
</if>
|
|
|
|
|
|
<if test="orderParam.refundStatus == 0">
|
|
|
- and o.refund_status IS NULL
|
|
|
+ and o.refund_status IS NULL
|
|
|
</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
@@ -1135,7 +1162,7 @@
|
|
|
<where>
|
|
|
o.delete_status = 0 AND o.dvy_type = #{orderParam.dvyType}
|
|
|
<if test="orderParam.orderNumber != null and orderParam.orderNumber != ''">
|
|
|
- AND o.order_number LIKE concat('%', #{orderParam.orderNumber}, '%')
|
|
|
+ AND o.order_number LIKE concat('%', #{orderParam.orderNumber}, '%')
|
|
|
</if>
|
|
|
<if test="orderParam.mobile != null and orderParam.mobile != ''">
|
|
|
AND uao.mobile LIKE concat('%', #{orderParam.mobile}, '%')
|
|
|
@@ -1181,13 +1208,13 @@
|
|
|
LEFT JOIN tz_user_addr_order b on a.addr_order_id=b.addr_order_id
|
|
|
LEFT JOIN tz_shop_detail c on a.shop_id=c.shop_id
|
|
|
LEFT JOIN tz_channel d on a.channel_id=d.id
|
|
|
- left join tz_user e on a.user_id = e.user_id
|
|
|
+ left join tz_user e on a.user_id = e.user_id
|
|
|
<where>
|
|
|
<if test="orderParam.orderNumber != null and orderParam.orderNumber != ''">
|
|
|
and a.order_number = #{orderParam.orderNumber}
|
|
|
</if>
|
|
|
<if test="orderParam.channelIdList != null and !orderParam.channelIdList.isEmpty()">
|
|
|
- and a.channel_id in
|
|
|
+ and a.channel_id in
|
|
|
<foreach collection="orderParam.channelIdList" item="channelId" open="(" close=")" separator=",">
|
|
|
#{channelId}
|
|
|
</foreach>
|
|
|
@@ -1268,6 +1295,10 @@
|
|
|
<if test="orderParam.orderNumber != null and orderParam.orderNumber != ''">
|
|
|
and a.order_number = #{orderParam.orderNumber}
|
|
|
</if>
|
|
|
+
|
|
|
+ <if test="orderParam.parentOrderNumber != null and orderParam.parentOrderNumber != ''">
|
|
|
+ and a.parent_order_number = #{orderParam.parentOrderNumber}
|
|
|
+ </if>
|
|
|
<if test="orderParam.channelIdList != null and !orderParam.channelIdList.isEmpty()">
|
|
|
and a.channel_id in
|
|
|
<foreach collection="orderParam.channelIdList" item="channelId" open="(" close=")" separator=",">
|