zoukankan      html  css  js  c++  java
  • 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";
    }  

  • 相关阅读:
    ThreadPoolHelper
    微软发布架构师期刊阅读器
    The Attribute basic
    静态构造函数(Static Constructor)(It performs well in Singleton)
    【代码保留】WebService发布本地磁盘信息
    oracle sqlplus
    【代码保留】IP地址排序(字符串分隔补齐)
    [WCF]How to Hosting?
    生成Xnb文件[转]
    sqlite 中文排序
  • 原文地址:https://www.cnblogs.com/meimao5211/p/3274754.html
Copyright © 2011-2022 走看看