查询字典类型
2009-07-09 14:47
85 查看
在DictionaryKindListPane.xhtml中:注意不要绑定字段,要重新定义变量,绑定变量。
DictionaryKindModel:
<ui:define name="QueryConditionPanel"> <h:form style="margin:0px;" mce_style="margin:0px;" id="theBriefQueryForm"> <table align="center" width="80%"> <tr width="60%"> <td align="right" style="font-size: 10pt;" mce_style="font-size: 10pt;" width="40%"> 字典类型: <jsfext:inputText value="#{dictionaryKindModel.kindCondition}" id="kind" tabindex="1" maxlength="64"> <jsfext:jseventlistener event="onkeydown" listener="convertEnter2Tab()" /> </jsfext:inputText> </td> <td align="right" style="font-size: 10pt;" mce_style="font-size: 10pt;" width="40%"> 字典中文含义: <jsfext:inputText value="#{dictionaryKindModel.detailCondition}" id="zdzwhy" tabindex="2" maxlength="65"> <jsfext:jseventlistener event="onkeydown" listener="convertEnter2Tab()" /> </jsfext:inputText> </td> <td align="center" style="font-size: 10pt;" mce_style="font-size: 10pt;" width="20%"> <h:commandButton value=" 查 询 " action="#{dictionaryKindModel.doBriefQuery}" tabindex="3"></h:commandButton> </td> </tr> </table> </h:form> </ui:define>
DictionaryKindModel:
// 查询条件变量 private String kindCondition; private String detailCondition; /** * * @author:denghuimin,yanghanming * @createTime:Jul 7, 2009 11:41:24 AM * @function:重写父类的findByQueryCondition方法 * @param otherCondition * 查询条件 * @return: */ public String findByQueryCondition(String otherCondition) { String errMessage = ""; List list = new ArrayList<QueryConVo>(); if (StringUtils.isNotBlank(this.getKindCondition())) { QueryConVo conVo = new QueryConVo(dictionaryKindDAOEx.KIND, this .getKindCondition()); list.add(conVo); } if (StringUtils.isNotBlank(this.getDetailCondition())) { QueryConVo conVo = new QueryConVo(dictionaryKindDAOEx.DETAIL, this .getDetailCondition()); list.add(conVo); } dklist = new ArrayList<DictionaryKind>(); GenarateConnection gc = (GenarateConnection) getCtx().getBean( BizGlobalConstants.X_GCONNECTION); String hql = "from DictionaryKind as ti where 1=1 and ti.scbz ='0'"; try { this.dklist = gc.findListForPage(hql, list, this .getCurrentPageNumber(), this.getPageSize()); this.rowCount = gc.findCountForPage(hql, list, this .getCurrentPageNumber(), this.getPageSize()); } catch (Exception e) { e.printStackTrace(); } return errMessage; } public String doBriefQuery() { String errMessage = ""; errMessage = findByQueryCondition(dictionaryKind.getKind()); this.fromOutcome = DictionaryKindListPane; return errMessage; }
相关文章推荐
- 维护字典类型,查询字典条目
- Python中让MySQL查询结果返回字典类型的方法
- Python中让MySQL查询结果返回字典类型的方法
- 用python操作mysql数据库(之数据查询结果返回字典类型)
- Python中让MySQL查询结果返回字典类型的方法
- python3 MySQL 查询返回字典类型
- Python中让MySQL查询结果返回字典类型的方法
- SQL语句:orac 3ff0 le中如何插入Date类型的数据和根据Date数据进行查询的方法
- Excel VBA练习:字典类型与正则表达式的使用
- SQL2005 查询表字段信息(是否标示列 字段名 主键 字段类型 长度 小数位 允许空 默认值 说明)
- Mongodb数据库查询NumberLong数据类型的方式
- MySQL登陆方式、数据类型、数据引擎及SQL查询语句,注意的问题.
- 字典类型方法
- 关于ADO+SQL /Access里面查询日期时间类型语句的一点总结
- Python核心数据类型——字典
- Python 二维字典查询
- oracle学习之二(数据类型和表的查询)
- SPQuery DateTime 类型查询
- (jdbcType)mybatis 查询Oracle Date类型字段只精确到年月日
- 关于Column '*' not found 解决方案 Hibernate使用SQL查询返回实体类型,即返回某个类,或实体类