{
  "meta": {
    "$_GET": [
      {
        "type": "text",
        "name": "sort"
      },
      {
        "type": "text",
        "name": "dir"
      },
      {
        "type": "text",
        "name": "filter"
      },
      {
        "type": "number",
        "name": "userid"
      }
    ]
  },
  "exec": {
    "steps": {
      "name": "query",
      "module": "dbconnector",
      "action": "select",
      "options": {
        "connection": "authdb",
        "sql": {
          "type": "select",
          "columns": [
            {
              "table": "xuserrole",
              "column": "id"
            },
            {
              "table": "roles",
              "column": "id",
              "alias": "roleid"
            },
            {
              "table": "roles",
              "column": "name"
            }
          ],
          "params": [
            {
              "operator": "equal",
              "type": "expression",
              "name": ":P1",
              "value": "{{$_GET.userid}}",
              "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 `roleid`, `roles`.`name` from `xuserrole` inner join `roles` on `roles`.`id` = `xuserrole`.`roleid` where `xuserrole`.`roleid` <> ? and `xuserrole`.`roleid` <> ? and `xuserrole`.`roleid` <> ? and `xuserrole`.`roleid` <> ? and `xuserrole`.`userid` = ?",
          "wheres": {
            "condition": "AND",
            "rules": [
              {
                "id": "xuserrole.roleid",
                "field": "xuserrole.roleid",
                "type": "double",
                "operator": "not_equal",
                "value": 4,
                "data": {
                  "table": "xuserrole",
                  "column": "roleid",
                  "type": "number",
                  "columnObj": {
                    "type": "integer",
                    "primary": false,
                    "unique": false,
                    "nullable": true,
                    "name": "roleid"
                  }
                },
                "operation": "<>"
              },
              {
                "id": "xuserrole.roleid",
                "field": "xuserrole.roleid",
                "type": "double",
                "operator": "not_equal",
                "value": 6,
                "data": {
                  "table": "xuserrole",
                  "column": "roleid",
                  "type": "number",
                  "columnObj": {
                    "type": "integer",
                    "primary": false,
                    "unique": false,
                    "nullable": true,
                    "name": "roleid"
                  }
                },
                "operation": "<>"
              },
              {
                "id": "xuserrole.roleid",
                "field": "xuserrole.roleid",
                "type": "double",
                "operator": "not_equal",
                "value": 1,
                "data": {
                  "table": "xuserrole",
                  "column": "roleid",
                  "type": "number",
                  "columnObj": {
                    "type": "integer",
                    "primary": false,
                    "unique": false,
                    "nullable": true,
                    "name": "roleid"
                  }
                },
                "operation": "<>"
              },
              {
                "id": "xuserrole.roleid",
                "field": "xuserrole.roleid",
                "type": "double",
                "operator": "not_equal",
                "value": 7,
                "data": {
                  "table": "xuserrole",
                  "column": "roleid",
                  "type": "number",
                  "columnObj": {
                    "type": "integer",
                    "primary": false,
                    "unique": false,
                    "nullable": true,
                    "name": "roleid"
                  }
                },
                "operation": "<>"
              },
              {
                "id": "xuserrole.userid",
                "field": "xuserrole.userid",
                "type": "double",
                "operator": "equal",
                "value": "{{$_GET.userid}}",
                "data": {
                  "table": "xuserrole",
                  "column": "userid",
                  "type": "number",
                  "columnObj": {
                    "type": "integer",
                    "primary": false,
                    "unique": false,
                    "nullable": true,
                    "name": "userid"
                  }
                },
                "operation": "="
              }
            ],
            "conditional": null,
            "valid": true
          }
        }
      },
      "output": true,
      "meta": [
        {
          "type": "number",
          "name": "id"
        },
        {
          "type": "number",
          "name": "roleid"
        },
        {
          "type": "text",
          "name": "name"
        }
      ],
      "outputType": "array"
    }
  }
}