Commit bd32f53f authored by lixuan's avatar lixuan

feat: 需求

parent 223c2e6f
Pipeline #147216 failed with stages
in 0 seconds
......@@ -10,7 +10,8 @@ import java.util.List;
* 房源 & 经营主体变更汇总查询入参。
*
* <p>时间窗口基于 {@code data_change_record.operation_time} BETWEEN [start, end],
* 只统计 {@code operation_type} 为新增(1)/ 修改(2)的记录,删除(3)不纳入展示。</p>
* 统计 {@code operation_type} 为新增(1)/ 修改(2)/ 删除(3)的记录。新增 / 修改会同时
* 返回对应的 subject_id 列表用于前端 drilldown;删除只返回 count。</p>
*
* <p>{@link #two} / {@link #three} / {@link #four} 可选:</p>
* <ul>
......
......@@ -47,11 +47,19 @@ public class HouseResourcePageQuery extends PageDomain {
/**
* 直接按 house_resource.id 精确筛选。
*
* <p>典型用途:dataCollection 返回的 insert / update id 列表直接回传,用于
* drilldown 查看变更明细列表。传空 / null 不生效。</p>
* <p>典型用途:dataCollection 返回的 houseResourceInsert / houseResourceUpdate 桶中的
* id 列表直接回传,用于 drilldown 查看房源维度的变更明细。传空 / null 不生效。</p>
*/
private List<String> ids;
/**
* 按 business_entity_info.id 精确筛选。
*
* <p>典型用途:dataCollection 返回的 businessEntityInsertIds / businessEntityUpdateIds 回传,
* 用于 drilldown 查看经营主体维度的变更明细。传空 / null 不生效。</p>
*/
private List<String> businessEntityInfoIds;
private String name;
private boolean zlFlag;
......
......@@ -251,6 +251,12 @@
#{hid}
</foreach>
</if>
<if test="query.businessEntityInfoIds != null and query.businessEntityInfoIds.size() > 0">
and t4.id in
<foreach item="bid" collection="query.businessEntityInfoIds" open="(" separator="," close=")">
#{bid}
</foreach>
</if>
<if test="query.createTimeStart != null">
AND t1.create_time <![CDATA[ >= ]]> #{query.createTimeStart}
</if>
......@@ -438,6 +444,12 @@
#{hid}
</foreach>
</if>
<if test="query.businessEntityInfoIds != null and query.businessEntityInfoIds.size() > 0">
and t4.id in
<foreach item="bid" collection="query.businessEntityInfoIds" open="(" separator="," close=")">
#{bid}
</foreach>
</if>
<if test="query.createTimeStart != null">
AND t1.create_time <![CDATA[ >= ]]> #{query.createTimeStart}
</if>
......@@ -622,6 +634,12 @@
#{hid}
</foreach>
</if>
<if test="query.businessEntityInfoIds != null and query.businessEntityInfoIds.size() > 0">
and t4.id in
<foreach item="bid" collection="query.businessEntityInfoIds" open="(" separator="," close=")">
#{bid}
</foreach>
</if>
<if test="query.createTimeStart != null">
AND t1.create_time <![CDATA[ >= ]]> #{query.createTimeStart}
</if>
......@@ -829,6 +847,12 @@
#{hid}
</foreach>
</if>
<if test="query.businessEntityInfoIds != null and query.businessEntityInfoIds.size() > 0">
and t4.id in
<foreach item="bid" collection="query.businessEntityInfoIds" open="(" separator="," close=")">
#{bid}
</foreach>
</if>
<if test="query.createTimeStart != null">
AND t1.create_time <![CDATA[ >= ]]> #{query.createTimeStart}
</if>
......@@ -982,11 +1006,13 @@
<!--
时间窗内经营主体(BUSINESS_ENTITY_INFO)的新增 / 修改**详情**行:每行一个 (operation_type, subject_id)。
强制 bei.delete_flag = 0 以保证 id 回传后能被 drilldown 查到。
网格过滤(two / three / four / wgCodes)通过 EXISTS 子查询用 mapping + house_resource 实现:
"关联到至少一个匹配网格的、仍有效的房源" 才计入。这里 mapping 和 hr2 也限制 delete_flag = 0,
确保 id 回传 drilldown 时 JOIN 链路能走通。
口径对齐 pageHouseResources 的 drilldown(t1.delete_flag = 0 + t3.delete_flag = 0 + t4.delete_flag = 0):
* bei.delete_flag = 0:entity 本身必须存活;
* EXISTS 子查询**恒生效**:要求经营主体至少关联到一条"有效 mapping + 有效 house",
否则 drilldown 侧展示不出来,也就不计入 dataCollection。这样保证 dataCollection 返回的
id 列表都能在 /api/house/page?businessEntityInfoIds=... 里查到对应行。
* 传 two/three/four/wgCodes 时,EXISTS 内部按网格进一步收紧。
-->
<select id="selectBusinessEntityChangeDetails"
resultType="com.ruoyi.system.domain.house.vo.HouseResourceDataCollectionDetailRow">
......@@ -1000,7 +1026,6 @@
AND dcr.operation_type IN (1, 2)
AND dcr.operation_time <![CDATA[ >= ]]> #{query.changeStartTime}
AND dcr.operation_time <![CDATA[ <= ]]> #{query.changeEndTime}
<if test="(query.two != null and query.two != '') or (query.three != null and query.three != '') or (query.four != null and query.four != '') or (query.wgCodes != null and query.wgCodes.size() > 0)">
AND EXISTS (
SELECT 1
FROM house_resource_business_entity_info_mapping m
......@@ -1021,7 +1046,6 @@
<foreach collection="query.wgCodes" item="wg" open="(" separator="," close=")">#{wg}</foreach>
</if>
)
</if>
</select>
<!--
......@@ -1029,6 +1053,12 @@
不过滤 bei.delete_flag。网格过滤使用不限制 delete_flag 的 EXISTS——"历史上曾关联到
匹配网格的房源"即计入,覆盖"经营主体删除前房源或 mapping 已经被解除"的场景。
-->
<!--
时间窗内经营主体(BUSINESS_ENTITY_INFO)被删除的数量。
与 insert/update 口径保持一致:EXISTS 恒生效,要求经营主体历史上至少关联过某个房源(不限
delete_flag,因为被删的 entity 本身的 mapping/house 也可能已被删)。这样"从未挂过房源"的
孤儿 entity 不计入删除数,保证和看得见的业务实体口径统一。
-->
<select id="selectBusinessEntityDeleteCount"
resultType="com.ruoyi.system.domain.house.vo.HouseResourceDataCollectionRow">
SELECT
......@@ -1041,7 +1071,6 @@
AND dcr.operation_type = 3
AND dcr.operation_time <![CDATA[ >= ]]> #{query.changeStartTime}
AND dcr.operation_time <![CDATA[ <= ]]> #{query.changeEndTime}
<if test="(query.two != null and query.two != '') or (query.three != null and query.three != '') or (query.four != null and query.four != '') or (query.wgCodes != null and query.wgCodes.size() > 0)">
AND EXISTS (
SELECT 1
FROM house_resource_business_entity_info_mapping m
......@@ -1061,6 +1090,5 @@
<foreach collection="query.wgCodes" item="wg" open="(" separator="," close=")">#{wg}</foreach>
</if>
)
</if>
</select>
</mapper>
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