|
|
@@ -1244,24 +1244,32 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="orderCount" resultType="com.yami.shop.bean.vo.OrderCountVo">
|
|
|
+ select count(1) as orderTotal,
|
|
|
+ sum(orderMoney) as orderMoneyTotal,
|
|
|
+ sum(shopMoney) as shopMoneyTotal,
|
|
|
+ sum(carriageMoney) as carriageMoneyTotal,
|
|
|
+ sum(orderMoney) as payMoneyTotal,
|
|
|
+ ROUND(sum(pointsMoney) / 100,2) as pointsMoneyTotal,
|
|
|
+ sum(money) as moneyTotal
|
|
|
+ from (
|
|
|
select
|
|
|
- count(a.order_number) as orderTotal,
|
|
|
- sum(a.total) as orderMoneyTotal,
|
|
|
- sum(c.product_total_amount) as shopMoneyTotal,
|
|
|
- sum(IFNUll(a.freight_amount,0)) as carriageMoneyTotal,
|
|
|
- sum(a.total) as payMoneyTotal,
|
|
|
- ROUND(sum(IFNUll(a.offset_points,0)) / 100,2) as pointsMoneyTotal,
|
|
|
- sum(IFNUll(a.actual_total,0)) as moneyTotal
|
|
|
+ a.order_number,
|
|
|
+ a.total as orderMoney,
|
|
|
+ sum(c.product_total_amount) as shopMoney,
|
|
|
+ IFNUll(a.freight_amount,0) as carriageMoney,
|
|
|
+ IFNUll(a.offset_points,0) as pointsMoney,
|
|
|
+ IFNUll(a.actual_total,0) as money
|
|
|
FROM tz_order a
|
|
|
LEFT JOIN tz_user_addr_order b on a.addr_order_id=b.addr_order_id
|
|
|
LEFT JOIN tz_order_item c on a.order_number =c.order_number
|
|
|
- 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>
|
|
|
+ and a.delete_status =0
|
|
|
<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>
|
|
|
@@ -1314,5 +1322,7 @@
|
|
|
</if>
|
|
|
</if>
|
|
|
</where>
|
|
|
+ group by a.order_number
|
|
|
+ ) m
|
|
|
</select>
|
|
|
</mapper>
|