-- 创建 page
INSERT INTO `_page` (`pageId`,`pageName`,`pageType`,`sort`,`operation`,`operationByUserId`,`operationByUser`,`operationAt`) SELECT '{{pageId}}','权限规则管理','showInAvatarMenu','5','insert',NULL,NULL,NULL FROM DUAL WHERE NOT EXISTS (SELECT `pageId` FROM `_page` WHERE `pageId`='{{pageId}}');
-- 创建 resource
INSERT INTO `_resource` (`accessControlTable`,`resourceHook`,`pageId`,`actionId`,`desc`,`resourceType`,`appDataSchema`,`resourceData`,`requestDemo`,`responseDemo`,`operation`,`operationByUserId`,`operationByUser`,`operationAt`) SELECT NULL,NULL,'{{pageId}}','insertItemOfResource','✅权限规则-协议管理-插入信息','sql',NULL,'{\"table\": \"_resource\", \"operation\": \"jhInsert\"}','{\"appData\": {\"appId\": \"demo_advanced\", \"pageId\": \"{{pageId}}\", \"actionId\": \"insertItemOfResource\", \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36\", \"actionData\": {\"role\": \"teacher\", \"user\": \"test\", \"group\": \"adminGroup\"}}, \"packageId\": \"1651132614750_2530439\", \"packageType\": \"httpRequest\"}','{\"status\": \"success\", \"appData\": {\"rows\": [135], \"appId\": \"demo_advanced\", \"pageId\": \"{{pageId}}\", \"actionId\": \"insertItemOfResource\", \"resultData\": {\"rows\": [135]}}, \"packageId\": \"1651132614750_2530439\", \"timestamp\": \"2022-04-28T15:56:55+08:00\", \"packageType\": \"httpResponse\"}','update',NULL,NULL,'2022-04-28T15:56:55+08:00' FROM DUAL WHERE NOT EXISTS (SELECT `pageId` FROM `_resource` WHERE `pageId`='{{pageId}}' AND `actionId`='insertItemOfResource');
INSERT INTO `_resource` (`accessControlTable`,`resourceHook`,`pageId`,`actionId`,`desc`,`resourceType`,`appDataSchema`,`resourceData`,`requestDemo`,`responseDemo`,`operation`,`operationByUserId`,`operationByUser`,`operationAt`) SELECT NULL,NULL,'{{pageId}}','selectItemListOfResource','✅权限规则-协议管理-查询数据列表','sql',NULL,'{\"table\": \"_resource\", \"operation\": \"select\"}','{\"appData\": {\"appId\": \"demo_advanced\", \"pageId\": \"{{pageId}}\", \"actionId\": \"selectItemListOfResource\", \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36\", \"actionData\": {}}, \"packageId\": \"1651476258935_2593328\", \"packageType\": \"httpRequest\"}','{\"status\": \"success\", \"packageId\": \"1651476258935_2593328\", \"timestamp\": \"2022-05-02T15:24:19+08:00\", \"packageType\": \"httpResponse\"}','update',NULL,NULL,'2022-05-02T15:24:19+08:00' FROM DUAL WHERE NOT EXISTS (SELECT `pageId` FROM `_resource` WHERE `pageId`='{{pageId}}' AND `actionId`='selectItemListOfResource');
INSERT INTO `_resource` (`accessControlTable`,`resourceHook`,`pageId`,`actionId`,`desc`,`resourceType`,`appDataSchema`,`resourceData`,`requestDemo`,`responseDemo`,`operation`,`operationByUserId`,`operationByUser`,`operationAt`) SELECT NULL,NULL,'{{pageId}}','updateItemOfResource','✅权限规则-协议管理-更新数据','sql',NULL,'{\"table\": \"_resource\", \"operation\": \"jhUpdate\"}','{\"appData\": {\"appId\": \"demo_advanced\", \"where\": {\"id\": 135}, \"pageId\": \"{{pageId}}\", \"actionId\": \"updateItemOfResource\", \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36\", \"actionData\": {\"desc\": null, \"role\": \"teacher\", \"user\": \"test1\", \"group\": \"adminGroup\", \"resource\": null, \"operation\": \"jhInsert\", \"allowOrDeny\": null, \"operationAt\": \"2022-04-28T15:56:55+08:00\", \"operationByUser\": \"admin\", \"operationByUserId\": \"admin\"}}, \"packageId\": \"1651132659186_7090121\", \"packageType\": \"httpRequest\"}','{\"status\": \"success\", \"appData\": {\"rows\": 1, \"appId\": \"demo_advanced\", \"pageId\": \"{{pageId}}\", \"actionId\": \"updateItemOfResource\", \"resultData\": {\"rows\": 1}}, \"packageId\": \"1651132659186_7090121\", \"timestamp\": \"2022-04-28T15:57:40+08:00\", \"packageType\": \"httpResponse\"}','update',NULL,NULL,'2022-04-28T15:57:40+08:00' FROM DUAL WHERE NOT EXISTS (SELECT `pageId` FROM `_resource` WHERE `pageId`='{{pageId}}' AND `actionId`='updateItemOfResource');
INSERT INTO `_resource` (`accessControlTable`,`resourceHook`,`pageId`,`actionId`,`desc`,`resourceType`,`appDataSchema`,`resourceData`,`requestDemo`,`responseDemo`,`operation`,`operationByUserId`,`operationByUser`,`operationAt`) SELECT NULL,NULL,'{{pageId}}','deleteItemOfResource','✅权限规则-协议管理-删除数据','sql',NULL,'{\"table\": \"_resource\", \"operation\": \"jhDelete\"}','{\"appData\": {\"appId\": \"demo_advanced\", \"where\": {\"id\": 135}, \"pageId\": \"{{pageId}}\", \"actionId\": \"deleteItemOfResource\", \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36\", \"actionData\": {}}, \"packageId\": \"1651132665386_5150635\", \"packageType\": \"httpRequest\"}','{\"status\": \"success\", \"appData\": {\"rows\": 1, \"appId\": \"demo_advanced\", \"pageId\": \"{{pageId}}\", \"actionId\": \"deleteItemOfResource\", \"resultData\": {\"rows\": 1}}, \"packageId\": \"1651132665386_5150635\", \"timestamp\": \"2022-04-28T15:57:46+08:00\", \"packageType\": \"httpResponse\"}','update',NULL,NULL,'2022-04-28T15:57:46+08:00' FROM DUAL WHERE NOT EXISTS (SELECT `pageId` FROM `_resource` WHERE `pageId`='{{pageId}}' AND `actionId`='deleteItemOfResource');
INSERT INTO `_resource` (`accessControlTable`,`resourceHook`,`pageId`,`actionId`,`desc`,`resourceType`,`appDataSchema`,`resourceData`,`requestDemo`,`responseDemo`,`operation`,`operationByUserId`,`operationByUser`,`operationAt`) SELECT NULL,NULL,'{{pageId}}','insertItemOfPage','✅权限规则-页面管理-插入信息','sql',NULL,'{\"table\": \"_page\", \"operation\": \"jhInsert\"}','{}','{}','update',NULL,NULL,'2022-02-18T20:42:26+08:00' FROM DUAL WHERE NOT EXISTS (SELECT `pageId` FROM `_resource` WHERE `pageId`='{{pageId}}' AND `actionId`='insertItemOfPage');
INSERT INTO `_resource` (`accessControlTable`,`resourceHook`,`pageId`,`actionId`,`desc`,`resourceType`,`appDataSchema`,`resourceData`,`requestDemo`,`responseDemo`,`operation`,`operationByUserId`,`operationByUser`,`operationAt`) SELECT NULL,NULL,'{{pageId}}','selectItemListOfPage','✅权限规则-页面管理-查询数据列表','sql',NULL,'{\"table\": \"_page\", \"operation\": \"select\"}','{\"appData\": {\"appId\": \"demo_advanced\", \"pageId\": \"{{pageId}}\", \"actionId\": \"selectItemListOfPage\", \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36\", \"actionData\": {}}, \"packageId\": \"1651476257198_8401031\", \"packageType\": \"httpRequest\"}','{\"status\": \"success\", \"packageId\": \"1651476257198_8401031\", \"timestamp\": \"2022-05-02T15:24:17+08:00\", \"packageType\": \"httpResponse\"}','update',NULL,NULL,'2022-05-02T15:24:17+08:00' FROM DUAL WHERE NOT EXISTS (SELECT `pageId` FROM `_resource` WHERE `pageId`='{{pageId}}' AND `actionId`='selectItemListOfPage');
INSERT INTO `_resource` (`accessControlTable`,`resourceHook`,`pageId`,`actionId`,`desc`,`resourceType`,`appDataSchema`,`resourceData`,`requestDemo`,`responseDemo`,`operation`,`operationByUserId`,`operationByUser`,`operationAt`) SELECT NULL,NULL,'{{pageId}}','updateItemOfPage','✅权限规则-页面管理-更新数据','sql',NULL,'{\"table\": \"_page\", \"operation\": \"jhUpdate\"}','{}','{}','update',NULL,NULL,'2022-02-18T20:42:44+08:00' FROM DUAL WHERE NOT EXISTS (SELECT `pageId` FROM `_resource` WHERE `pageId`='{{pageId}}' AND `actionId`='updateItemOfPage');
INSERT INTO `_resource` (`accessControlTable`,`resourceHook`,`pageId`,`actionId`,`desc`,`resourceType`,`appDataSchema`,`resourceData`,`requestDemo`,`responseDemo`,`operation`,`operationByUserId`,`operationByUser`,`operationAt`) SELECT NULL,NULL,'{{pageId}}','deleteItemOfPage','✅权限规则-页面管理-删除数据','sql',NULL,'{\"table\": \"_page\", \"operation\": \"jhDelete\"}','{}','{}','update',NULL,NULL,'2022-02-18T20:42:49+08:00' FROM DUAL WHERE NOT EXISTS (SELECT `pageId` FROM `_resource` WHERE `pageId`='{{pageId}}' AND `actionId`='deleteItemOfPage');
INSERT INTO `_resource` (`accessControlTable`,`resourceHook`,`pageId`,`actionId`,`desc`,`resourceType`,`appDataSchema`,`resourceData`,`requestDemo`,`responseDemo`,`operation`,`operationByUserId`,`operationByUser`,`operationAt`) SELECT NULL,NULL,'{{pageId}}','selectGroup','✅权限规则管理-查询群组','sql',NULL,'{\"table\": \"_group\", \"operation\": \"select\"}','{\"appData\": {\"appId\": \"demo_advanced\", \"pageId\": \"{{pageId}}\", \"actionId\": \"selectGroup\", \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36\", \"actionData\": {}}, \"packageId\": \"1651132653218_7193722\", \"packageType\": \"httpRequest\"}','{\"status\": \"success\", \"appData\": {\"rows\": [{\"id\": 1, \"groupId\": \"adminGroup\", \"groupDesc\": \"Ã§Â®Â¡Ã§ÂÂÃ§Â»Â\", \"groupName\": \"Ã§Â®Â¡Ã§ÂÂÃ§Â»Â\", \"operation\": \"jhUpdate\", \"groupAvatar\": null, \"groupExtend\": \"{}\", \"operationAt\": \"2022-02-18T20:45:25+08:00\", \"operationByUser\": \"admin\", \"operationByUserId\": \"admin\"}], \"appId\": \"demo_advanced\", \"pageId\": \"{{pageId}}\", \"actionId\": \"selectGroup\", \"resultData\": {\"rows\": [{\"id\": 1, \"groupId\": \"adminGroup\", \"groupDesc\": \"Ã§Â®Â¡Ã§ÂÂÃ§Â»Â\", \"groupName\": \"Ã§Â®Â¡Ã§ÂÂÃ§Â»Â\", \"operation\": \"jhUpdate\", \"groupAvatar\": null, \"groupExtend\": \"{}\", \"operationAt\": \"2022-02-18T20:45:25+08:00\", \"operationByUser\": \"admin\", \"operationByUserId\": \"admin\"}]}}, \"packageId\": \"1651132653218_7193722\", \"timestamp\": \"2022-04-28T15:57:34+08:00\", \"packageType\": \"httpResponse\"}','update',NULL,NULL,'2022-04-28T15:57:34+08:00' FROM DUAL WHERE NOT EXISTS (SELECT `pageId` FROM `_resource` WHERE `pageId`='{{pageId}}' AND `actionId`='selectGroup');
INSERT INTO `_resource` (`accessControlTable`,`resourceHook`,`pageId`,`actionId`,`desc`,`resourceType`,`appDataSchema`,`resourceData`,`requestDemo`,`responseDemo`,`operation`,`operationByUserId`,`operationByUser`,`operationAt`) SELECT NULL,NULL,'{{pageId}}','selectRole','✅权限规则管理-查询角色','sql',NULL,'{\"table\": \"_role\", \"operation\": \"select\"}','{\"appData\": {\"appId\": \"demo_advanced\", \"pageId\": \"{{pageId}}\", \"actionId\": \"selectRole\", \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36\", \"actionData\": {}}, \"packageId\": \"1651132653218_5843860\", \"packageType\": \"httpRequest\"}','{\"status\": \"success\", \"appData\": {\"rows\": [{\"id\": 1, \"roleId\": \"appAdmin\", \"roleDesc\": null, \"roleName\": \"Ã§Â³Â»Ã§Â»ÂÃ§Â®Â¡Ã§ÂÂÃ¥ÂÂ\", \"operation\": null, \"operationAt\": null, \"operationByUser\": null, \"operationByUserId\": null}, {\"id\": 2, \"roleId\": \"teacher\", \"roleDesc\": null, \"roleName\": \"Ã¨ÂÂÃ¥Â¸Â\", \"operation\": null, \"operationAt\": null, \"operationByUser\": null, \"operationByUserId\": null}, {\"id\": 3, \"roleId\": \"student\", \"roleDesc\": null, \"roleName\": \"Ã¥Â­Â¦Ã§ÂÂ\", \"operation\": null, \"operationAt\": null, \"operationByUser\": null, \"operationByUserId\": null}], \"appId\": \"demo_advanced\", \"pageId\": \"{{pageId}}\", \"actionId\": \"selectRole\", \"resultData\": {\"rows\": [{\"id\": 1, \"roleId\": \"appAdmin\", \"roleDesc\": null, \"roleName\": \"Ã§Â³Â»Ã§Â»ÂÃ§Â®Â¡Ã§ÂÂÃ¥ÂÂ\", \"operation\": null, \"operationAt\": null, \"operationByUser\": null, \"operationByUserId\": null}, {\"id\": 2, \"roleId\": \"teacher\", \"roleDesc\": null, \"roleName\": \"Ã¨ÂÂÃ¥Â¸Â\", \"operation\": null, \"operationAt\": null, \"operationByUser\": null, \"operationByUserId\": null}, {\"id\": 3, \"roleId\": \"student\", \"roleDesc\": null, \"roleName\": \"Ã¥Â­Â¦Ã§ÂÂ\", \"operation\": null, \"operationAt\": null, \"operationByUser\": null, \"operationByUserId\": null}]}}, \"packageId\": \"1651132653218_5843860\", \"timestamp\": \"2022-04-28T15:57:34+08:00\", \"packageType\": \"httpResponse\"}','update',NULL,NULL,'2022-04-28T15:57:34+08:00' FROM DUAL WHERE NOT EXISTS (SELECT `pageId` FROM `_resource` WHERE `pageId`='{{pageId}}' AND `actionId`='selectRole');
INSERT INTO `_resource` (`accessControlTable`,`resourceHook`,`pageId`,`actionId`,`desc`,`resourceType`,`appDataSchema`,`resourceData`,`requestDemo`,`responseDemo`,`operation`,`operationByUserId`,`operationByUser`,`operationAt`) SELECT NULL,NULL,'{{pageId}}','selectResourceList','✅权限规则-查询协议列表','sql',NULL,'{\"table\": \"_resource\", \"operation\": \"select\"}','{\"appData\": {\"appId\": \"demo_advanced\", \"pageId\": \"{{pageId}}\", \"actionId\": \"selectResourceList\", \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36\", \"actionData\": {}}, \"packageId\": \"1651132653218_4465402\", \"packageType\": \"httpRequest\"}','{\"status\": \"success\", \"packageId\": \"1651132653218_4465402\", \"timestamp\": \"2022-04-28T15:57:34+08:00\", \"packageType\": \"httpResponse\"}','update',NULL,NULL,'2022-04-28T15:57:34+08:00' FROM DUAL WHERE NOT EXISTS (SELECT `pageId` FROM `_resource` WHERE `pageId`='{{pageId}}' AND `actionId`='selectResourceList');
INSERT INTO `_resource` (`accessControlTable`,`resourceHook`,`pageId`,`actionId`,`desc`,`resourceType`,`appDataSchema`,`resourceData`,`requestDemo`,`responseDemo`,`operation`,`operationByUserId`,`operationByUser`,`operationAt`) SELECT NULL,NULL,'{{pageId}}','selectPageList','✅权限规则-查询页面列表','sql',NULL,'{\"table\": \"_page\", \"operation\": \"select\"}','{\"appData\": {\"appId\": \"demo_advanced\", \"pageId\": \"{{pageId}}\", \"actionId\": \"selectPageList\", \"userAgent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36\", \"actionData\": {}}, \"packageId\": \"1651132653218_4381466\", \"packageType\": \"httpRequest\"}','{\"status\": \"success\", \"packageId\": \"1651132653218_4381466\", \"timestamp\": \"2022-04-28T15:57:34+08:00\", \"packageType\": \"httpResponse\"}','update',NULL,NULL,'2022-04-28T15:57:34+08:00' FROM DUAL WHERE NOT EXISTS (SELECT `pageId` FROM `_resource` WHERE `pageId`='{{pageId}}' AND `actionId`='selectPageList');