|
|
|
@ -101,14 +101,17 @@ public class AlbumService {
|
|
|
|
|
return (Root<ArtistAlbum> root, CriteriaQuery<?> query, CriteriaBuilder builder) -> {
|
|
|
|
|
List<Predicate> predicateList = new ArrayList<Predicate>();
|
|
|
|
|
if (StringUtils.isNotBlank(param.getArtistId())) {
|
|
|
|
|
// 音乐人id
|
|
|
|
|
predicateList.add(builder.equal(root.get("artistId"), param.getArtistId()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (param.getState() != null) {
|
|
|
|
|
// 专辑状态
|
|
|
|
|
predicateList.add(builder.equal(root.get("state"), param.getState()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (param.getTimeQuery() != null) {
|
|
|
|
|
// 时间范围,系统定义
|
|
|
|
|
switch (param.getTimeQuery()) {
|
|
|
|
|
case 1:
|
|
|
|
|
// 今年
|
|
|
|
@ -134,6 +137,21 @@ public class AlbumService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(param.getName())) {
|
|
|
|
|
// 专辑名称
|
|
|
|
|
String likeExpression = "%" + param.getName() + "%";
|
|
|
|
|
predicateList.add(builder.and(builder.like(root.get("name"), likeExpression)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(param.getStartTime() != null) {
|
|
|
|
|
predicateList.add(builder.greaterThanOrEqualTo(root.get("createTime"), param.getStartTime()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(param.getEndTime() != null) {
|
|
|
|
|
predicateList.add(builder.lessThanOrEqualTo(root.get("createTime"), param.getEndTime()));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return builder.and(predicateList.toArray(new Predicate[predicateList.size()]));
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|