|
|
@@ -759,12 +759,17 @@
|
|
|
left join t_order_public_release_count toc on a.order_no =toc.order_no
|
|
|
left join (select a.order_no,a.expenseCount,b.peopleCount,c.notExamine, c.rejectCount,a.days,a.amount
|
|
|
from (select a.order_no,count(a.id)expenseCount,sum(a.amount) amount,sum(ROUND(a.duration/7.5) )days
|
|
|
- from expense_account a where a.target_type = 1 and a.status=2 group by order_no )a
|
|
|
+ from expense_account a where a.target_type = 1 and a.status=2
|
|
|
+ <if test="startTime !=null and endTime !=null">
|
|
|
+ and a.create_time BETWEEN #{startTime} and #{endTime}
|
|
|
+ </if>
|
|
|
+ group by order_no )a
|
|
|
left join (select order_no,count(aid)peopleCount from (select a.order_no,aid from expense_account a
|
|
|
where a.target_type = 1 and a.status=2 group by order_no,aid )a group by order_no)b on a.order_no=b.order_no
|
|
|
left join (select a.order_no,sum(notExamine)notExamine,sum(rejectCount)rejectCount
|
|
|
from (select a.order_no,status ,IF(status=1,1,0)notExamine,IF(status=3,1,0)rejectCount
|
|
|
- from expense_account a where a.target_type=1 )a group by order_no)c on a.order_no=c.order_no )c on a.order_no =c.order_no
|
|
|
+ from expense_account a where a.target_type=1
|
|
|
+ )a group by order_no)c on a.order_no=c.order_no )c on a.order_no =c.order_no
|
|
|
left join ( select a.order_no ,sum(c.payment_amount) paymentAmount
|
|
|
from t_order_new a left join t_order_task b on a.order_no =b.order_no left join t_order_payment c on b.id =c.tid
|
|
|
where c.status =3 group by order_no )d on a.order_no=d.order_no
|