• HQL 查询数据 (获取页面输入的查询条件字段)


    /*
    * 查询提取位置表所有数据
    *
    */

    public String ListEtlExtractPositionOfAll(){

    // 接受数据库中传送的code
    int code = Integer.parseInt(get("code").toString().trim());

    this.getmenu(code, this.getRequest());

    StringBuffer where = new StringBuffer("1=1");
    StringBuffer path = new StringBuffer("ListEtlExtractPositionOfAll.action?code=").append(code);

    String wzxx = get("wzxx")==null?"":get("wzxx").toString().trim();
    String bbh = get("bbh")==null?"":get("bbh").toString().trim();


    if(get("wzxx")!=null && !"".equals(get("wzxx"))){
    where.append(" and positionNum like '%").append(wzxx).append("%' ");
    path.append(" &wzxx=").append(wzxx);
    }
    if(get("bbh")!=null && !"".equals(get("bbh"))){
    if(get("wzxx")!=null && !"".equals(get("wzxx"))){
    where.append(" and versionNum=").append(bbh);
    path.append(" &bbh=").append(bbh);
    }else{
    where.append(" and versionNum=").append(bbh);
    path.append(" &bbh=").append(bbh);
    }

    }
    // h获取页面输入的查询条件字段
    // String str ="";
    // if(get("wzxx")!=null && !"".equals(get("wzxx"))){
    // str = " positionNum like '%"+get("wzxx")+"%'";
    // }
    // if(get("bbh")!=null && !"".equals(get("bbh"))){
    // if (get("wzxx")!=null && !"".equals(get("wzxx"))) {
    // str += " and versionNum= '"+get("bbh")+"'";
    // }else {
    // str = " versionNum= '"+get("bbh")+"'";
    // }
    // }
    // 从字典表里把 状态 (60) 取出来
    List<SysDictionary> ztDicList = this.orgConfigService.QueryDicByType(60);
    if (ztDicList != null) {
    this.getRequest().setAttribute("ztDicList", ztDicList);
    }

    // 查询分页调用ACTION
    pageService.getPage(path.toString(), 0, this.getRequest());
    // PageEntity entity = pageService.doList("Etlextractposition", "1=1");
    PageEntity entity = pageService.doList("Etlextractposition", where.toString().trim());
    // PageEntity entity = pageService.doList("Etlextractposition", where.toString().trim()==""?"1=1":where.toString().trim());
    // 查询元素表 显示元素信息


    List<Baseelement> list = new ArrayList<Baseelement>();
    list = bscs.QueryAllBaseelement();
    // 设置setAttribute 属性
    this.getRequest().setAttribute("list", list);
    this.getRequest().setAttribute("page", entity);
    this.getRequest().setAttribute("code", code);
    this.getRequest().setAttribute("wzxx", get("wzxx"));
    this.getRequest().setAttribute("bbh", get("bbh"));

    return "success";
    }  

  • 相关阅读:
    【剑指offer】数组中重复的数字
    【剑指offer】数组中只出现一次的数字
    【linux】进程存储管理
    【linux】gdb调试
    【C/C++】快速排序的两种实现思路
    【C/C++】知识点
    【计算机网络】知识点记录
    【hadoop】mapreduce原理总结
    基于社交网络的情绪化分析IV
    Android studio 升级,不用下载完整版,完美更新到2.0
  • 原文地址:https://www.cnblogs.com/meimao5211/p/3274754.html
Copyright © 2020-2023  润新知