feat(newhosts): 新增最近7天直播场次筛选条件

在主播分页查询中支持按「有无直播记录」过滤。
This commit is contained in:
2025-12-19 15:49:44 +08:00
parent d5c51a80c6
commit fe48dfe3a1
2 changed files with 26 additions and 0 deletions

View File

@@ -148,4 +148,7 @@ public class NewHostsPageReqVO extends PageParam {
@Schema(description = "国家英文名", example = "United States") @Schema(description = "国家英文名", example = "United States")
private String countryEng; private String countryEng;
@Schema(description = "最近 7天 是否存在直播场次", example = "0")
private Integer hasLiveRecoder;
} }

View File

@@ -107,6 +107,29 @@
<if test="req.invitationType != null"> <if test="req.invitationType != null">
and ns.Invitation_type =#{req.invitationType,jdbcType=INTEGER} and ns.Invitation_type =#{req.invitationType,jdbcType=INTEGER}
</if> </if>
<!-- 判断主播是否有直播场次 -->
<if test="req.hasLiveRecoder != null">
<choose>
<when test="req.hasLiveRecoder == 0">
AND EXISTS (
SELECT 1
FROM server_live_host_detail ld
WHERE ld.deleted = 0
AND ld.tenant_id = ns.tenant_id
AND ld.hosts_id = ns.hosts_id
)
</when>
<when test="req.hasLiveRecoder == 1">
AND NOT EXISTS (
SELECT 1
FROM server_live_host_detail ld
WHERE ld.deleted = 0
AND ld.tenant_id = ns.tenant_id
AND ld.hosts_id = ns.hosts_id
)
</when>
</choose>
</if>
<!-- 排序类型 --> <!-- 排序类型 -->
group by group by
ns.hosts_id ns.hosts_id