|
|
@@ -304,12 +304,13 @@
|
|
|
<select id="selectDsPlatBrokenLineMoney" resultType="com.cyksj.model.views.BrokenLineObjView">
|
|
|
select min(curdate) as firstDate,
|
|
|
max(curdate) as lastDate
|
|
|
- from (select cast(sum(od.money)/100 as decimal(10,2)) as curdateMoney,
|
|
|
- date_format(od.created_time,'%Y-%m-%d') curdate from (select order_id from distribute_waiting_send_points where
|
|
|
- shared_id = #{sharedId}) dp inner join order_don od
|
|
|
- on od.id = dp.order_id
|
|
|
- where od.status not in ('noPayment','close','refund')
|
|
|
- group by od.goods_id,date_format(od.created_time,'%Y-%m-%d'))s
|
|
|
+ from (select cast(sum(if(od.id is null,vod.money,od.money))/100 as decimal(10,2)) as curdateMoney,
|
|
|
+ date_format(ifnull(od.created_time,vod.created_time),'%Y-%m-%d') curdate from (select order_id,is_vip from
|
|
|
+ distribute_waiting_send_points where
|
|
|
+ shared_id = #{sharedId}) dp left join order_don od on od.id = dp.order_id and dp.is_vip = false
|
|
|
+ left join vip_order_don vod on vod.id = dp.order_id and dp.is_vip = true
|
|
|
+ where ifnull(od.status,vod.status) not in ('noPayment','close','refund')
|
|
|
+ group by ifnull(od.goods_id,vod.goods_id),date_format(ifnull(od.created_time,vod.created_time),'%Y-%m-%d'))s
|
|
|
where 1 = 1
|
|
|
<if test="first != null">
|
|
|
and curdate >= #{first}
|