下拉状态模糊查询功能(异步数据加载)

ptl_main.jsp:
标签判断表达式的值,如果表达式的值为 true 则执行其主体内容。

下拉状态模糊查询功能(异步数据加载)_第1张图片
image.png
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
                                                                                      
                                                                        
        按状态:                                                                              
                                                                                     
                                                     
        style="background-color:#F60">全部  
        style="background-color:#F60">申请   
        style="background-color:#F60">审核   
        style="background-color:#F60">创建   
        style="background-color:#F60">测试   
        style="background-color:#F60">发布   
         
                                                                                     
                                                                                     

main.jsp:

                                                                                                      

action.java:

public String queryPro() {
        HttpServletRequest request = ServletActionContext.getRequest();
        // 模糊查询
        SearchConditionDto sDto = (SearchConditionDto) MemcacheUtil.getMemcached("sdto");
        name = request.getParameter("pr_Name");
        ProjectDto dto = new ProjectDto();
        dto.setPr_Name(name);
        if (sDto != null) {
            dto.setU_Id(sDto.getUid());
        }

        prolist = this.projectService.queryProject(dto);
        if (prolist != null) {
            // projectDto添加 状态的名称
            for (int i = 0; i < prolist.size(); i++) {
                // 查询状态表
                ProjectStateDto psDto = new ProjectStateDto();
                psDto.setPs_ID(prolist.get(i).getpS_Id());
                List pDtos = this.projectstateService.queryProjectState(psDto);
                // 项目表增加状态名称
                for (ProjectStateDto projectstateDto : pDtos) {
                    if (projectstateDto.getPs_Name().equals("NonDesignPaper")) {
                        prolist.get(i).setStatus("未设计问卷");
                    } else if (projectstateDto.getPs_Name().equals("NonSurvey")) {
                        prolist.get(i).setStatus("未调查");
                    } else if (projectstateDto.getPs_Name().equals("SurveyBegin")) {
                        prolist.get(i).setStatus("调查中");
                    } else if (projectstateDto.getPs_Name().equals("SurveyPause")) {
                        prolist.get(i).setStatus("调查暂停");
                    } else if (projectstateDto.getPs_Name().equals("SurveyEnd")) {
                        prolist.get(i).setStatus("调查结束");
                    }
                }
            }
        }
        // 模糊查询分页

        if (sDto != null) {

            log.error(sDto.getUserName() + "按条件project.pr_Name=" + name + "进行了模糊查询");
        }
        return SUCCESS;
    }

servlet.java:

/*
     * 模糊查询
     */

    public ModelAndView queryPro(HttpServletRequest request,
            HttpServletResponse response) {
        // 模糊查询
        SearchConditionDto sDto = (SearchConditionDto) MemcacheUtil
                .getMemcached("sdto",request);
        String name = request.getParameter("pr_Name");
        ProjectDto dto = new ProjectDto();
        dto.setPr_Name(name);
        if (sDto != null) {
            dto.setU_Id(sDto.getUid());
        }

        List list = this.projectService.queryProject(dto);
        if (list != null) {
            // projectDto添加 状态的名称
            for (int i = 0; i < list.size(); i++) {
                // 查询状态表
                ProjectStateDto psDto = new ProjectStateDto();
                psDto.setPs_ID(list.get(i).getpS_Id());
                List pDtos = this.projectstateService
                        .queryProjectState(psDto);
                // 项目表增加状态名称
                for (ProjectStateDto projectstateDto : pDtos) {
                    if (projectstateDto.getPs_Name().equalsIgnoreCase("NonDesignPaper")) {
                        list.get(i).setStatus("未设计问卷");
                    } else if (projectstateDto.getPs_Name().equalsIgnoreCase("NonSurvey")) {
                        list.get(i).setStatus("未调查");
                    } else if (projectstateDto.getPs_Name().equalsIgnoreCase(
                            "SurveyBegin")) {
                        list.get(i).setStatus("调查中");
                    } else if (projectstateDto.getPs_Name().equalsIgnoreCase(
                            "SurveyPause")) {
                        list.get(i).setStatus("调查暂停");
                    } else if (projectstateDto.getPs_Name().equalsIgnoreCase("SurveyEnd")) {
                        list.get(i).setStatus("调查结束");
                    }
                }
            }
        }
        // 模糊查询分页

        if (sDto != null) {

            log.error(sDto.getUserName() + "按条件project.pr_Name=" + name
                    + "进行了模糊查询");
        }
        ModelAndView mav = new ModelAndView("main.jsp");
        mav.addObject("prolist", list);
        mav.addObject("name", name);
        return mav;
    }

你可能感兴趣的:(下拉状态模糊查询功能(异步数据加载))