|
@@ -489,7 +489,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
String channel = getVideoContentListChannel(param.getSort(), user.getChannel());
|
|
String channel = getVideoContentListChannel(param.getSort(), user.getChannel());
|
|
|
String strategy = param.getSort() == 3 ? "recommend" : "normal";
|
|
String strategy = param.getSort() == 3 ? "recommend" : "normal";
|
|
|
// 标签筛选
|
|
// 标签筛选
|
|
|
- String tagFilterSql = getVideoContentListTagFilterSql(param.getTag(), user.getId(), type, user.getChannel());
|
|
|
|
|
|
|
+ String tagFilterSql = getVideoContentListTagFilterSql(param.getTags(), user.getId(), type, user.getChannel());
|
|
|
// 近期未使用
|
|
// 近期未使用
|
|
|
Long excludeVideoRecentNotUsed = getVideoExcludeRecentNotUsed(param.getRecentNotUsed());
|
|
Long excludeVideoRecentNotUsed = getVideoExcludeRecentNotUsed(param.getRecentNotUsed());
|
|
|
List<ContentPlatformVideo> videoList = planMapperExt.getVideoList(param, dt, datastatDt, type, channel, strategy,
|
|
List<ContentPlatformVideo> videoList = planMapperExt.getVideoList(param, dt, datastatDt, type, channel, strategy,
|
|
@@ -499,26 +499,38 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private String getVideoContentListTagFilterSql(String tag, Long accountId, String type, String channel) {
|
|
|
|
|
- if (Objects.isNull(tag)) {
|
|
|
|
|
|
|
+ private String getVideoContentListTagFilterSql(List<String> tags, Long accountId, String type, String channel) {
|
|
|
|
|
+ if (CollectionUtils.isEmpty(tags)) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- switch (tag) {
|
|
|
|
|
- case "票圈受欢迎":
|
|
|
|
|
- return "videoTag.platform = 'platform'";
|
|
|
|
|
- case "同类用户喜欢":
|
|
|
|
|
- return "videoTag.account_id = " + accountId;
|
|
|
|
|
- case "你的用户爱看":
|
|
|
|
|
- return "videoTag.type = " + type;
|
|
|
|
|
- case "猜TA想看":
|
|
|
|
|
- return "videoTag.channel = " + channel;
|
|
|
|
|
- default:
|
|
|
|
|
- return null;
|
|
|
|
|
|
|
+ StringBuilder sql = new StringBuilder("(");
|
|
|
|
|
+ for (String tag : tags) {
|
|
|
|
|
+ String item;
|
|
|
|
|
+ switch (tag) {
|
|
|
|
|
+ case "票圈受欢迎":
|
|
|
|
|
+ item = "videoTag.platform = 'platform'";
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "同类用户喜欢":
|
|
|
|
|
+ item = "videoTag.account_id = " + accountId;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "你的用户爱看":
|
|
|
|
|
+ item = "videoTag.type = " + type;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case "猜TA想看":
|
|
|
|
|
+ item = "videoTag.channel = " + channel;
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ item = null;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (Objects.nonNull(item)) {
|
|
|
|
|
+ sql.append(item).append(" or ");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (sql.length() > 1) {
|
|
|
|
|
+ sql.setLength(sql.length() - 4);
|
|
|
}
|
|
}
|
|
|
- //- 票圈受欢迎
|
|
|
|
|
- //- 同类用户喜欢
|
|
|
|
|
- //- 你的用户爱看
|
|
|
|
|
- //- 猜TA想看
|
|
|
|
|
|
|
+ sql.append(")");
|
|
|
|
|
+ return sql.toString();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private Long getVideoExcludeRecentNotUsed(Integer recentNotUsed) {
|
|
private Long getVideoExcludeRecentNotUsed(Integer recentNotUsed) {
|