zoukankan      html  css  js  c++  java
  • list 组合,模糊查询llist 数据(不走数据库)

        @ResponseBody
        @POST
        @Path("/megerPerson/{realName}")
        public ResultEntity partnerList(@PathParam("realName") String realName) {            
            String flag="all".toLowerCase();
            List<HybridDto> HybridDtolist = new ArrayList<HybridDto>();
            List<Role> roleList = roleService.queryRoleAll();
            List<Partner> partnerList = partnerService.queryPartnerAll();
            HybridDto hbd = null;
            if(null!=roleList&&null!=partnerList&&!roleList.isEmpty()&&!partnerList.isEmpty()){
                for (Role role : roleList) {
                    for (Partner partner : partnerList) {
                        if (role.getAccount().equals(partner.getAccount())) {
                            hbd = new HybridDto();
                            hbd.setAccount(role.getAccount());
                            hbd.setRealName(role.getRealName());
                            hbd.setGoodField(partner.getGoodField());
                            hbd.setIsAuthentication(partner.getIsAuthentication());
                            hbd.setRoleId(partner.getId());
                            hbd.setApplyTime(partner.getApplyTime());
                            HybridDtolist.add(hbd);
                        }
                    }
                }    
            }
            if (flag.equals(realName.toLowerCase())) {
                return new ResultEntity(null, HybridDtolist);
            } else if (!"".equals(realName) && !flag.equals(realName.toLowerCase())) {
                List<HybridDto> HybridDtoListChildren = new ArrayList<HybridDto>();
                HybridDto hbds = null;
                for (HybridDto hbdt : HybridDtolist) {
                    System.out.println(hbdt.getRealName().indexOf(realName));
                    if (hbdt.getRealName().indexOf(realName) != -1) {//执行匹配
                        hbds = new HybridDto();
                        hbds.setAccount(hbdt.getAccount());
                        hbds.setRealName(hbdt.getRealName());
                        hbds.setGoodField(hbdt.getGoodField());
                        hbds.setIsAuthentication(hbdt.getIsAuthentication());
                        hbds.setRoleId(hbdt.getRoleId());
                        hbds.setApplyTime(hbdt.getApplyTime());
                        HybridDtoListChildren.add(hbds);
                    }
                }
                return new ResultEntity(null,HybridDtoListChildren);
            }
           }

  • 相关阅读:
    把redhat5.4-linux2.6.18内核升级到2.6.24 vmware虚拟机中
    webdeploy 使用总结(二)
    System.Web.UI.Page 详解(转)
    Dapper常用方法总结
    webdeploy 使用总结(一)
    Log4Net 详解(转)
    C# 日志工具汇总(转)
    Global.asax 详解(转)
    Transfer与Redirect区别(转)
    web.config配置节system.webServer的子元素详细介绍
  • 原文地址:https://www.cnblogs.com/austinspark-jessylu/p/6603645.html
Copyright © 2011-2022 走看看