|
|
@@ -10,9 +10,12 @@ import com.cyksj.model.manage.views.AccountView;
|
|
|
import com.cyksj.service.mange.CmsAccountService;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
import com.ejlchina.searcher.SearchResult;
|
|
|
+import com.ejlchina.searcher.operator.Equal;
|
|
|
+import com.ejlchina.searcher.param.Operator;
|
|
|
import com.ejlchina.searcher.util.MapUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
@@ -36,8 +39,12 @@ public class CmsAccountController {
|
|
|
private final HomeGroupMapper homeGroupMapper;
|
|
|
|
|
|
@GetMapping("/get")
|
|
|
- public Result<SearchResult<AccountView>> get(){
|
|
|
- SearchResult<AccountView> search = beanSearcher.search(AccountView.class, MapUtils.flat(request.getParameterMap()));
|
|
|
+ public Result<SearchResult<AccountView>> get(String account ,String expiryTime){
|
|
|
+ SearchResult<AccountView> search = beanSearcher.search(AccountView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
+ .field(AccountView::getAccount, StringUtils.isBlank(account) ? null : account).op(Operator.EndWith)
|
|
|
+ .field(AccountView::getExpiryTime, StringUtils.isBlank(expiryTime) ? null : expiryTime).op(Operator.LessEqual)
|
|
|
+ .build()
|
|
|
+ );
|
|
|
search.getDataList().forEach((accountView)->{
|
|
|
Integer invited = homeGroupMapper.selectCount(Wrappers.lambdaQuery(HomeGroup.class).eq(HomeGroup::getAccountId, accountView.getId()).eq(HomeGroup::getStatus, "invited"));
|
|
|
Integer total = homeGroupMapper.selectCount(Wrappers.lambdaQuery(HomeGroup.class).eq(HomeGroup::getAccountId, accountView.getId()));
|