|
|
|
@ -93,9 +93,18 @@
|
|
|
|
|
|
|
|
|
|
<select id="getSumCustomersAnalysis" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
|
<![CDATA[
|
|
|
|
|
SELECT sum(s.customers) customers,sum(s.orders) orders,sum(s.new_customers) new_customers,
|
|
|
|
|
select date_format(calendar.datelist,'%d/%m/%Y') AS trade_date,
|
|
|
|
|
IFNULL(customerStatic.customers,0) AS customers,
|
|
|
|
|
IFNULL(customerStatic.orders,0) AS orders,
|
|
|
|
|
IFNULL(customerStatic.new_customers,0) AS new_customers,
|
|
|
|
|
IFNULL(customerStatic.old_customers,0) AS old_customers,
|
|
|
|
|
IFNULL(customerStatic.total,0) AS total,
|
|
|
|
|
IFNULL(customerStatic.single_amount,0) AS single_amount
|
|
|
|
|
FROM calendar
|
|
|
|
|
LEFT JOIN
|
|
|
|
|
(SELECT sum(s.customers) customers,sum(s.orders) orders,sum(s.new_customers) new_customers,
|
|
|
|
|
sum(s.old_customers) old_customers,sum(s.total) total, sum(s.total)/sum(s.customers) single_amount,
|
|
|
|
|
date_format(s.date,'%d/%m/%Y') trade_date
|
|
|
|
|
date_format(s.date,'%Y-%m-%d') trade_date
|
|
|
|
|
FROM statistics_customer_order s
|
|
|
|
|
LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
|
|
|
|
|
]]>
|
|
|
|
@ -122,7 +131,14 @@
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
GROUP BY s.date ORDER BY date DESC
|
|
|
|
|
GROUP BY s.date
|
|
|
|
|
) AS customerStatic
|
|
|
|
|
ON calendar.datelist = customerStatic.trade_date
|
|
|
|
|
<where>
|
|
|
|
|
<if test="begin!=null">and calendar.datelist >= #{begin}</if>
|
|
|
|
|
<if test="end!=null">and calendar.datelist < #{end}</if>
|
|
|
|
|
</where>
|
|
|
|
|
ORDER BY calendar.datelist DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getSumChannelAnalysis" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
|