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

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

[视图-数据&查询] 查询条件是复选框,或者用户选择框,选中多项,怎么查询

[复制链接]
karrman 发表于 2016-5-19 13:17:59 | 显示全部楼层 |阅读模式
Q:查询条件是复选框,或者用户选择框,选中多项,怎么查询
A:
  1. var selectone=getItemValueAsString("团委选择");//复选框,多选项
  2. var sql="select * from tlk_支部信息 where 1=1 ";
  3. if(selectone!=""&&selectone!=null){
  4.    selectone=selectone.replace(";","','");
  5.    selectone = "('"+selectone+"')";
  6.    //println("selectone========="+selectone);
  7.     sql+="and item_所属分团委 in "+selectone+" ";
  8. }else {
  9.     sql+=" and 2=3";
  10. }
  11. println("sql==========="+sql);
  12. sql;
复制代码


原型如下:
0.jpg

本版积分规则

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

GMT+8, 2026-8-12 05:48

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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