-- 创建 resource
INSERT INTO `_resource` (`accessControlTable`,`resourceHook`,`pageId`,`actionId`,`desc`,`resourceType`,`appDataSchema`,`resourceData`,`requestDemo`,`responseDemo`,`operation`,`operationByUserId`,`operationByUser`,`operationAt`) SELECT NULL,NULL,'{{pageId}}-{{templateName}}','selectItemList','✅查询当前{{nameA}}下的{{nameB}}列表','sql','{}','{ \"table\": \"{{tableB}}\", \"operation\": \"select\" }',NULL,NULL,'jhInsert','jianghu-init',NULL,NULL FROM DUAL WHERE NOT EXISTS (SELECT `pageId` FROM `_resource` WHERE `pageId`='{{pageId}}-{{templateName}}' AND `actionId`='selectItemList');
INSERT INTO `_resource` (`accessControlTable`,`resourceHook`,`pageId`,`actionId`,`desc`,`resourceType`,`appDataSchema`,`resourceData`,`requestDemo`,`responseDemo`,`operation`,`operationByUserId`,`operationByUser`,`operationAt`) SELECT NULL,NULL,'{{pageId}}-{{templateName}}','insertItem','✅建立关系','sql','{}','{ \"table\": \"{{tableB}}\", \"operation\": \"jhInsert\" }',NULL,NULL,'jhInsert','jianghu-init',NULL,NULL FROM DUAL WHERE NOT EXISTS (SELECT `pageId` FROM `_resource` WHERE `pageId`='{{pageId}}-{{templateName}}' AND `actionId`='insertItem');
INSERT INTO `_resource` (`accessControlTable`,`resourceHook`,`pageId`,`actionId`,`desc`,`resourceType`,`appDataSchema`,`resourceData`,`requestDemo`,`responseDemo`,`operation`,`operationByUserId`,`operationByUser`,`operationAt`) SELECT NULL,NULL,'{{pageId}}-{{templateName}}','updateItem','✅更新数据','sql','{}','{ \"table\": \"{{tableB}}\", \"operation\": \"jhUpdate\" }',NULL,NULL,'jhInsert','jianghu-init',NULL,NULL FROM DUAL WHERE NOT EXISTS (SELECT `pageId` FROM `_resource` WHERE `pageId`='{{pageId}}-{{templateName}}' AND `actionId`='updateItem');
INSERT INTO `_resource` (`accessControlTable`,`resourceHook`,`pageId`,`actionId`,`desc`,`resourceType`,`appDataSchema`,`resourceData`,`requestDemo`,`responseDemo`,`operation`,`operationByUserId`,`operationByUser`,`operationAt`) SELECT NULL,NULL,'{{pageId}}-{{templateName}}','deleteItem','✅删除信息','sql','{}','{ \"table\": \"{{tableB}}\", \"operation\": \"jhDelete\" }',NULL,NULL,'jhInsert','jianghu-init',NULL,NULL FROM DUAL WHERE NOT EXISTS (SELECT `pageId` FROM `_resource` WHERE `pageId`='{{pageId}}-{{templateName}}' AND `actionId`='deleteItem');