{"inframe":false,"title":"查询","hidden":false,"roles":{"demo":1},"children":[{"configs":{"serverScript":"var sql, data = app.get();\n\nsql = 'select USER_ID,USER_NAME,DISPLAY_NAME,EMAIL,STATUS from WB_USER';\nif (!Wb.isEmpty(data.findCombo)) {\n  sql += ' where USER_NAME ={?findCombo?}';\n} else if (data.selRoleGrid) {\n  //按角色进行搜索用户\n  var paramName, i = 0,\n    roleParams = [],\n    roles = Wb.decode(data.selRoleGrid);\n  if (roles.length) {\n    Wb.each(roles, function(role) {\n      paramName = 'role' + (i++);\n      request.setAttribute(paramName, role.ROLE_ID);\n      roleParams.push('{?' + paramName + '?}');\n    });\n    sql += ' where USER_ID in (select distinct USER_ID from WB_USER_ROLE where ROLE_ID in (' + roleParams + '))';\n  }\n}\nrequest.setAttribute('sql', sql);","itemId":"module"},"children":[{"configs":{"sql":"{#sql#} {#sql.orderBy#}","itemId":"dataprovider1","dictTableNames":"WB_USER"},"children":[],"expanded":false,"type":"dataprovider"}],"expanded":true,"type":"module"}],"pageLink":"","iconCls":""}