|
|
@@ -889,22 +889,18 @@
|
|
|
SELECT count(*)
|
|
|
from t_order_new a
|
|
|
left join t_order_mid b on a.order_no =b.order_no
|
|
|
- left join t_order_task e on a.order_no =e.order_no and e.split_status in (0,2)
|
|
|
- left join user_mid b2 on a.buyer_id=b2.uid
|
|
|
- left join admin a2 on a.salesman_id=a2.id
|
|
|
- left join department a3 on a2.department_id=a3.id
|
|
|
- left join district_glossory a4 on a3.province=a4.id
|
|
|
left join t_order_task c on a.order_no =c.order_no and c.main =1
|
|
|
- left join business_project d on c.commodity_id =d.id left join business_category d2 on d.cid =d2.id
|
|
|
- left join admin e2 on e.task_receiver=e2.id
|
|
|
- <if test="refundType !=null or changeType !=null">
|
|
|
- left join (SELECT order_no ,count(*)counts,sum(if(`type`=0,1,0))tdtk,sum(if(`type`=4,1,0))cb
|
|
|
- from new_order_change group by order_no ) t1 on a.order_no =t1.order_no
|
|
|
- </if>
|
|
|
+ left join user_mid b2 on a.buyer_id=b2.uid
|
|
|
+ left join t_order_task e on a.order_no =e.order_no and e.split_status in (0,2)
|
|
|
+ left join t_task_mid e3 on e.id=e3.tid
|
|
|
+ left join t_task_member ttm on e.id =ttm.tid
|
|
|
<if test="dunType !=null">
|
|
|
left join new_order_dun nod on e.id=nod.tid
|
|
|
</if>
|
|
|
- where a.process_status >1 and a.delete_sign in (0,2)
|
|
|
+ <if test="province !=null">
|
|
|
+ left join admin p1 on a.salesman_id=p1.id left join department p2 on p1.department_id=p2.id
|
|
|
+ </if>
|
|
|
+ where a.process_status >6 and a.delete_sign in (0,2)
|
|
|
<include refid="selectStatisticsOrderProjectSql"/>
|
|
|
</select>
|
|
|
</mapper>
|