fix:添加多查询条件

上级 f2ee01ec
...@@ -24,8 +24,6 @@ import java.util.Objects; ...@@ -24,8 +24,6 @@ import java.util.Objects;
@RestController @RestController
@RequestMapping("/csdn/user") @RequestMapping("/csdn/user")
public class CsdnUserController { public class CsdnUserController {
@Autowired @Autowired
private CsdnUserInfoService csdnUserInfoService; private CsdnUserInfoService csdnUserInfoService;
...@@ -39,6 +37,10 @@ public class CsdnUserController { ...@@ -39,6 +37,10 @@ public class CsdnUserController {
final Integer userWeight = query.getUserWeight(); final Integer userWeight = query.getUserWeight();
final String nickName = query.getNickName(); final String nickName = query.getNickName();
final String userName = query.getUserName(); final String userName = query.getUserName();
final String articleType = query.getArticleType();
final Integer likeStatus = query.getLikeStatus();
final Integer collectStatus = query.getCollectStatus();
final Integer commentStatus = query.getCommentStatus();
Page<CsdnUserInfo> pageParm = new Page<>(); Page<CsdnUserInfo> pageParm = new Page<>();
pageParm.setCurrent(query.getPage()); pageParm.setCurrent(query.getPage());
pageParm.setSize(query.getPageSize()); pageParm.setSize(query.getPageSize());
...@@ -48,9 +50,21 @@ public class CsdnUserController { ...@@ -48,9 +50,21 @@ public class CsdnUserController {
if (StringUtils.isNotEmpty(userName)) { if (StringUtils.isNotEmpty(userName)) {
wrapper.eq("user_name", userName); wrapper.eq("user_name", userName);
} }
if (StringUtils.isNotEmpty(articleType)) {
wrapper.eq("article_type", articleType);
}
if (Objects.nonNull(userWeight)) { if (Objects.nonNull(userWeight)) {
wrapper.eq("user_weight", userWeight); wrapper.eq("user_weight", userWeight);
} }
if (Objects.nonNull(likeStatus)) {
wrapper.eq("like_status", likeStatus);
}
if (Objects.nonNull(collectStatus)) {
wrapper.eq("collect_status", collectStatus);
}
if (Objects.nonNull(commentStatus)) {
wrapper.eq("comment_status", commentStatus);
}
if (StringUtils.isNotEmpty(nickName)) { if (StringUtils.isNotEmpty(nickName)) {
wrapper.like("nick_name", nickName); wrapper.like("nick_name", nickName);
} }
...@@ -135,5 +149,4 @@ public class CsdnUserController { ...@@ -135,5 +149,4 @@ public class CsdnUserController {
wrapper.eq("id", id); wrapper.eq("id", id);
return Result.ok(this.csdnUserInfoService.update(csdnUserInfo, wrapper)); return Result.ok(this.csdnUserInfoService.update(csdnUserInfo, wrapper));
} }
}
} \ No newline at end of file
...@@ -33,6 +33,10 @@ public class CsdnUserInfoQuery extends BasePage { ...@@ -33,6 +33,10 @@ public class CsdnUserInfoQuery extends BasePage {
* 用户权重 * 用户权重
*/ */
private Integer userWeight; private Integer userWeight;
/**
* 文章类型
*/
private String articleType;
/** /**
* 添加类型 * 添加类型
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册