|
@@ -92,7 +92,7 @@
|
|
|
tiu.user_name as riderNickName,tiu.phone as riderPhone,ti.indent_id as indentId,ti.is_rider as isRider,
|
|
tiu.user_name as riderNickName,tiu.phone as riderPhone,ti.indent_id as indentId,ti.is_rider as isRider,
|
|
|
ti.rider_user_id as riderUserId, tcu.money as couponMoney,
|
|
ti.rider_user_id as riderUserId, tcu.money as couponMoney,
|
|
|
apr.discount_amount as activityDiscountAmount, ai.title activityTitle,tiu.rider_station_id as riderStationId,
|
|
apr.discount_amount as activityDiscountAmount, ai.title activityTitle,tiu.rider_station_id as riderStationId,
|
|
|
- (select st.shop_type_name from shop_type st where st.id =gs.shop_type_id ) as shopTypeName,
|
|
|
|
|
|
|
+ (select st.shop_type_name from shop_type st where st.id =gs.shop_type_id ) as shopTypeName,
|
|
|
(case when tcu.shop_id =0 then '平台' else gs2.shop_name end) as couponTypeRemark,
|
|
(case when tcu.shop_id =0 then '平台' else gs2.shop_name end) as couponTypeRemark,
|
|
|
pd.trade_no as transactionId
|
|
pd.trade_no as transactionId
|
|
|
from tb_order tor
|
|
from tb_order tor
|
|
@@ -197,8 +197,8 @@
|
|
|
tiu.nick_name as riderNickName,tiu.phone as riderPhone,ti.indent_id as indentId,ti.is_rider as isRider,
|
|
tiu.nick_name as riderNickName,tiu.phone as riderPhone,ti.indent_id as indentId,ti.is_rider as isRider,
|
|
|
ti.rider_user_id as riderUserId, tcu.money as couponMoney,
|
|
ti.rider_user_id as riderUserId, tcu.money as couponMoney,
|
|
|
apr.discount_amount as activityDiscountAmount, ai.title activityTitle,ogg.detail,ogg.sumPrice,
|
|
apr.discount_amount as activityDiscountAmount, ai.title activityTitle,ogg.detail,ogg.sumPrice,
|
|
|
- (select rs.station_name from rider_station rs where rs.id =tiu.rider_station_id ) as stationName,
|
|
|
|
|
- (select st.shop_type_name from shop_type st where st.id =gs.shop_type_id ) as shopTypeName,
|
|
|
|
|
|
|
+ (select rs.station_name from rider_station rs where rs.id =tiu.rider_station_id ) as stationName,
|
|
|
|
|
+ (select st.shop_type_name from shop_type st where st.id =gs.shop_type_id ) as shopTypeName,
|
|
|
(case when tcu.shop_id =0 then '平台' else gs2.shop_name end) as couponTypeRemark
|
|
(case when tcu.shop_id =0 then '平台' else gs2.shop_name end) as couponTypeRemark
|
|
|
from tb_order tor
|
|
from tb_order tor
|
|
|
left join tb_user tu on tor.user_id = tu.user_id
|
|
left join tb_user tu on tor.user_id = tu.user_id
|
|
@@ -208,7 +208,8 @@
|
|
|
left join tb_coupon_user tcu on tor.coupon_id = tcu.id
|
|
left join tb_coupon_user tcu on tor.coupon_id = tcu.id
|
|
|
left join activity_part_record apr on apr.order_id = tor.order_id
|
|
left join activity_part_record apr on apr.order_id = tor.order_id
|
|
|
left join activity ai on ai.id = apr.activity_id
|
|
left join activity ai on ai.id = apr.activity_id
|
|
|
- left join ( select @a:=0,order_id ,group_concat(@a:=@a+1,".商品名:",goods_name,",数量:",goods_num,",规格:",sku_message) detail,sum(goods_num*goods_price) sumPrice from order_goods og group by order_id
|
|
|
|
|
|
|
+ left join ( select @a:=0,order_id ,group_concat(@a:=@a+1,".商品名:",goods_name,",数量:",goods_num,",规格:",sku_message)
|
|
|
|
|
+ detail,sum(goods_num*goods_price) sumPrice from order_goods og group by order_id
|
|
|
) ogg on ogg.order_id =tor.order_id
|
|
) ogg on ogg.order_id =tor.order_id
|
|
|
left join goods_shop gs2 on gs2.shop_id=tcu.shop_id
|
|
left join goods_shop gs2 on gs2.shop_id=tcu.shop_id
|
|
|
where 1 = 1
|
|
where 1 = 1
|
|
@@ -440,7 +441,8 @@
|
|
|
|
|
|
|
|
<select id="waitTakeFood" resultType="com.sqx.modules.order.entity.TbOrder">
|
|
<select id="waitTakeFood" resultType="com.sqx.modules.order.entity.TbOrder">
|
|
|
select tor.*, tu.avatar as avatar, ti.rider_user_id as riderUserId, gs.shop_name as shopName, gs.shop_cover as
|
|
select tor.*, tu.avatar as avatar, ti.rider_user_id as riderUserId, gs.shop_name as shopName, gs.shop_cover as
|
|
|
- shopCover, gs.detailed_address as detailedAddress,tu1.phone as riderPhone,gs.phone as shopPhone,ti.indent_state as indentState,
|
|
|
|
|
|
|
+ shopCover, gs.detailed_address as detailedAddress,tu1.phone as riderPhone,gs.phone as shopPhone,ti.indent_state
|
|
|
|
|
+ as indentState,
|
|
|
(select count(*) from tb_order where order_type = 1 and status in (6, 3) and pay_time < tor.pay_time
|
|
(select count(*) from tb_order where order_type = 1 and status in (6, 3) and pay_time < tor.pay_time
|
|
|
and shop_id = tor.shop_id) as countOrder
|
|
and shop_id = tor.shop_id) as countOrder
|
|
|
from tb_order tor
|
|
from tb_order tor
|
|
@@ -459,7 +461,13 @@
|
|
|
<if test="status==null">
|
|
<if test="status==null">
|
|
|
and tor.status in (0, 7, 6, 3, 4, 5, 8)
|
|
and tor.status in (0, 7, 6, 3, 4, 5, 8)
|
|
|
</if>
|
|
</if>
|
|
|
- order by tor.pay_time desc, tor.create_time desc
|
|
|
|
|
|
|
+ <if test="!(status != null and status==5)">
|
|
|
|
|
+ order by tor.pay_time desc, tor.create_time desc
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="status != null and status==5">
|
|
|
|
|
+ order by tor.create_time desc
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -586,7 +594,9 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectMakeOrdersList" resultType="com.sqx.modules.order.entity.TbOrder">
|
|
<select id="selectMakeOrdersList" resultType="com.sqx.modules.order.entity.TbOrder">
|
|
|
- select * from tb_order where status=6 and shop_receiving_time <![CDATA[ <= #{minusMinutes}]]></select>
|
|
|
|
|
|
|
+ select * from tb_order where status=6 and shop_receiving_time <![CDATA[ <= #{minusMinutes}
|
|
|
|
|
+
|
|
|
|
|
+ ]]></select>
|
|
|
|
|
|
|
|
<select id="selectCurrentOrderSequenceByShopId" resultType="java.lang.Long">
|
|
<select id="selectCurrentOrderSequenceByShopId" resultType="java.lang.Long">
|
|
|
select
|
|
select
|
|
@@ -602,19 +612,19 @@
|
|
|
|
|
|
|
|
<select id="countByShopIdAndActivityIdAndUserIdAndCurDate" resultType="java.lang.Integer">
|
|
<select id="countByShopIdAndActivityIdAndUserIdAndCurDate" resultType="java.lang.Integer">
|
|
|
select
|
|
select
|
|
|
- count(1)
|
|
|
|
|
|
|
+ count(1)
|
|
|
from
|
|
from
|
|
|
- tb_order o
|
|
|
|
|
- left join activity_part_record apr on apr.order_id = o.order_id
|
|
|
|
|
|
|
+ tb_order o
|
|
|
|
|
+ left join activity_part_record apr on apr.order_id = o.order_id
|
|
|
where
|
|
where
|
|
|
- o.shop_id = #{shopId}
|
|
|
|
|
- and o.user_id = #{userId}
|
|
|
|
|
- and date(o.create_time) = curdate()
|
|
|
|
|
- and apr.activity_id = #{activityId}
|
|
|
|
|
- and o.is_pay = 1
|
|
|
|
|
- <if test="orderId != null">
|
|
|
|
|
- and o.order_id != #{orderId}
|
|
|
|
|
- </if>
|
|
|
|
|
|
|
+ o.shop_id = #{shopId}
|
|
|
|
|
+ and o.user_id = #{userId}
|
|
|
|
|
+ and date(o.create_time) = curdate()
|
|
|
|
|
+ and apr.activity_id = #{activityId}
|
|
|
|
|
+ and o.is_pay = 1
|
|
|
|
|
+ <if test="orderId != null">
|
|
|
|
|
+ and o.order_id != #{orderId}
|
|
|
|
|
+ </if>
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectCurWaitReceivingOrderIds" resultType="java.lang.Long">
|
|
<select id="selectCurWaitReceivingOrderIds" resultType="java.lang.Long">
|
|
@@ -752,4 +762,4 @@
|
|
|
AND pd.state in (0, 2)
|
|
AND pd.state in (0, 2)
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
-</mapper>
|
|
|
|
|
|
|
+</mapper>
|