Commit 91dcf54d authored by lixuan's avatar lixuan

feat: 需求

parent e6ce768b
Pipeline #147247 failed with stages
in 0 seconds
...@@ -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}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment