kpi 开户数统计

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

@ -13,7 +13,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<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>
<dependencies>

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

Loading…
Cancel
Save