Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yichengstreet-be
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yichengstreet
yichengstreet-be
Commits
91dcf54d
Commit
91dcf54d
authored
May 07, 2026
by
lixuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 需求
parent
e6ce768b
Pipeline
#147247
failed with stages
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
34 deletions
+34
-34
HouseResourceMapper.xml
...m/src/main/resources/mapper/house/HouseResourceMapper.xml
+34
-34
No files found.
ruoyi-system/src/main/resources/mapper/house/HouseResourceMapper.xml
View file @
91dcf54d
...
@@ -134,10 +134,10 @@
...
@@ -134,10 +134,10 @@
t5.year
t5.year
FROM
FROM
house_resource t1
house_resource t1
INNER
JOIN grid_region t2 ON t2.wg_code = t1.four AND t1.delete_flag = 0
LEFT
JOIN grid_region t2 ON t2.wg_code = t1.four AND t1.delete_flag = 0
INNER
JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id AND t3.delete_flag = 0
LEFT
JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id AND t3.delete_flag = 0
INNER
JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id AND t4.delete_flag = 0
LEFT
JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id AND t4.delete_flag = 0
INNER
JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id AND t5.delete_flag = 0
LEFT
JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id AND t5.delete_flag = 0
<where>
<where>
t1.delete_flag = 0
t1.delete_flag = 0
<if
test=
"query.wgType != null"
>
<if
test=
"query.wgType != null"
>
...
@@ -327,10 +327,10 @@
...
@@ -327,10 +327,10 @@
t4.id AS businessEntityInfoId
t4.id AS businessEntityInfoId
FROM
FROM
house_resource t1
house_resource t1
INNER
JOIN grid_region t2 ON t2.wg_code = t1.four AND t1.delete_flag = 0
LEFT
JOIN grid_region t2 ON t2.wg_code = t1.four AND t1.delete_flag = 0
INNER
JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id AND t3.delete_flag = 0
LEFT
JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id AND t3.delete_flag = 0
INNER
JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id AND t4.delete_flag = 0
LEFT
JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id AND t4.delete_flag = 0
INNER
JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id AND t5.delete_flag = 0
LEFT
JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id AND t5.delete_flag = 0
<where>
<where>
t1.delete_flag = 0
t1.delete_flag = 0
<if
test=
"query.wgType != null"
>
<if
test=
"query.wgType != null"
>
...
@@ -514,10 +514,10 @@
...
@@ -514,10 +514,10 @@
t5.year
t5.year
FROM
FROM
house_resource t1
house_resource t1
INNER
JOIN grid_region t2 ON t2.wg_code = t1.four AND t1.delete_flag = 0
LEFT
JOIN grid_region t2 ON t2.wg_code = t1.four AND t1.delete_flag = 0
INNER
JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id AND t3.delete_flag = 0
LEFT
JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id AND t3.delete_flag = 0
INNER
JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id AND t4.delete_flag = 0
LEFT
JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id AND t4.delete_flag = 0
INNER
JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id AND t5.delete_flag = 0
LEFT
JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id AND t5.delete_flag = 0
<where>
<where>
t1.delete_flag = 0
t1.delete_flag = 0
<if
test=
"query.wgType != null"
>
<if
test=
"query.wgType != null"
>
...
@@ -730,10 +730,10 @@
...
@@ -730,10 +730,10 @@
t1.business_license_url
t1.business_license_url
FROM
FROM
house_resource t1
house_resource t1
INNER
JOIN grid_region t2 ON t2.wg_code = t1.four AND t1.delete_flag = 0
LEFT
JOIN grid_region t2 ON t2.wg_code = t1.four AND t1.delete_flag = 0
INNER
JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id AND t3.delete_flag = 0
LEFT
JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id AND t3.delete_flag = 0
INNER
JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id AND t4.delete_flag = 0
LEFT
JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id AND t4.delete_flag = 0
INNER
JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id AND t5.delete_flag = 0
LEFT
JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id AND t5.delete_flag = 0
<where>
<where>
t1.delete_flag = 0
t1.delete_flag = 0
<if
test=
"query.wgType != null"
>
<if
test=
"query.wgType != null"
>
...
@@ -887,10 +887,10 @@
...
@@ -887,10 +887,10 @@
SUM(t5.year_tax) AS taxCount
SUM(t5.year_tax) AS taxCount
FROM
FROM
house_resource t1
house_resource t1
INNER
JOIN grid_region t2 ON t2.wg_code = t1.four AND t1.delete_flag = 0
LEFT
JOIN grid_region t2 ON t2.wg_code = t1.four AND t1.delete_flag = 0
INNER
JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id AND t3.delete_flag = 0
LEFT
JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id AND t3.delete_flag = 0
INNER
JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id AND t4.delete_flag = 0
LEFT
JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id AND t4.delete_flag = 0
INNER
JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id AND t5.delete_flag = 0
LEFT
JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id AND t5.delete_flag = 0
WHERE t1.delete_flag = 0
WHERE t1.delete_flag = 0
GROUP BY t1.id, t4.id
GROUP BY t1.id, t4.id
</select>
</select>
...
@@ -927,10 +927,10 @@
...
@@ -927,10 +927,10 @@
t4.principal
t4.principal
FROM
FROM
house_resource t1
house_resource t1
INNER
JOIN grid_region t2 ON t2.wg_code = t1.four AND t1.delete_flag = 0
LEFT
JOIN grid_region t2 ON t2.wg_code = t1.four AND t1.delete_flag = 0
INNER
JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id AND t3.delete_flag = 0
LEFT
JOIN house_resource_business_entity_info_mapping t3 ON t3.house_resource_id = t1.id AND t3.delete_flag = 0
INNER
JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id AND t4.delete_flag = 0
LEFT
JOIN business_entity_info t4 ON t3.business_entity_info_id = t4.id AND t4.delete_flag = 0
INNER
JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id AND t5.delete_flag = 0
LEFT
JOIN business_entity_sell t5 ON t5.business_entity_info_id = t4.id AND t5.delete_flag = 0
WHERE t1.delete_flag = 0 AND t1.two = #{two} AND t4.NAME = #{name}
WHERE t1.delete_flag = 0 AND t1.two = #{two} AND t4.NAME = #{name}
</select>
</select>
<select
id=
"selectByIdList"
resultType=
"com.ruoyi.system.domain.house.vo.HouseResourcePage"
>
<select
id=
"selectByIdList"
resultType=
"com.ruoyi.system.domain.house.vo.HouseResourcePage"
>
...
@@ -951,7 +951,7 @@
...
@@ -951,7 +951,7 @@
dcr.operation_type AS operationType,
dcr.operation_type AS operationType,
dcr.subject_id AS subjectId
dcr.subject_id AS subjectId
FROM data_change_record dcr
FROM data_change_record dcr
INNER
JOIN house_resource hr ON hr.id = dcr.subject_id AND hr.delete_flag = 0
LEFT
JOIN house_resource hr ON hr.id = dcr.subject_id AND hr.delete_flag = 0
WHERE dcr.subject_type = 'HOUSE_RESOURCE'
WHERE dcr.subject_type = 'HOUSE_RESOURCE'
AND dcr.operation_type IN (1, 2)
AND dcr.operation_type IN (1, 2)
AND dcr.operation_time
<![CDATA[ >= ]]>
#{query.changeStartTime}
AND dcr.operation_time
<![CDATA[ >= ]]>
#{query.changeStartTime}
...
@@ -983,7 +983,7 @@
...
@@ -983,7 +983,7 @@
3 AS operationType,
3 AS operationType,
COUNT(DISTINCT dcr.subject_id) AS count
COUNT(DISTINCT dcr.subject_id) AS count
FROM data_change_record dcr
FROM data_change_record dcr
INNER
JOIN house_resource hr ON hr.id = dcr.subject_id
LEFT
JOIN house_resource hr ON hr.id = dcr.subject_id
WHERE dcr.subject_type = 'HOUSE_RESOURCE'
WHERE dcr.subject_type = 'HOUSE_RESOURCE'
AND dcr.operation_type = 3
AND dcr.operation_type = 3
AND dcr.operation_time
<![CDATA[ >= ]]>
#{query.changeStartTime}
AND dcr.operation_time
<![CDATA[ >= ]]>
#{query.changeStartTime}
...
@@ -1010,7 +1010,7 @@
...
@@ -1010,7 +1010,7 @@
说明:
说明:
* 这里的 type 取自关联房源 hr2.type(经营主体本身无 type 字段)。一个 entity 关联到多种 type
* 这里的 type 取自关联房源 hr2.type(经营主体本身无 type 字段)。一个 entity 关联到多种 type
的房源时,会在对应的多个桶里分别出现一次(DISTINCT 已对 (type, operation_type, subject_id) 去重)。
的房源时,会在对应的多个桶里分别出现一次(DISTINCT 已对 (type, operation_type, subject_id) 去重)。
*
INNER
JOIN 链路:bei → mapping → house_resource,且三者都要求 delete_flag = 0,与
*
LEFT
JOIN 链路:bei → mapping → house_resource,且三者都要求 delete_flag = 0,与
pageHouseResources 的 drilldown 口径一致,保证 dataCollection 返回的每个 id 在
pageHouseResources 的 drilldown 口径一致,保证 dataCollection 返回的每个 id 在
/api/house/page?businessEntityInfoIds=...&wgType=type 里都能查到对应行。
/api/house/page?businessEntityInfoIds=...&wgType=type 里都能查到对应行。
* 传 two/three/four/wgCodes 时,按网格进一步收紧 hr2。
* 传 two/three/four/wgCodes 时,按网格进一步收紧 hr2。
...
@@ -1022,9 +1022,9 @@
...
@@ -1022,9 +1022,9 @@
dcr.operation_type AS operationType,
dcr.operation_type AS operationType,
dcr.subject_id AS subjectId
dcr.subject_id AS subjectId
FROM data_change_record dcr
FROM data_change_record dcr
INNER
JOIN business_entity_info bei ON bei.id = dcr.subject_id AND bei.delete_flag = 0
LEFT
JOIN business_entity_info bei ON bei.id = dcr.subject_id AND bei.delete_flag = 0
INNER
JOIN house_resource_business_entity_info_mapping m ON m.business_entity_info_id = bei.id AND m.delete_flag = 0
LEFT
JOIN house_resource_business_entity_info_mapping m ON m.business_entity_info_id = bei.id AND m.delete_flag = 0
INNER
JOIN house_resource hr2 ON hr2.id = m.house_resource_id AND hr2.delete_flag = 0
LEFT
JOIN house_resource hr2 ON hr2.id = m.house_resource_id AND hr2.delete_flag = 0
WHERE dcr.subject_type = 'BUSINESS_ENTITY_INFO'
WHERE dcr.subject_type = 'BUSINESS_ENTITY_INFO'
AND dcr.operation_type IN (1, 2)
AND dcr.operation_type IN (1, 2)
AND dcr.operation_time
<![CDATA[ >= ]]>
#{query.changeStartTime}
AND dcr.operation_time
<![CDATA[ >= ]]>
#{query.changeStartTime}
...
@@ -1052,7 +1052,7 @@
...
@@ -1052,7 +1052,7 @@
<!--
<!--
时间窗内经营主体(BUSINESS_ENTITY_INFO)被删除的数量,按关联房源 hr2.type 分组。
时间窗内经营主体(BUSINESS_ENTITY_INFO)被删除的数量,按关联房源 hr2.type 分组。
与 insert/update 口径保持一致:
INNER
JOIN 链路 bei → mapping → house_resource 恒生效,
与 insert/update 口径保持一致:
LEFT
JOIN 链路 bei → mapping → house_resource 恒生效,
要求经营主体历史上至少关联过某个房源;但 mapping / hr2 **不**限 delete_flag,因为被删除
要求经营主体历史上至少关联过某个房源;但 mapping / hr2 **不**限 delete_flag,因为被删除
的 entity 其 mapping/house 可能也已逻辑删除。一个 entity 若关联过多种 type 的房源,会在
的 entity 其 mapping/house 可能也已逻辑删除。一个 entity 若关联过多种 type 的房源,会在
对应的多个 type 桶里分别被 COUNT DISTINCT 计入一次(聚合层面)。"从未挂过房源"的孤儿
对应的多个 type 桶里分别被 COUNT DISTINCT 计入一次(聚合层面)。"从未挂过房源"的孤儿
...
@@ -1065,9 +1065,9 @@
...
@@ -1065,9 +1065,9 @@
3 AS operationType,
3 AS operationType,
COUNT(DISTINCT dcr.subject_id) AS count
COUNT(DISTINCT dcr.subject_id) AS count
FROM data_change_record dcr
FROM data_change_record dcr
INNER
JOIN business_entity_info bei ON bei.id = dcr.subject_id
LEFT
JOIN business_entity_info bei ON bei.id = dcr.subject_id
INNER
JOIN house_resource_business_entity_info_mapping m ON m.business_entity_info_id = bei.id
LEFT
JOIN house_resource_business_entity_info_mapping m ON m.business_entity_info_id = bei.id
INNER
JOIN house_resource hr2 ON hr2.id = m.house_resource_id
LEFT
JOIN house_resource hr2 ON hr2.id = m.house_resource_id
WHERE dcr.subject_type = 'BUSINESS_ENTITY_INFO'
WHERE dcr.subject_type = 'BUSINESS_ENTITY_INFO'
AND dcr.operation_type = 3
AND dcr.operation_type = 3
AND dcr.operation_time
<![CDATA[ >= ]]>
#{query.changeStartTime}
AND dcr.operation_time
<![CDATA[ >= ]]>
#{query.changeStartTime}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment