kingtoolapi

  

 

 

 

 

 

 

 

 

 

 

 

 

练习sql

--菜单目录结构表
create table tb_menu(
 id number(10) not null, --主键id
title varchar2(50), --标题
 parent number(10) --parent id
)
 
--父菜单
insert into tb_menu(id, title, parent) values(1, '父菜单1',null);
insert into tb_menu(id, title, parent) values(2, '父菜单2',null);
insert into tb_menu(id, title, parent) values(3, '父菜单3',null);
insert into tb_menu(id, title, parent) values(4, '父菜单4',null);
insert into tb_menu(id, title, parent) values(5, '父菜单5',null);
--一级菜单
insert into tb_menu(id, title, parent) values(6, '一级菜单6',1);
insert into tb_menu(id, title, parent) values(7, '一级菜单7',1);
insert into tb_menu(id, title, parent) values(8, '一级菜单8',1);
insert into tb_menu(id, title, parent) values(9, '一级菜单9',2);
insert into tb_menu(id, title, parent) values(10, '一级菜单10',2);
insert into tb_menu(id, title, parent) values(11, '一级菜单11',2);
insert into tb_menu(id, title, parent) values(12, '一级菜单12',3);
insert into tb_menu(id, title, parent) values(13, '一级菜单13',3);
insert into tb_menu(id, title, parent) values(14, '一级菜单14',3);
insert into tb_menu(id, title, parent) values(15, '一级菜单15',4);
insert into tb_menu(id, title, parent) values(16, '一级菜单16',4);
insert into tb_menu(id, title, parent) values(17, '一级菜单17',4);
insert into tb_menu(id, title, parent) values(18, '一级菜单18',5);
insert into tb_menu(id, title, parent) values(19, '一级菜单19',5);
insert into tb_menu(id, title, parent) values(20, '一级菜单20',5);
--二级菜单
insert into tb_menu(id, title, parent) values(21, '二级菜单21',6);
insert into tb_menu(id, title, parent) values(22, '二级菜单22',6);
insert into tb_menu(id, title, parent) values(23, '二级菜单23',7);
insert into tb_menu(id, title, parent) values(24, '二级菜单24',7);
insert into tb_menu(id, title, parent) values(25, '二级菜单25',8);
insert into tb_menu(id, title, parent) values(26, '二级菜单26',9);
insert into tb_menu(id, title, parent) values(27, '二级菜单27',10);
insert into tb_menu(id, title, parent) values(28, '二级菜单28',11);
insert into tb_menu(id, title, parent) values(29, '二级菜单29',12);
insert into tb_menu(id, title, parent) values(30, '二级菜单30',13);
insert into tb_menu(id, title, parent) values(31, '二级菜单31',14);
insert into tb_menu(id, title, parent) values(32, '二级菜单32',15);
insert into tb_menu(id, title, parent) values(33, '二级菜单33',16);
insert into tb_menu(id, title, parent) values(34, '二级菜单34',17);
insert into tb_menu(id, title, parent) values(35, '二级菜单35',18);
insert into tb_menu(id, title, parent) values(36, '二级菜单36',19);
insert into tb_menu(id, title, parent) values(37, '二级菜单37',20);
--三级菜单
insert into tb_menu(id, title, parent) values(38, '三级菜单38',21);
insert into tb_menu(id, title, parent) values(39, '三级菜单39',22);
insert into tb_menu(id, title, parent) values(40, '三级菜单40',23);
insert into tb_menu(id, title, parent) values(41, '三级菜单41',24);
insert into tb_menu(id, title, parent) values(42, '三级菜单42',25);
insert into tb_menu(id, title, parent) values(43, '三级菜单43',26);
insert into tb_menu(id, title, parent) values(44, '三级菜单44',27);
insert into tb_menu(id, title, parent) values(45, '三级菜单45',28);
insert into tb_menu(id, title, parent) values(46, '三级菜单46',28);
insert into tb_menu(id, title, parent) values(47, '三级菜单47',29);
insert into tb_menu(id, title, parent) values(48, '三级菜单48',30);
insert into tb_menu(id, title, parent) values(49, '三级菜单49',31);
insert into tb_menu(id, title, parent) values(50, '三级菜单50',31);
commit;
 
