diff --git a/database.sql b/database.sql index 14d790ec..6ea2c2b1 100644 --- a/database.sql +++ b/database.sql @@ -671,23 +671,23 @@ END; -- 编写人:沈佳龙 (www.roncoo.com) -- -- ----------------------------------------------------------------------------------------------------------------------------------- -drop table if exists PMS_MENU; +drop table if exists pms_menu; -drop table if exists PMS_MENU_ROLE; +drop table if exists pms_menu_role; -drop table if exists PMS_OPERATOR; +drop table if exists pms_operator; -drop table if exists PMS_OPERATOR_LOG; +drop table if exists pms_operator_log; -drop table if exists PMS_PERMISSION; +drop table if exists pms_permission; -drop table if exists PMS_ROLE; +drop table if exists pms_role; -drop table if exists PMS_ROLE_OPERATOR; +drop table if exists pms_role_operator; -drop table if exists PMS_ROLE_PERMISSION; +drop table if exists pms_role_permission; -create table PMS_MENU +create table pms_menu ( id bigint not null auto_increment, version bigint not null, @@ -707,12 +707,12 @@ create table PMS_MENU primary key (id) )auto_increment = 1000; -alter table PMS_MENU comment '菜单表'; +alter table pms_menu comment '菜单表'; -alter table PMS_MENU comment '菜单表'; +alter table pms_menu comment '菜单表'; -create table PMS_MENU_ROLE +create table pms_menu_role ( id bigint not null auto_increment comment '主键', version bigint, @@ -725,12 +725,12 @@ create table PMS_MENU_ROLE role_id bigint not null, menu_id bigint not null, primary key (id), - key AK_KEY_2 (role_id, menu_id) + key ak_key_2 (role_id, menu_id) ) auto_increment = 1000; -alter table PMS_MENU_ROLE comment '权限与角色关联表'; +alter table pms_menu_role comment '权限与角色关联表'; -create table PMS_OPERATOR +create table pms_operator ( id bigint not null auto_increment comment '主键', version bigint not null, @@ -747,12 +747,12 @@ create table PMS_OPERATOR type varchar(20) not null, salt varchar(50) not null, primary key (id), - key AK_KEY_2 (login_name) + key ak_key_2 (login_name) ) auto_increment = 1000; -alter table PMS_OPERATOR comment '操作员表'; +alter table pms_operator comment '操作员表'; -create table PMS_OPERATOR_LOG +create table pms_operator_log ( id bigint not null auto_increment comment '主键', version bigint not null, @@ -770,9 +770,9 @@ create table PMS_OPERATOR_LOG primary key (id) ) auto_increment = 1000; -alter table PMS_OPERATOR_LOG comment '权限_操作员操作日志表'; +alter table pms_operator_log comment '权限_操作员操作日志表'; -create table PMS_PERMISSION +create table pms_permission ( id bigint not null auto_increment comment '主键', version bigint not null, @@ -785,13 +785,13 @@ create table PMS_PERMISSION permission_name varchar(100) not null, permission varchar(100) not null, primary key (id), - key AK_KEY_2 (permission), - key AK_KEY_3 (permission_name) + key ak_key_2 (permission), + key ak_key_3 (permission_name) ) auto_increment = 1000; -alter table PMS_PERMISSION comment '权限表'; +alter table pms_permission comment '权限表'; -create table PMS_ROLE +create table pms_role ( id bigint not null auto_increment comment '主键', version bigint, @@ -804,12 +804,12 @@ create table PMS_ROLE role_code varchar(20) not null comment '角色类型(1:超级管理员角色,0:普通操作员角色)', role_name varchar(100) not null, primary key (id), - key AK_KEY_2 (role_name) + key ak_key_2 (role_name) ) auto_increment = 1000; -alter table PMS_ROLE comment '角色表'; +alter table pms_role comment '角色表'; -create table PMS_ROLE_OPERATOR +create table pms_role_operator ( id bigint not null auto_increment comment '主键', version bigint not null, @@ -822,12 +822,12 @@ create table PMS_ROLE_OPERATOR role_id bigint not null, operator_id bigint not null, primary key (id), - key AK_KEY_2 (role_id, operator_id) + key ak_key_2 (role_id, operator_id) ) auto_increment = 1000; -alter table PMS_ROLE_OPERATOR comment '操作员与角色关联表'; +alter table pms_role_operator comment '操作员与角色关联表'; -create table PMS_ROLE_PERMISSION +create table pms_role_permission ( id bigint not null auto_increment comment '主键', version bigint, @@ -840,10 +840,10 @@ create table PMS_ROLE_PERMISSION role_id bigint not null, permission_id bigint not null, primary key (id), - key AK_KEY_2 (role_id, permission_id) + key ak_key_2 (role_id, permission_id) ) auto_increment = 1000; -alter table PMS_ROLE_PERMISSION comment '权限与角色关联表'; +alter table pms_role_permission comment '权限与角色关联表'; @@ -852,7 +852,7 @@ alter table PMS_ROLE_PERMISSION comment '权限与角色关联表'; -- ------------------------------step 1 菜单------------------------------------------------- -- 菜单初始化数据 -- -- 菜单的初始化数据 -INSERT INTO PMS_MENU (id,version,status,creater,create_time, editor, edit_time, remark, NAME, URL, NUMBER, IS_LEAF, LEVEL, PARENT_ID, TARGET_NAME) VALUES +insert into pms_menu (id,version,status,creater,create_time, editor, edit_time, remark, name, url, number, is_leaf, level, parent_id, target_name) values (1,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '权限管理', '##', '001', 'NO', 1, 0, '#'), (2,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '菜单管理', 'pms/menu/list', '00101', 'YES', 2, 1, 'cdgl'), (3,0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '', '权限管理', 'pms/permission/list', '00102', 'YES',2, 1, 'qxgl'), @@ -887,7 +887,7 @@ INSERT INTO PMS_MENU (id,version,status,creater,create_time, editor, edit_time, -- 权限功能点的初始化数据 -insert into PMS_PERMISSION (id,version,status,creater,create_time, editor, edit_time, remark, permission_name, permission) values +insert into pms_permission (id,version,status,creater,create_time, editor, edit_time, remark, permission_name, permission) values (1, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-菜单-查看','权限管理-菜单-查看','pms:menu:view'), (2, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-菜单-添加','权限管理-菜单-添加','pms:menu:add'), (3, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','权限管理-菜单-查看','权限管理-菜单-修改','pms:menu:edit'), @@ -971,40 +971,40 @@ insert into PMS_PERMISSION (id,version,status,creater,create_time, editor, edit_ -- -----------------------------------step3:操作员-------------------------------------------- -- -- 操作员的初始化数据 -- admin 超级管理员 -insert into PMS_OPERATOR (id,version,status,creater,create_time, editor, edit_time, remark, login_name, login_pwd,real_name,mobile_no,type,salt) +insert into pms_operator (id,version,status,creater,create_time, editor, edit_time, remark, login_name, login_pwd,real_name,mobile_no,type,salt) values (1, 0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'admin','2016-06-03 11:07:43', '超级管理员', 'admin', 'd3c59d25033dbf980d29554025c23a75','超级管理员', '18620936193', 'ADMIN','8d78869f470951332959580424d4bf4f'); -- guest 游客 -insert into PMS_OPERATOR (id,version,status,creater,create_time, editor, edit_time, remark, login_name, login_pwd,real_name,mobile_no,type,salt) +insert into pms_operator (id,version,status,creater,create_time, editor, edit_time, remark, login_name, login_pwd,real_name,mobile_no,type,salt) values (2, 0, 'ACTIVE','roncoo','2016-06-03 11:07:43', 'guest','2016-06-03 11:07:43', '游客', 'guest', '3f0dbf580ee39ec03b632cb33935a363','游客', '18926215592', 'USER','183d9f2f0f2ce760e98427a5603d1c73'); -- ------------------------------------step4:角色------------------------------------------- -- -- 角色的初始化数据 -insert into PMS_ROLE (id,version,status,creater,create_time, editor, edit_time, remark, role_code, role_name) +insert into pms_role (id,version,status,creater,create_time, editor, edit_time, remark, role_code, role_name) values (1, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'admin', '2016-06-03 11:07:43','超级管理员角色','admin', '超级管理员角色'); -insert into PMS_ROLE (id,version,status,creater,create_time, editor, edit_time, remark, role_code, role_name) +insert into pms_role (id,version,status,creater,create_time, editor, edit_time, remark, role_code, role_name) values (2, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'guest', '2016-06-03 11:07:43','游客角色','guest', '游客角色'); -- ------------------------------------step5:操作员和角色关联------------------------------------------- -- -- 操作员与角色关联的初始化数据 -- admin 关联admin 和test两个角色 -insert into PMS_ROLE_OPERATOR (id,version,status,creater,create_time, editor, edit_time, remark,role_id,operator_id) values (1, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',1,1); -insert into PMS_ROLE_OPERATOR (id,version,status,creater,create_time, editor, edit_time, remark,role_id,operator_id) values (2, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,1); +insert into pms_role_operator (id,version,status,creater,create_time, editor, edit_time, remark,role_id,operator_id) values (1, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',1,1); +insert into pms_role_operator (id,version,status,creater,create_time, editor, edit_time, remark,role_id,operator_id) values (2, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,1); -- guest 关联游客角色 (游客角色只有查看交易记录的信息) -insert into PMS_ROLE_OPERATOR (id,version,status,creater,create_time, editor, edit_time, remark,role_id,operator_id) values (3, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,2); +insert into pms_role_operator (id,version,status,creater,create_time, editor, edit_time, remark,role_id,operator_id) values (3, 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,2); -- -------------------------------------step6:角色和权限关联------------------------------------------ -- -- 角色与用户功能点关联的初始化数据 -- admin(拥有所有的权限点) -insert into PMS_ROLE_PERMISSION (role_id, permission_id) select 1,id from PMS_PERMISSION; +insert into pms_role_permission (role_id, permission_id) select 1,id from PMS_PERMISSION; -- guest (只有所有的查看权限) -insert into PMS_ROLE_PERMISSION (version,status,creater,create_time, editor, edit_time, remark,role_id,permission_id) +insert into pms_role_permission (version,status,creater,create_time, editor, edit_time, remark,role_id,permission_id) values ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,1), ( 0,'ACTIVE', 'roncoo','2016-06-03 11:07:43', 'test', '2016-06-03 11:07:43','',2,11), @@ -1028,10 +1028,10 @@ values -- 角色与信息关联初始化数据 -- admin -insert into PMS_MENU_ROLE(role_id, menu_id) select 1,id from PMS_MENU; +insert into pms_menu_role(role_id, menu_id) select 1,id from PMS_MENU; -- guest 所有的菜单(只有查看权限) -insert into PMS_MENU_ROLE (role_id, menu_id) select 2,id from PMS_MENU; +insert into pms_menu_role (role_id, menu_id) select 2,id from PMS_MENU; -- 2016.8.5 第三方支付信息表增加支付宝线下产品字段 alter table rp_user_pay_info add offline_app_id varchar(50);