|
- {
- "meta": {
- "$_GET": [
- {
- "type": "text",
- "name": "sort"
- },
- {
- "type": "text",
- "name": "dir"
- },
- {
- "type": "text",
- "name": "filter"
- },
- {
- "type": "text",
- "name": "id"
- }
- ]
- },
- "exec": {
- "steps": {
- "name": "query",
- "module": "dbconnector",
- "action": "select",
- "options": {
- "connection": "authdb",
- "sql": {
- "type": "select",
- "columns": [
- {
- "table": "xuserrole",
- "column": "id"
- },
- {
- "table": "roles",
- "column": "id",
- "alias": "rolid"
- },
- {
- "table": "roles",
- "column": "name"
- }
- ],
- "params": [
- {
- "operator": "equal",
- "type": "expression",
- "name": ":P1",
- "value": "{{$_GET.id}}",
- "test": ""
- }
- ],
- "table": {
- "name": "xuserrole"
- },
- "primary": "id",
- "joins": [
- {
- "table": "roles",
- "column": "*",
- "type": "INNER",
- "clauses": {
- "condition": "AND",
- "rules": [
- {
- "table": "roles",
- "column": "id",
- "operator": "equal",
- "operation": "=",
- "value": {
- "table": "xuserrole",
- "column": "roleid"
- }
- }
- ]
- },
- "primary": "id"
- }
- ],
- "query": "select `xuserrole`.`id`, `roles`.`id` as `rolid`, `roles`.`name` from `xuserrole` inner join `roles` on `roles`.`id` = `xuserrole`.`roleid` where `xuserrole`.`userid` = ? and (`roles`.`isDepartment` = ? or `roles`.`isDepartment` is null)",
- "wheres": {
- "condition": "AND",
- "rules": [
- {
- "id": "xuserrole.userid",
- "field": "xuserrole.userid",
- "type": "double",
- "operator": "equal",
- "value": "{{$_GET.id}}",
- "data": {
- "table": "xuserrole",
- "column": "userid",
- "type": "number",
- "columnObj": {
- "type": "integer",
- "primary": false,
- "unique": false,
- "nullable": true,
- "name": "userid"
- }
- },
- "operation": "="
- },
- {
- "condition": "OR",
- "rules": [
- {
- "id": "roles.isDepartment",
- "field": "roles.isDepartment",
- "type": "boolean",
- "operator": "equal",
- "value": false,
- "data": {
- "table": "roles",
- "column": "isDepartment",
- "type": "boolean",
- "columnObj": {
- "type": "boolean",
- "primary": false,
- "unique": false,
- "nullable": true,
- "name": "isDepartment"
- }
- },
- "operation": "="
- },
- {
- "id": "roles.isDepartment",
- "field": "roles.isDepartment",
- "type": "boolean",
- "operator": "is_null",
- "value": null,
- "data": {
- "table": "roles",
- "column": "isDepartment",
- "type": "boolean",
- "columnObj": {
- "type": "boolean",
- "primary": false,
- "unique": false,
- "nullable": true,
- "name": "isDepartment"
- }
- },
- "operation": "IS NULL"
- }
- ],
- "conditional": null
- }
- ],
- "conditional": null,
- "valid": true
- }
- }
- },
- "output": true,
- "meta": [
- {
- "type": "number",
- "name": "id"
- },
- {
- "type": "number",
- "name": "rolid"
- },
- {
- "type": "text",
- "name": "name"
- }
- ],
- "outputType": "array"
- }
- }
- }
|