| | |
| | | IFNULL(sum(order_lack_num),0) as order_lack_num, |
| | | IFNULL(sum(order_num)-sum(order_lack_num),0) as real_sale_num |
| | | from ( |
| | | select t2.payment_date,t2.id,t2.order_no,t2.create_by,ci.partner_id,p.name as partner_name,r2.* from ( |
| | | select t2.payment_date,t2.id,t2.order_no,t2.create_by,t2.partner_id,p.name as partner_name,r2.* from ( |
| | | SELECT t.*, |
| | | CASE |
| | | WHEN t.payment_time > DATE(t.payment_time) + INTERVAL 17 HOUR THEN DATE(t.payment_time) + INTERVAL 1 DAY |
| | |
| | | )t2 |
| | | left join ( <include refid="baseSqlWithDate"></include> ) r2 |
| | | on t2.id = r2.order_id |
| | | left join t_customer_info ci |
| | | on t2.create_by=ci.user_id |
| | | left join t_partner_info p |
| | | on ci.partner_id=p.id |
| | | on t2.partner_id=p.id |
| | | )t3 |
| | | where t3.partner_id is not null |
| | | <if test="dto.paymentDateStart != null"> |