<!-- 统计供应商会员数量 -->
<select parameterClass="" resultClass="">
SELECT
count(if(w.seller_type,true,null)seller_type) as total_supplier,<!-- 统计供应商总的会员人数 -->
count(if(w.seller_type=1,true,null)) as personage,<!-- 个人 -->
count(if(w.seller_type=2,true,null)) as individual_business,<!-- 个体工商户 -->
count(if(w.seller_type=3),true,null) as sellers<!-- 卖家数量 -->
FROM (
(SELECT
t.deal_time AS deal_time,
ifnull((select platform_name from tab_platform_apply where mall_id = c.n7),'全国') AS plat_name,
t.client_name AS client_name,
t.other_name AS other_name,
a.goods_name AS goods_name,
AS name,
a.num14 AS num14,
a.att61 AS att61,
a.contract_type AS contract_type,
AS deal_price,
AS deal_status,
AS subs_status,
'0' AS data_source,
date_format(t.pay_date, '%Y-%m-%d %H:%i:%s') AS pay_date_b,
(SELECT date_format(pay_date, '%Y-%m-%d %H:%i:%s') FROM tab_goods_deal WHERE discussid = AND buyorsell = 2) AS pay_date_s,
date_format(d.date2, '%Y-%m-%d %H:%i:%s') AS date2,
a.cat_id AS cat_id,
a.goods_id AS goods_id,
ifnull(oex.organic_type, 0) AS organic_type,
a.att72 AS payment_type,
c.num4 AS seller_type
FROM
tab_goods_deal t
LEFT JOIN tab_goods_discuss_detail a ON =
LEFT JOIN tab_customer_group c ON c.cust_no = t.other_id
LEFT JOIN tab_customer_group cb ON cb.cust_no = t.client_id
LEFT JOIN tab_subs_goods_detail d ON = 1 AND d.subs_id =
LEFT JOIN tab_gxs_orders_extend oex ON t.order_id = oex.order_id AND oex.auth_type = 0
WHERE
= 1
)
UNION ALL
(
SELECT
t.order_time AS deal_time,
t.plat_name AS plat_name,
t.buy_name AS client_name,
t.sell_name AS other_name,
'外部数据' AS goods_name,
t.goods_name AS name,
'0' AS num14,
'0' AS att61,
'10' AS contract_type,
AS deal_price,
'99' AS deal_status,
'99' AS subs_status,
'1' AS data_source,
date_format(t.order_time, '%Y-%m-%d %H:%i:%s') AS pay_date_b,
date_format(t.order_time, '%Y-%m-%d %H:%i:%s') AS pay_date_s,
date_format(t.order_time, '%Y-%m-%d %H:%i:%s') AS date2,
'-1' AS cat_id,
'-1' AS goods_id,
'0' AS organic_type,
'' AS payment_type,
'0' AS seller_type
FROM
tab_gxs_other_order t
WHERE = 1
)
) w
<include ref />
</select>