您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

176 行
4.8 KiB

  1. {
  2. "meta": {
  3. "$_GET": [
  4. {
  5. "type": "text",
  6. "name": "sort"
  7. },
  8. {
  9. "type": "text",
  10. "name": "dir"
  11. },
  12. {
  13. "type": "text",
  14. "name": "filter"
  15. },
  16. {
  17. "type": "text",
  18. "name": "id"
  19. }
  20. ]
  21. },
  22. "exec": {
  23. "steps": {
  24. "name": "query",
  25. "module": "dbconnector",
  26. "action": "select",
  27. "options": {
  28. "connection": "authdb",
  29. "sql": {
  30. "type": "select",
  31. "columns": [
  32. {
  33. "table": "xuserrole",
  34. "column": "id"
  35. },
  36. {
  37. "table": "roles",
  38. "column": "id",
  39. "alias": "rolid"
  40. },
  41. {
  42. "table": "roles",
  43. "column": "name"
  44. }
  45. ],
  46. "params": [
  47. {
  48. "operator": "equal",
  49. "type": "expression",
  50. "name": ":P1",
  51. "value": "{{$_GET.id}}",
  52. "test": ""
  53. }
  54. ],
  55. "table": {
  56. "name": "xuserrole"
  57. },
  58. "primary": "id",
  59. "joins": [
  60. {
  61. "table": "roles",
  62. "column": "*",
  63. "type": "INNER",
  64. "clauses": {
  65. "condition": "AND",
  66. "rules": [
  67. {
  68. "table": "roles",
  69. "column": "id",
  70. "operator": "equal",
  71. "operation": "=",
  72. "value": {
  73. "table": "xuserrole",
  74. "column": "roleid"
  75. }
  76. }
  77. ]
  78. },
  79. "primary": "id"
  80. }
  81. ],
  82. "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)",
  83. "wheres": {
  84. "condition": "AND",
  85. "rules": [
  86. {
  87. "id": "xuserrole.userid",
  88. "field": "xuserrole.userid",
  89. "type": "double",
  90. "operator": "equal",
  91. "value": "{{$_GET.id}}",
  92. "data": {
  93. "table": "xuserrole",
  94. "column": "userid",
  95. "type": "number",
  96. "columnObj": {
  97. "type": "integer",
  98. "primary": false,
  99. "unique": false,
  100. "nullable": true,
  101. "name": "userid"
  102. }
  103. },
  104. "operation": "="
  105. },
  106. {
  107. "condition": "OR",
  108. "rules": [
  109. {
  110. "id": "roles.isDepartment",
  111. "field": "roles.isDepartment",
  112. "type": "boolean",
  113. "operator": "equal",
  114. "value": false,
  115. "data": {
  116. "table": "roles",
  117. "column": "isDepartment",
  118. "type": "boolean",
  119. "columnObj": {
  120. "type": "boolean",
  121. "primary": false,
  122. "unique": false,
  123. "nullable": true,
  124. "name": "isDepartment"
  125. }
  126. },
  127. "operation": "="
  128. },
  129. {
  130. "id": "roles.isDepartment",
  131. "field": "roles.isDepartment",
  132. "type": "boolean",
  133. "operator": "is_null",
  134. "value": null,
  135. "data": {
  136. "table": "roles",
  137. "column": "isDepartment",
  138. "type": "boolean",
  139. "columnObj": {
  140. "type": "boolean",
  141. "primary": false,
  142. "unique": false,
  143. "nullable": true,
  144. "name": "isDepartment"
  145. }
  146. },
  147. "operation": "IS NULL"
  148. }
  149. ],
  150. "conditional": null
  151. }
  152. ],
  153. "conditional": null,
  154. "valid": true
  155. }
  156. }
  157. },
  158. "output": true,
  159. "meta": [
  160. {
  161. "type": "number",
  162. "name": "id"
  163. },
  164. {
  165. "type": "number",
  166. "name": "rolid"
  167. },
  168. {
  169. "type": "text",
  170. "name": "name"
  171. }
  172. ],
  173. "outputType": "array"
  174. }
  175. }
  176. }