|
|
|
@ -1112,12 +1112,14 @@
|
|
|
|
|
sum(so.total) as total_amount,
|
|
|
|
|
sum(so.orders) as orders,
|
|
|
|
|
<if test="industry != null and industry=='1'.toString()">
|
|
|
|
|
count(Distinct IF((c.royalpayindustry =1 or c.royalpayindustry like '100%'), so.client_id,0)) as industry_trans_clients,
|
|
|
|
|
SUM(IF((c.royalpayindustry =1 or c.royalpayindustry like '100%'),so.total,0)) as industry_total_amount,
|
|
|
|
|
SUM(IF((c.royalpayindustry =1 or c.royalpayindustry like '100%'),so.orders,0)) as industry_orders,
|
|
|
|
|
convert(SUM(IF((c.royalpayindustry =1 or c.royalpayindustry like '100%'),so.total,0))/sum( so.total )*100,decimal(15,2)) as amount_pcent,
|
|
|
|
|
convert(SUM(IF((c.royalpayindustry =1 or c.royalpayindustry like '100%'),so.orders,0))/sum( so.orders )*100,decimal(15,2)) as order_pcent,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="industry == null or industry=='0'.toString()">
|
|
|
|
|
count(Distinct so.client_id) as industry_trans_clients,
|
|
|
|
|
sum(so.total) as industry_total_amount,
|
|
|
|
|
sum(so.orders) as industry_orders,
|
|
|
|
|
100 as amount_pcent,
|
|
|
|
@ -1125,6 +1127,7 @@
|
|
|
|
|
</if>
|
|
|
|
|
<if test="industry != null and industry!='0'.toString()">
|
|
|
|
|
<bind name="industry" value="industry+'%'"/>
|
|
|
|
|
count(Distinct IF(c.royalpayindustry like #{industry}, so.client_id,0)) as industry_trans_clients,
|
|
|
|
|
SUM(IF(c.royalpayindustry like #{industry},so.total,0)) as industry_total_amount,
|
|
|
|
|
SUM(IF(c.royalpayindustry like #{industry},so.orders,0)) as industry_orders,
|
|
|
|
|
convert(SUM(IF(c.royalpayindustry like #{industry},so.total,0))/sum( so.total )*100,decimal(15,2)) as amount_pcent,
|
|
|
|
@ -1148,6 +1151,7 @@
|
|
|
|
|
order by trans_date asc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getTopRpIndustryData" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
|
SELECT
|
|
|
|
|
sum(so.total) as total_amount,
|
|
|
|
|