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既能查 ...
随机推荐
- ubuntu 安装 navicat
下载navicat解压到opt目录 创建桌面快捷方式sudo vim /usr/share/applications/navicat.desktop [Desktop Entry] Encoding= ...
- SQL-Redis使用详细教程
一.Redis基础部分: 1.redis介绍与安装比mysql快10倍以上 *****************redis适用场合**************** 1.取最新N个数据的操作 2.排行榜应 ...
- 第二周习题F
Starting with x and repeatedly multiplying by x, we can compute x31 with thirty multiplications: x2 ...
- Apache Ambari 2.7.3.0 离线安装
1. 准备 (内存 3G 硬盘 40G) 0)设置ssh无密码 ssh-keygencat id_rsa.pub >> authorized_keyschmod 700 ~/.sshchm ...
- Javascript类型转换的规则全面&附有实例
Javascript的变量是松散类型的,它可以存储Javascript支持的任何数据类型,其变量的类型可以在运行时被动态改变.请看示例: 1 2 3 var n = 10; n = "hel ...
- 【扫描线】HDU 5124 lines
http://acm.hdu.edu.cn/showproblem.php?pid=5124 [题意] 在数轴x上,每次操作都覆盖一个区间的所有点,问被覆盖次数最多的点是覆盖了多少次 [思路] 最简单 ...
- hdu 4431 绝对值之和最小公式
/* 普通的二分不好写,反正我没写出来,这题核心需要求出绝对值最小公式 sum=|x+10|+|x+5|+|x+1|+|x-2|+|x-6|;sumx[1]=-10;sumx[2]=-15;sumx[ ...
- bzoj 1962 硬币游戏 (猜数问题)
[bzoj1962]模型王子 2015年3月26日1,6460 Description Input 输入数据共一行,两个整数N,K,用一个空格隔开,具体意义如题目中所述. Output 输出数据共一行 ...
- hdu3440 House Man 【差分约束系统】
House Man Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- 基于HttpClient4.5.2实现的HttpClient工具类
1.maven依赖: <dependency> <groupId>org.apache.commons</groupId> <artifactId>co ...