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";
}
HQL 查询数据 (获取页面输入的查询条件字段)的更多相关文章
- 查询数据过多页面反应慢引入缓存解决方案(Redis、H2)
问题:原系统查询接口不支持分页也不可能加入分页支持,导致Ajax查询数据过多,返回数据达到2W多条记录时响应已经极慢,查询功能不要求数据实时性,页面反应速度极慢.体验不好:经排查是由于数据量过大导 ...
- flask再学习-思考之怎么从数据库中查询数据在页面展示!
看别人视频觉得很简单,要自己做蒙蔽了!这样子.NO! 1. 流程: 首先要有和数据库连接的驱动!一般有PYMySQL mysqlclient 等 使用扩展Flask-SQLAlchemy 获得orm对 ...
- 查询数据SELECT 之单表查询
一.单表查询的语法与关键字的执行优先级""" # 单表查询# 单标查询完整与法:# select distinct(关键字,代表查询的意思,后面跟)字段1,字段2...( ...
- 查询数据表,去除符合某些条件的记录,没有自动增长列(not exists)
select distinct ccode,isnull(cexch_name,''),N'',N'',N'2014.03',0,1,1,1,12 from RP_bankrecp where not ...
- 根据本周本月本日来查询数据 C#winform数据查询
这个我是在winform的页面上做的 1. 首先是在页面上添加3个lable 第一次点击lable会有相应的数据被查询出来 第二次点击同一个lable会刷新所有的数据 2.点击不同的label会 ...
- 在MongoDB数据库中查询数据(上)
在MongoDB数据库中查询数据(上) 在MongoDB数据库中,可以使用Collection对象的find方法从一个集合中查询多个数据文档,find方法使用方法如下所示: collection.fi ...
- Python3操作MySQL,查询数据并保存到文件中
我们在测试过程中,可能需要到数据库中拉去一些数据,为从测试准备.比如最近在做接口性能测试的时候,就需要很多数据来支撑,所以就需要的数据库去查询数据,下面就是python3 查询 mysql 并且保存到 ...
- SQL Server 基础 03 查询数据基础
查询数据 简单的查询 create table stu_info ( sno int not null ,sname ) not null ,sex ) not null ,birth ) not n ...
- Pandas查询数据的几种方法
Pandas查询数据 Pandas查询数据的几种方法 df.loc方法,根据行.列的标签值查询 df.iloc方法,根据行.列的数字位置查询 df.where方法 df.query方法 .loc既能查 ...
随机推荐
- stark组件之注册与路由系统(三)
在文章stark组件前戏中已经提到过,django的注册功能是通过AdminSite的单例进行组册的,所以在这里也可以进行单例模式. class AdminSite(object): def __in ...
- LeetCode(54)Spiral Matrix
题目 Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral ...
- PLSQLDeveloper安装与配置(详细图文)
PLSQLDeveloper安装与配置(详细图文) 听语音 | 浏览:21912 | 更新:2016-10-24 17:12 1 2 3 4 5 6 7 分步阅读 在公司做项目时需要使用PLSQL D ...
- js重新讲解继承,es5的一些继承,es6继承的改变 ----------由浅入深
es5 利用原型公有私有继承 function Parent(name) { this.name = name } Parent.prototype.home = '北京'; function Chi ...
- codevs1128 导弹拦截
题目描述 Description 经过11 年的韬光养晦,某国研发出了一种新的导弹拦截系统,凡是与它的距离不超过其工作半径的导弹都能够被它成功拦截.当工作半径为0 时,则能够拦截与它位置恰好相同的导弹 ...
- QT-Embedded-4.5.3在海思35xx上移植
QT4.5.3在海思3520A上移植步骤-修订版 2015年3月29日星期日, 16:59:03 1.首先要保证已经安装了海思的交叉编译器: #arm-hi + Tab key to show wh ...
- 封装java-get-post请求方式
package com.ecar.eoc.content.platform.utils; import java.io.IOException;import java.util.HashMap;imp ...
- JAVA初级复习知识点归纳
JDK的安装: 下载.安装 配置环境变量 a) path:.;%JAVA_HOME%\bin; b) JAVA_HOME:JDK的安装目录 c) classpath JDK和JRE和JVM: JAVA ...
- Spring boot精要
1.自动配置:针对很多Spring应用程序的常见应用功能,SpringBoot能自动提供相关配置: 2.起步依赖:告诉SpringBoot需要什么功能,他就能引入需要的库: 3.命令行界面:这是Spr ...
- mysql 排序order by可以根据权重,进行表达式计算。再排序
1.select * from tbl_actor order by (follower_count+Recommend_weight)*weight_ratio desc limit 3; 2.or ...