<table width="100%" class="form_table">
<tr>
<td align="right" class="form_label">档案名称 :</td>
<td>
<!-- like 条件 -->
<h:text property="criteria/_expr[2]/fileName"/>
<h:hidden property="criteria/_expr[2]/_op" value="like"/>
<h:hidden property="criteria/_expr[2]/_likeRule" value="all"/>
</td>
<td align="right" class="form_label">是否作废 :</td>
<td>
<!-- 等于 条件 -->
<h:select id="select2" name="delFlag" property="criteria/_expr[3]/status" onchange="setCriteriaDelFlagValue()">
<h:option label="请选择" value="" />
<h:option label="是" value="1" />
<h:option label="否" value="0" />
</h:select>
<h:hidden property="criteria/_expr[3]/status" id="criteria3" />
<h:hidden property="criteria/_expr[3]/_op" id="criteria3op" />
</td>
</tr>
<tr>
<td align="right" class="form_label">档案编号 :</td>
<td class="height_td">
<h:text property="criteria/_expr[4]/code"/>
</td>
<td align="right" class="form_label">版本号 :</td>
<td class="height_td">
<h:text property="criteria/_expr[5]/versionNo" />
</td>
</tr>
<tr class="height_td">
<!-- between 条件 -->
<h:hidden property="criteria/_expr[6]/_op" value="between" />
<h:hidden property="criteria/_expr[6]/placeTime" value=" " />
<h:hidden property="criteria/_expr[6]/_pattern" value="yyyy-MM-dd HH:mm:ss"/>
<td align="right" class="form_label">归档开始时间 :</td>
<td class="height_td">
<w:date property="criteria/_expr[6]/_min" format="yyyy-MM-dd HH:mm:ss" id = "startDate"/>
</td>
<td align="right" class="form_label">归档结束时间 :</td>
<td class="height_td">
<w:date property="criteria/_expr[6]/_max" format="yyyy-MM-dd HH:mm:ss" id = "endDate"/>
</td>
</tr>
<tr class="height_td">
<td align="right" class="form_label">数据安全等级 :</td>
<td class="height_td" colspan="3">
<h:radio property="criteria/_expr[7]/safeClass" value="绝密级"/>绝密级
<h:radio property="criteria/_expr[7]/safeClass" value="秘密级"/>秘密级
<h:radio property="criteria/_expr[7]/safeClass" value="内部级"/>内部级
<h:radio property="criteria/_expr[7]/safeClass" value="公共级"/>公共级
</td>
</tr>
<l:notEmpty property="tblArchivesKeywords">
<l:iterate id="classKeyWords" property="tblArchivesKeywords" indexId="id1" >
<l:output oddOutput=" <tr>" />
<td align="right" class="form_label"><b:write iterateId="classKeyWords" property="keywordsName"/> :</td>
<td>
<h:hidden name="criteria/_and[1]/_or[1]/_and[${id1}]/_expr[1]/keywordsId" property="keywordsId" iterateId="classKeyWords"/>
<h:hidden property="criteria/_and[1]/_or[1]/_and[${id1}]/_expr[2]/_op" value="like"/>
<h:text property="criteria/_and[1]/_or[1]/_and[${id1}]/_expr[2]/keyValue" />
</td>
<l:output evenOutput=" </tr>" />
</l:iterate>
</l:notEmpty>
<tr align="center" >
<td colspan="4" >
<input type="button" value="查询" class="button" id="saveBtn" style="width:150px;" />
</td>
</tr>
</table>
<!-- 查询字段 -->
<h:hidden property="criteria/_select/_field[1]" value="fileId"/>
<h:hidden property="criteria/_select/_field[2]" value="classificationId"/>
<h:hidden property="criteria/_select/_field[3]" value="fileName"/>
<h:hidden property="criteria/_select/_field[4]" value="source"/>
<h:hidden property="criteria/_select/_field[5]" value="placeTime"/>
<h:hidden property="criteria/_select/_field[6]" value="code"/>
<h:hidden property="criteria/_select/_field[7]" value="status"/>
<h:hidden property="criteria/_distinct" value="true"/>
生成的SQL 语句
SELECT COUNT(*) EOS_ROW_COUNT FROM (SELECT DISTINCT THIS_.FILE_ID AS Y0_, THIS_.CLASSIFICATION_ID AS Y1_, THIS_.FILE_NAME AS Y2_, THIS_.SOURCE AS Y3_, THIS_.PLACE_TIME AS Y4_, THIS_.CODE AS Y5_, THIS_.STATUS AS Y6_ FROM (SELECT TAF.FILE_ID, TACF.CLASSIFICATION_ID, TAF.FILE_NAME, TAF.CODE, TAF.STATUS, TAF.SOURCE, TAF.PLACE_TIME, TAKF.KEYWORDS_ID, TAKF.KEY_VALUE FROM TBL_ARCHIVES_FILES TAF RIGHT JOIN TBL_ARCHIVES_CALSS_FILES TACF ON TAF.FILE_ID = TACF.FILE_ID LEFT JOIN TBL_ARCHIVES_KEY_FILE TAKF ON TAKF.FILE_ID = TAF.FILE_ID ORDER BY TAF.FILE_NAME) THIS_ WHERE (((THIS_.KEYWORDS_ID = ? AND THIS_.KEY_VALUE LIKE ? ESCAPE '~') OR (THIS_.KEYWORDS_ID = ? AND THIS_.KEY_VALUE LIKE ? ESCAPE '~')) OR (THIS_.KEYWORDS_ID = ? AND THIS_.KEY_VALUE LIKE ? ESCAPE '~')) AND THIS_.CLASSIFICATION_ID = ? AND THIS_.FILE_NAME LIKE ? ESCAPE '~' AND THIS_.STATUS = ? AND THIS_.CODE = ? AND THIS_.PLACE_TIME BETWEEN ? AND ?) TABLE_
在java代码中设置查询条件
public CriteriaType handleSearchCriteria(DataObject criteria, DataObject userInfo){ List<LogicType> andLTList = new ArrayList<LogicType>(); criteria.setList("_or",andLTList); //添加and条件 List<LogicType> orLTList = new ArrayList<LogicType>(); LogicType lt = new LogicTypeImpl(); lt.set_or(orLTList); andLTList.add(lt);//and条件中添加or条件list /* 人员 */ String userId = userInfo.getString("userId"); String userName = userInfo.getString("realName"); LogicType perLT = new LogicTypeImpl(); LogicType perLT1 = new LogicTypeImpl(); List<ExprType> andListPerson = new ArrayList<ExprType>(); List<LogicType> andLTListPerson = new ArrayList<LogicType>(); ExprType etId = new ExprTypeImpl(); etId.set_op("like"); etId.set_property("borrowerId"); etId.set_value(userId); andListPerson.add(etId); ExprType etName = new ExprTypeImpl(); etName.set_op("like"); etName.set_property("borrowerName"); etName.set_value(userName); andListPerson.add(etName); perLT1.set_expr(andListPerson); andLTListPerson.add(perLT1); perLT.set_and(andLTListPerson); orLTList.add(perLT); /* 岗位 */ List<DataObject> positionsList = userInfo.getList("positions"); if (!CollectionUtils.isEmpty(positionsList)) { List<LogicType> orLitPO = new ArrayList<LogicType>(); LogicType poLT = new LogicTypeImpl(); for (DataObject object : positionsList) { List<ExprType> andETList = new ArrayList<ExprType>(); List<LogicType> andLTListPO = new ArrayList<LogicType>(); LogicType tmpLt = new LogicTypeImpl(); LogicType andLt = new LogicTypeImpl(); ExprType exprType1 = new ExprTypeImpl(); exprType1.set_op("like"); exprType1.set_property("positionId"); exprType1.set_value(object.getString("positionId")); andETList.add(exprType1); ExprType exprType2 = new ExprTypeImpl(); exprType2.set_op("like"); exprType2.set_property("positionName"); exprType2.set_value(object.getString("positionName")); andETList.add(exprType2); tmpLt.set_expr(andETList); andLTListPO.add(tmpLt); andLt.set_and(andLTListPO); orLitPO.add(andLt); } poLT.set_or(orLitPO); orLTList.add(poLT); } /* 岗位组 */ List<DataObject> posGroupsList = userInfo.getList("posGroups"); if (!CollectionUtils.isEmpty(posGroupsList)) { List<LogicType> orListPG = new ArrayList<LogicType>(); LogicType pgLT = new LogicTypeImpl(); for (DataObject object1 : posGroupsList) { List<ExprType> andETLitPG = new ArrayList<ExprType>(); List<LogicType> andLTListPG = new ArrayList<LogicType>(); LogicType tmpLt = new LogicTypeImpl(); LogicType andLt = new LogicTypeImpl(); ExprType exprType1 = new ExprTypeImpl(); exprType1.set_op("like"); exprType1.set_property("positionGroupId"); exprType1.set_value(object1.getString("posGroupId")); andETLitPG.add(exprType1); ExprType exprType2 = new ExprTypeImpl(); exprType2.set_op("like"); exprType2.set_property("positionGroupName"); exprType2.set_value(object1.getString("groupName")); andETLitPG.add(exprType2); tmpLt.set_expr(andETLitPG); andLTListPG.add(tmpLt); andLt.set_and(andLTListPG); orListPG.add(andLt); } pgLT.set_or(orListPG); orLTList.add(pgLT); } /* 角色 */ List<DataObject> rolesList = userInfo.getList("roles"); if (!CollectionUtils.isEmpty(rolesList)) { List<LogicType> orListRO = new ArrayList<LogicType>(); LogicType roleLT = new LogicTypeImpl(); for (DataObject object : rolesList) { List<ExprType> andETLitRO = new ArrayList<ExprType>(); List<LogicType> andLTListRO = new ArrayList<LogicType>(); LogicType tmpLt = new LogicTypeImpl(); LogicType andLt = new LogicTypeImpl(); ExprType exprType1 = new ExprTypeImpl(); exprType1.set_op("like"); exprType1.set_property("roleId"); exprType1.set_value(object.getString("roleId")); andETLitRO.add(exprType1); ExprType exprType2 = new ExprTypeImpl(); exprType2.set_op("like"); exprType2.set_property("roleName"); exprType2.set_value(object.getString("roleName")); andETLitRO.add(exprType2); tmpLt.set_expr(andETLitRO); andLTListRO.add(tmpLt); andLt.set_and(andLTListRO); orListRO.add(andLt); } roleLT.set_or(orListRO); orLTList.add(roleLT); } /* 工作组 */ List<DataObject> teamrolesList = userInfo.getList("teamroles"); if (!CollectionUtils.isEmpty(teamrolesList)) { List<LogicType> orListTR = new ArrayList<LogicType>(); LogicType trLT = new LogicTypeImpl(); for (DataObject object : teamrolesList) { List<ExprType> andETLitTR = new ArrayList<ExprType>(); List<LogicType> andLTListTR = new ArrayList<LogicType>(); LogicType tmpLt = new LogicTypeImpl(); LogicType andLt = new LogicTypeImpl(); ExprType exprType1 = new ExprTypeImpl(); exprType1.set_op("like"); exprType1.set_property("workItemId"); exprType1.set_value(object.getString("grouproleId")); andETLitTR.add(exprType1); ExprType exprType2 = new ExprTypeImpl(); exprType2.set_op("like"); exprType2.set_property("workItemName"); exprType2.set_value(object.getString("groupRoleName")); andETLitTR.add(exprType2); tmpLt.set_expr(andETLitTR); andLTListTR.add(tmpLt); andLt.set_and(andLTListTR); orListTR.add(andLt); } trLT.set_or(orListTR); orLTList.add(trLT); } //List groupsList = userInfo.getList("groups"); return (CriteriaType) criteria; }
生成的SQL语句
相关推荐
对于新学习普元eos的同学来讲非常有用,里面有普元EOS nui版的示例,导入项目中就可以看,无需导入数据库,里面定义好了
普元EOS开发帮助手册,普元EOS开发帮助手册,普元EOS开发帮助手册,普元EOS开发帮助手册
普元eos platform 7.5 新版教程PDF高清
EOSV5.0 上海 普元 EOS5.0应用指南 EOSV5.0 上海 普元 EOS5.0应用指南 EOSV5.0 上海 普元 EOS5.0应用指南 EOSV5.0 上海 普元 EOS5.0应用指南
普元EOS7.5基础教程
EOS概览是普元开发工具eos的入门资料!学习完此概览将对SOA开发有进一步的深入!
反正导入普元EOS中,就可以运行查看效果,童叟无欺,你值得拥有!
普元EOS基础开发教程
普元EOS-Platform-7.0基础开发教程完整版
普元EOS6.3程序员教程
普元eos的网上资源比较难找,上传一下普元的登陆页面组件,希望能够帮到各位同行。普元的登陆组件大家先看看吧。
普元EOS程序员培训教程,一本全面的 普元教程.
普元EOS 安装配置资料 初学者 不会安装 配置 可下载此资源!
普元EOS Platform7.5培训视频,入门讲解,入门实例,让你更快,更全面的掌握普元EOS Platform
此资料看完了 保证你会用EOS 普元公司内部资料!
普元软件EOS开发工具学习ppt,边学边做,内含详细教程
网上普元eos的各种资料比较难找,上传一下帮助文档希望能够帮到各位。普元的使用帮助文档.网络资源大家先看看吧。
普元EOS工作流基本概念及总体介绍,EOS工作流开发第一课。
普元EOS7.6安装步骤(包含windows安装、linux哑安装),企业版、开发版,包括软硬件安装所具备的条件
普元eos-springbean开发