select * from tb_menu;
View Code

 

 

 

语句

--api maybe not need use


DROP TABLE web_api_title;
DROP TABLE web_api_title_desc;
DROP TABLE web_api_node;
DROP TABLE web_api_node_deft;

--title 
CREATE table web_api_title(
c_id VARCHAR2(50) not null, --主键id
c_title VARCHAR2(50), --标题
c_level VARCHAR2(50) NOT NULL,-- 级别
c_parent_id varchar2(50) NOT NULL,--父级 title id
c_belong varchar2(50) --归属于哪个文档
);
 
--title desc
CREATE table web_api_title_desc(
c_id VARCHAR2(50) not null, --主键id
c_title_id VARCHAR2(50), --title id
c_title_desc VARCHAR2(50) NOT NULL
);
--  node 

CREATE table web_api_node(
c_id         VARCHAR2(50) NOT NULL , --主键id
c_name VARCHAR2(50) NOT NULL, --节点名
c_cn VARCHAR2(50) NOT NULL,--节点中文名
c_type VARCHAR2(50) NOT NULL ,--类型
c_example VARCHAR2(50) NOT NULL ,--样例
c_title_id VARCHAR2(50) NOT NULL --标题id
);


-- node_deft
CREATE table web_api_node_deft(
c_id varchar2(50) not null, --主键id
c_sys_name VARCHAR2(50)  DEFAULT 'default' NOT NULL,--系统名, 默认 default 
c_must_flag varchar2(50) NOT NULL,--必传标志 Y N C
c_deft VARCHAR2(50)  DEFAULT '-' NOT NULL,
c_node_id varchar2(50) NOT NULL -- node id
);




--父菜单
insert into web_api_title(c_id, c_title,c_level,c_parent_id,c_belong) values(0, '车承保API接口文档','0','-1','api');
insert into web_api_title(c_id, c_title,c_level,c_parent_id,c_belong) values(1, '主接口','1','0','api');
insert into web_api_title(c_id, c_title,c_level,c_parent_id,c_belong) values(2, '商业险投保查询','2','1','api');
insert into web_api_title(c_id, c_title,c_level,c_parent_id,c_belong) values(31, '请求数据','3','2','api');
insert into web_api_title(c_id, c_title,c_level,c_parent_id,c_belong) values(311, '基本信息','4','31','api');
insert into web_api_title(c_id, c_title,c_level,c_parent_id,c_belong) values(32, '返回数据','3','2','api');
insert into web_api_title(c_id, c_title,c_level,c_parent_id,c_belong) values(321, '车辆信息','4','32','api');


insert into web_api_title_desc(c_id, c_title_id,c_title_desc) values(1, '2','给些险别信息,返回些系数');

insert into web_api_node(c_id, c_name,c_cn,c_type,c_example,c_title_id) values(1, 'ply_name','投保人姓名','varchar2(50)','投保人A','311');
insert into web_api_node(c_id, c_name,c_cn,c_type,c_example,c_title_id) values(2, 'insured_name','被保人姓名','varchar2(50)','被保人A','311');

insert into web_api_node_deft(c_id, c_sys_name,c_must_flag,c_deft,c_node_id) values(1, 'default','Y','','1');
insert into web_api_node_deft(c_id, c_sys_name,c_must_flag,c_deft,c_node_id) values(2, '网销','Y','','1');
insert into web_api_node_deft(c_id, c_sys_name,c_must_flag,c_deft,c_node_id) values(3, 'default','Y','','1');

 

posted @ 2017-04-09 22:53  苦涩泪滴  阅读(108)  评论(0编辑  收藏  举报