天翎MyApps技术社区 - 低代码平台 | 流程管理系统 | BPM软件

 找回密码
 注册成为天翎用户
查看: 3023|回复: 0

[视图-数据&查询] 视图sql过滤模式中的参数是菜单的参数【数据过滤-SQL(菜单参数为条件)】

[复制链接]
irene 发表于 2012-4-20 17:53:09 | 显示全部楼层 |阅读模式
Q:视图sql过滤模式中,过滤条件中的参数是菜单的参数,脚本该怎么写?
A:可以参考下列脚本:
  1. request = $WEB.getParamsTable().getHttpRequest();
  2. var state = getParameter("state"); //state是菜单的参数名
  3. if(state!=null &&  state!=""){
  4. request.getSession().setAttribute("state",state);
  5. }
  6. var s = request.getSession().getAttribute("state");
  7. var sql="";
  8. if(s!=""){
  9. sql = "select item_字段一,domainid,id  from tlk_excel where ";
  10. sql +="  item_字段一='"+s+"'";
  11. }
  12. println("sql===="+sql);
  13. sql;
复制代码

本版积分规则

QQ|手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-12 06:41

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表