Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj
/
rpc-dj-pe-analysis
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 222c9b86
authored
Jan 05, 2026
by
春觉晓
1
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改门店存量分析接口,优化流失门店sql
1 parent
5fa6033d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
36 deletions
rpc-dj-pe-analysis/src/main/resources/META-INF/orm/BusinessIntelligenceMapper.xml
rpc-dj-pe-analysis/src/main/resources/META-INF/orm/BusinessIntelligenceMapper.xml
View file @
222c9b8
...
@@ -642,53 +642,47 @@
...
@@ -642,53 +642,47 @@
</select>
</select>
<select
id=
"countLostMerchantByBizType"
resultType=
"java.lang.Integer"
>
<select
id=
"countLostMerchantByBizType"
resultType=
"java.lang.Integer"
>
SELECT
SELECT COUNT(1) AS lost_merchant_count
count(distinct merchant_id) AS lost_merchant_count
FROM
FROM dj_smartcarlife.dj_car_life_service_merchant_bi t1
(SELECT merchant_id
WHERE
FROM dj_smartcarlife.dj_car_life_service_merchant_bi
t1.deleted_flag = 'N'
WHERE deleted_flag = 'N'
<choose>
<when
test=
"bizType == 2"
>
and has_ext_warranty = 1
</when>
<when
test=
"bizType == 3"
>
and has_benefits = 1
</when>
<when
test=
"bizType == 4"
>
and has_light_mod = 1
</when>
</choose>
<![CDATA[
AND stat_date >
= #{statDate} - INTERVAL 59 DAY
AND stat_date
<
= #{statDate}
]]>
<if
test=
"merchantIds != null and merchantIds.size > 0"
>
<if
test=
"merchantIds != null and merchantIds.size > 0"
>
and t1.merchant_id in
AND merchant_id IN
<foreach
item=
"item"
index=
"index"
collection=
"merchantIds"
separator=
","
open=
"("
close=
")"
>
<foreach
item=
"item"
index=
"index"
collection=
"merchantIds"
separator=
","
open=
"("
close=
")"
>
#{item}
#{item}
</foreach>
</foreach>
</if>
</if>
<if
test=
"excludeIds != null and excludeIds.size > 0"
>
<if
test=
"excludeIds != null and excludeIds.size > 0"
>
and
t1.
merchant_id not in
and merchant_id not in
<foreach
item=
"item"
index=
"index"
collection=
"excludeIds"
separator=
","
open=
"("
close=
")"
>
<foreach
item=
"item"
index=
"index"
collection=
"excludeIds"
separator=
","
open=
"("
close=
")"
>
#{item}
#{item}
</foreach>
</foreach>
</if>
</if>
AND EXISTS (
GROUP BY merchant_id) a
SELECT 1
WHERE NOT EXISTS (
FROM dj_smartcarlife.dj_car_life_service_merchant_bi t2
WHERE
t2.merchant_id = t1.merchant_id
<![CDATA[
AND t2.stat_date >
= #{statDate} - INTERVAL 59 DAY -- 传入的统计日期
AND t2.stat_date
<
= #{statDate}
]]>
<choose>
<when
test=
"bizType == 2"
>
and t2.has_ext_warranty = 1
</when>
<when
test=
"bizType == 3"
>
and t2.has_benefits = 1
</when>
<when
test=
"bizType == 4"
>
and t2.has_light_mod = 1
</when>
</choose>
AND t2.deleted_flag = 'N'
)
AND NOT EXISTS (
SELECT 1
SELECT 1
FROM dj_smartcarlife.dj_car_life_service_merchant_bi t3
FROM dj_smartcarlife.dj_car_life_service_merchant_bi t3
WHERE
WHERE
t3.merchant_id = a.merchant_id
t3.merchant_id = t1.merchant_id
AND t3.deleted_flag = 'N'
<![CDATA[
<![CDATA[
AND t3.stat_date >
= #{statDate} - INTERVAL 29 DAY
AND t3.stat_date >
= #{statDate} - INTERVAL 29 DAY
AND t3.stat_date
<
= #{statDate}
AND t3.stat_date
<
= #{statDate}
]]>
]]>
<choose>
<choose>
<when
test=
"bizType == 2"
>
<when
test=
"bizType == 2"
>
...
@@ -701,8 +695,7 @@
...
@@ -701,8 +695,7 @@
and t3.has_light_mod = 1
and t3.has_light_mod = 1
</when>
</when>
</choose>
</choose>
AND t3.deleted_flag = 'N'
)
);
</select>
</select>
<select
id=
"countHistoryMerchant"
resultType=
"java.lang.Integer"
>
<select
id=
"countHistoryMerchant"
resultType=
"java.lang.Integer"
>
...
...
@wangxw1
王欣伟
@wangxw1
commented
Jan 05, 2026
Master
Auto Review Result: 关注的文件没有修改
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment