党员列表查询 入参改成不必传

This commit is contained in:
517612449@qq.com
2022-06-27 09:15:51 +08:00
parent d9f30cf6dd
commit 50ec1d54cb
2 changed files with 6 additions and 2 deletions

View File

@ -103,7 +103,7 @@ public class PartyMemberEventController {
@ApiOperation("党员列表模糊查询") @ApiOperation("党员列表模糊查询")
@GetMapping("/partyMember/paramQuery") @GetMapping("/partyMember/paramQuery")
public BaseResponse<List<EventPartyBranch>> getPartyMemberListByParam(@RequestParam(value = "belongBranch") String belongBranch, @RequestParam(value = "param") String param) { public BaseResponse<List<EventPartyBranch>> getPartyMemberListByParam(@RequestParam(value = "belongBranch", required = false) String belongBranch, @RequestParam(value = "param") String param) {
return BaseResponse.success(eventPartyBranchService.getPartyMemberListByParam(belongBranch, param)); return BaseResponse.success(eventPartyBranchService.getPartyMemberListByParam(belongBranch, param));
} }
} }

View File

@ -1,6 +1,7 @@
package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service.impl; package com.chinaunicom.mall.ebtp.extend.partyMemberEvent.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -78,9 +79,12 @@ public class EventPartyBranchServiceImpl extends ServiceImpl<EventPartyBranchMap
@Override @Override
public List<EventPartyBranch> getPartyMemberListByParam(String belongBranch, String param) { public List<EventPartyBranch> getPartyMemberListByParam(String belongBranch, String param) {
LambdaQueryWrapper<EventPartyBranch> queryMember = Wrappers.lambdaQuery(); LambdaQueryWrapper<EventPartyBranch> queryMember = Wrappers.lambdaQuery();
if (StrUtil.isNotBlank(belongBranch)) {
queryMember.eq(EventPartyBranch::getBelongBranch, belongBranch);
}
queryMember.eq(EventPartyBranch::getType, "2") queryMember.eq(EventPartyBranch::getType, "2")
.eq(EventPartyBranch::getStatus, "1") .eq(EventPartyBranch::getStatus, "1")
.eq(EventPartyBranch::getBelongBranch, belongBranch)
.and(w -> w.like(EventPartyBranch::getContactName, param) .and(w -> w.like(EventPartyBranch::getContactName, param)
.or().like(EventPartyBranch::getContactMobiphone, param) .or().like(EventPartyBranch::getContactMobiphone, param)
.or().like(EventPartyBranch::getContactEmail, param)); .or().like(EventPartyBranch::getContactEmail, param));