kpi 开户数统计

master
james.zhao 5 years ago
parent 45a75e8477
commit e1f84ffc36

@ -13,7 +13,7 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.1.2</jib-maven-plugin.version> <jib-maven-plugin.version>1.1.2</jib-maven-plugin.version>
<docker-image.version>1.0.43</docker-image.version> <docker-image.version>1.0.44</docker-image.version>
</properties> </properties>
<dependencies> <dependencies>

@ -553,43 +553,89 @@
fbc.bd_name, fbc.bd_name,
fbc.bd_group, fbc.bd_group,
fbc.bd_type, fbc.bd_type,
count( * ) clients_month sum( a.proportion ) clients_month
FROM FROM
sys_clients sc sys_client_bd a
INNER JOIN sys_client_bd d ON sc.client_id = d.client_id INNER JOIN (
INNER JOIN financial_bd_config c ON d.bd_id = c.manager_id SELECT
INNER JOIN financial_bd_config fbc ON fbc.manager_id = c.bd_group bd_id,
max( create_time ) create_time
FROM
sys_client_bd
WHERE WHERE
sc.org_id = 1 client_id IN (
AND sc.create_time &gt;= #{start_date_month} SELECT
AND d.is_valid = 1 client_id
AND c.bd_group IS NOT NULL FROM
AND d.start_date &lt;= now( ) AND d.is_valid = 1 AND ( d.end_date IS NULL OR d.end_date &gt; now( ) sys_clients c
WHERE
c.approve_time &gt;= #{start_date_month}
AND c.approve_time &lt;= #{end_date}
AND c.is_valid = 1
AND c.approve_result = 1
AND c.org_id = 1
)
AND start_date &lt;= #{end_date} AND is_valid = 1 AND ( end_date &gt; #{start_date_month}
OR end_date IS NULL
) )
GROUP BY GROUP BY
fbc.bd_type bd_id,
client_id
) b ON a.bd_id = b.bd_id
AND a.create_time = b.create_time
INNER JOIN financial_bd_config c ON a.bd_id = c.manager_id
INNER JOIN financial_bd_config fbc ON fbc.manager_id = c.bd_group
WHERE
a.is_valid = 1
GROUP BY
fbc.bd_group
ORDER BY
clients_month DESC
) t1 ) t1
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
count( * ) clients_yesterday, fbc.bd_name,
fbc.bd_group fbc.bd_group,
fbc.bd_type,
sum( a.proportion ) clients_yesterday
FROM FROM
sys_clients sc sys_client_bd a
INNER JOIN sys_client_bd d ON sc.client_id = d.client_id INNER JOIN (
INNER JOIN financial_bd_config c ON d.bd_id = c.manager_id SELECT
INNER JOIN financial_bd_config fbc ON fbc.manager_id = c.bd_group bd_id,
max( create_time ) create_time
FROM
sys_client_bd
WHERE
client_id IN (
SELECT
client_id
FROM
sys_clients c
WHERE WHERE
sc.org_id = 1 c.approve_time &gt;= #{start_date}
AND sc.create_time &gt;= #{start_date} AND c.approve_time &lt; #{end_date}
AND sc.create_time &lt; #{end_date} AND c.is_valid = 1
AND d.is_valid = 1 AND c.approve_result = 1
AND d.start_date &lt;= now( ) AND d.is_valid = 1 AND ( d.end_date IS NULL OR d.end_date &gt; now( ) AND c.org_id = 1
)
AND start_date &lt;= #{end_date} AND is_valid = 1 AND ( end_date &gt; #{start_date}
OR end_date IS NULL
) )
GROUP BY GROUP BY
fbc.bd_type bd_id,
) t2 ON t1.bd_group = t2.bd_group client_id
) b ON a.bd_id = b.bd_id
AND a.create_time = b.create_time
INNER JOIN financial_bd_config c ON a.bd_id = c.manager_id
INNER JOIN financial_bd_config fbc ON fbc.manager_id = c.bd_group
WHERE WHERE
t1.bd_type IN ( 1, 2, 6, 7 ) a.is_valid = 1
GROUP BY
fbc.bd_group
ORDER BY
clients_yesterday DESC
) t2 ON t1.bd_group = t2.bd_group
</select> </select>
<select id="clientPayTypeInfoByClientIdRange" resultType="com.alibaba.fastjson.JSONObject"> <select id="clientPayTypeInfoByClientIdRange" resultType="com.alibaba.fastjson.JSONObject">

Loading…
Cancel
Save