shuzheng 9 лет назад
Родитель
Сommit
4d307d5da5
19 измененных файлов с 5191 добавлено и 1011 удалено
  1. 0 39
      project-datamodel/upms_system.sql
  2. 0 40
      project-datamodel/upms_user.sql
  3. 3781 0
      project-datamodel/zheng.apm
  4. 187 134
      project-datamodel/zheng.pdb
  5. 187 134
      project-datamodel/zheng.pdm
  6. BIN
      project-datamodel/zheng.png
  7. 625 629
      project-datamodel/zheng.sql
  8. 20 5
      zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/mapper/UpmsOrganizationMapper.xml
  9. 22 5
      zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/mapper/UpmsPermissionMapper.xml
  10. 7 7
      zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/mapper/UpmsSystemMapper.xml
  11. 18 3
      zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/mapper/UpmsUserMapper.xml
  12. 39 1
      zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/model/UpmsOrganization.java
  13. 60 0
      zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/model/UpmsOrganizationExample.java
  14. 29 1
      zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/model/UpmsPermission.java
  15. 70 0
      zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/model/UpmsPermissionExample.java
  16. 3 3
      zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/model/UpmsSystem.java
  17. 10 10
      zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/model/UpmsSystemExample.java
  18. 73 0
      zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/model/UpmsUser.java
  19. 60 0
      zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/model/UpmsUserExample.java

+ 0 - 39
project-datamodel/upms_system.sql

@@ -1,39 +0,0 @@
-/*
-Navicat MySQL Data Transfer
-
-Source Server         : localhost
-Source Server Version : 50621
-Source Host           : localhost:3306
-Source Database       : zheng
-
-Target Server Type    : MYSQL
-Target Server Version : 50621
-File Encoding         : 65001
-
-Date: 2017-01-19 21:07:06
-*/
-
-SET FOREIGN_KEY_CHECKS=0;
-
--- ----------------------------
--- Table structure for upms_system
--- ----------------------------
-DROP TABLE IF EXISTS `upms_system`;
-CREATE TABLE `upms_system` (
-  `system_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `icon` varchar(20) DEFAULT NULL,
-  `basepath` varchar(100) DEFAULT NULL,
-  `status` smallint(6) DEFAULT NULL,
-  `name` varchar(20) DEFAULT NULL,
-  `ctime` bigint(20) DEFAULT NULL,
-  `orders` bigint(20) DEFAULT NULL,
-  PRIMARY KEY (`system_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='系统';
-
--- ----------------------------
--- Records of upms_system
--- ----------------------------
-INSERT INTO `upms_system` VALUES ('1', null, 'http://upms.zhangshuzheng.cn:1113', '1', 'zheng-upms-app1', '1', '1');
-INSERT INTO `upms_system` VALUES ('2', null, 'http://upms.zhangshuzheng.cn:1114', '1', 'zheng-upms-app2', '2', '2');
-INSERT INTO `upms_system` VALUES ('3', null, 'http://cms.zhangshuzheng.cn:2222', '1', 'zheng-cms-admin', '3', '3');
-INSERT INTO `upms_system` VALUES ('4', null, 'http://upms.zhangshuzheng.cn:1111', '1', 'zheng-upms-server', '4', '4');

+ 0 - 40
project-datamodel/upms_user.sql

@@ -1,40 +0,0 @@
-/*
-Navicat MySQL Data Transfer
-
-Source Server         : localhost
-Source Server Version : 50528
-Source Host           : localhost:3306
-Source Database       : zheng
-
-Target Server Type    : MYSQL
-Target Server Version : 50528
-File Encoding         : 65001
-
-Date: 2017-01-20 15:47:44
-*/
-
-SET FOREIGN_KEY_CHECKS=0;
-
--- ----------------------------
--- Table structure for upms_user
--- ----------------------------
-DROP TABLE IF EXISTS `upms_user`;
-CREATE TABLE `upms_user` (
-  `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-  `system_id` int(10) unsigned NOT NULL,
-  `username` varchar(20) NOT NULL,
-  `password` varchar(32) NOT NULL,
-  `salt` varchar(32) DEFAULT NULL,
-  `realname` varchar(20) DEFAULT NULL,
-  `avatar` varchar(50) DEFAULT NULL,
-  `phone` varchar(20) DEFAULT NULL,
-  `email` varchar(50) DEFAULT NULL,
-  `sex` tinyint(4) DEFAULT NULL,
-  `ctime` bigint(20) DEFAULT NULL,
-  PRIMARY KEY (`user_id`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='用户';
-
--- ----------------------------
--- Records of upms_user
--- ----------------------------
-INSERT INTO `upms_user` VALUES ('1', '1', 'admin', '3038D9CB63B3152A79B8153FB06C02F7', '66f1b370c660445a8657bf8bf1794486', '管理员', null, null, null, '1', '1');

Разница между файлами не показана из-за своего большого размера
+ 3781 - 0
project-datamodel/zheng.apm


Разница между файлами не показана из-за своего большого размера
+ 187 - 134
project-datamodel/zheng.pdb


Разница между файлами не показана из-за своего большого размера
+ 187 - 134
project-datamodel/zheng.pdm


BIN
project-datamodel/zheng.png


+ 625 - 629
project-datamodel/zheng.sql

@@ -1,629 +1,625 @@
-/*==============================================================*/
-/* DBMS name:      MySQL 5.0                                    */
-/* Created on:     2017/1/19 21:54:06                           */
-/*==============================================================*/
-
-
-drop table if exists cms_article;
-
-drop table if exists cms_article_category;
-
-drop table if exists cms_article_tag;
-
-drop table if exists cms_book;
-
-drop table if exists cms_category;
-
-drop table if exists cms_category_tag;
-
-drop table if exists cms_comment;
-
-drop table if exists cms_page;
-
-drop table if exists cms_setting;
-
-drop table if exists cms_tag;
-
-drop table if exists cms_user;
-
-drop table if exists pay_in_order;
-
-drop table if exists pay_in_order_detail;
-
-drop table if exists pay_mch;
-
-drop table if exists pay_out_order;
-
-drop table if exists pay_out_order_detail;
-
-drop table if exists pay_pay;
-
-drop table if exists pay_type;
-
-drop table if exists pay_vendor;
-
-drop table if exists pay_vest;
-
-drop table if exists upms_organization;
-
-drop table if exists upms_permission;
-
-drop table if exists upms_role;
-
-drop table if exists upms_role_permission;
-
-drop table if exists upms_system;
-
-drop table if exists upms_user;
-
-drop table if exists upms_user_organization;
-
-drop table if exists upms_user_permission;
-
-drop table if exists upms_user_role;
-
-/*==============================================================*/
-/* Table: cms_article                                           */
-/*==============================================================*/
-create table cms_article
-(
-   article_id           int(10) unsigned not null auto_increment comment '文章编号',
-   title                varchar(200) not null comment '文章标题',
-   author               varchar(50) default NULL comment '文章原作者',
-   fromurl              varchar(300) default NULL comment '转载来源网址',
-   image                varchar(300) default NULL comment '封面图',
-   keywords             varchar(100) default NULL comment '关键字',
-   description          varchar(500) default NULL comment '简介',
-   type                 tinyint(4) not null default 1 comment '类型(1:普通,2:热门...)',
-   allowcomments        tinyint(4) not null default 1 comment '是否允许评论(0:不允许,1:允许)',
-   status               tinyint(4) not null default 1 comment '状态(-1:不通过,0未审核,1:通过)',
-   content              mediumtext comment '内容',
-   user_id              int(10) unsigned not null comment '发布人id',
-   readnumber           int(10) unsigned not null default 0 comment '阅读数量',
-   ctime                bigint(20) unsigned not null comment '创建时间',
-   orders               bigint(20) unsigned not null comment '排序',
-   primary key (article_id),
-   key cms_article_orders (orders)
-)
-ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文章表';
-
-alter table cms_article comment '文章表';
-
-/*==============================================================*/
-/* Table: cms_article_category                                  */
-/*==============================================================*/
-create table cms_article_category
-(
-   article_category_id  int(10) unsigned not null auto_increment comment '编号',
-   article_id           int(10) unsigned not null comment '文章编号',
-   category_id          int(10) unsigned not null comment '类目编号',
-   primary key (article_category_id),
-   key cms_article_category_article_id (article_id),
-   key cms_article_category_category_id (category_id)
-)
-ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文章类目表';
-
-alter table cms_article_category comment '文章类目关联表';
-
-/*==============================================================*/
-/* Table: cms_article_tag                                       */
-/*==============================================================*/
-create table cms_article_tag
-(
-   article_tag_id       int(10) unsigned not null auto_increment comment '编号',
-   article_id           int(10) unsigned not null comment '文章编号',
-   tag_id               int(10) unsigned not null comment '标签编号',
-   primary key (article_tag_id),
-   key cms_article_tag_article_id (article_id),
-   key cms_article_tag_tag_id (tag_id)
-)
-ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文章标签表';
-
-alter table cms_article_tag comment '文章标签关联表';
-
-/*==============================================================*/
-/* Table: cms_book                                              */
-/*==============================================================*/
-create table cms_book
-(
-   book_id              int(10) unsigned not null auto_increment comment '编号',
-   user_id              int(10) unsigned not null comment '用户编号',
-   name                 varchar(45) not null comment '书名',
-   primary key (book_id),
-   key FK_book_1 (user_id)
-)
-ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COMMENT='用户书籍表';
-
-alter table cms_book comment '书';
-
-/*==============================================================*/
-/* Table: cms_category                                          */
-/*==============================================================*/
-create table cms_category
-(
-   category_id          int(10) unsigned not null auto_increment comment '类目编号',
-   pid                  int(10) unsigned comment '上级编号',
-   level                tinyint(4) not null comment '层级',
-   name                 varchar(20) not null comment '名称',
-   description          varchar(200) default NULL comment '描述',
-   icon                 varchar(50) default NULL comment '图标',
-   type                 tinyint(3) not null default 1 comment '类型(1:普通,2:热门...)',
-   alias                varchar(20) default NULL comment '别名',
-   ctime                bigint(20) unsigned not null comment '创建时间',
-   orders               bigint(255) unsigned not null comment '排序',
-   primary key (category_id),
-   key cms_category_orders (orders),
-   key cms_category_pid (pid),
-   key cms_category_alias (alias),
-   key cms_category_level (level)
-)
-ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='类目表';
-
-alter table cms_category comment '类目表';
-
-/*==============================================================*/
-/* Table: cms_category_tag                                      */
-/*==============================================================*/
-create table cms_category_tag
-(
-   category_tag_id      int(10) unsigned not null auto_increment comment '编号',
-   category_id          int(10) unsigned not null comment '类目编号',
-   tag_id               int(10) unsigned not null comment '标签编号',
-   primary key (category_tag_id),
-   key cms_category_tag_tag_id (tag_id),
-   key cms_category_tag_category_id (category_id)
-)
-ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT=' 分类标签表';
-
-alter table cms_category_tag comment '类目标签关联表';
-
-/*==============================================================*/
-/* Table: cms_comment                                           */
-/*==============================================================*/
-create table cms_comment
-(
-   comment_id           int(10) unsigned not null auto_increment comment '编号',
-   pid                  int(10) unsigned default NULL comment '回复楼中楼编号回复楼中楼编号',
-   article_id           int(10) unsigned not null comment '文章编号',
-   user_id              int(10) unsigned not null comment '用户编号',
-   content              text not null comment '评论内容',
-   status               tinyint(4) not null default 1 comment '状态(-1:不通过,0:未审核,1:通过)',
-   ip                   varchar(30) default NULL comment '评论人ip地址',
-   agent                varchar(200) default NULL comment '评论人终端信息',
-   ctime                bigint(20) not null comment '创建时间',
-   primary key (comment_id),
-   key cms_comment_article_id (article_id)
-)
-ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-
-alter table cms_comment comment '评论表';
-
-/*==============================================================*/
-/* Table: cms_page                                              */
-/*==============================================================*/
-create table cms_page
-(
-   page_id              int(10) unsigned not null auto_increment,
-   pid                  int(10),
-   alias                varchar(20),
-   content              mediumtext,
-   keywords             varchar(100),
-   description          varchar(300),
-   ctime                bigint(20),
-   orders               bigint(20),
-   primary key (page_id)
-);
-
-alter table cms_page comment '页面';
-
-/*==============================================================*/
-/* Table: cms_setting                                           */
-/*==============================================================*/
-create table cms_setting
-(
-   setting_id           int(10) unsigned not null auto_increment,
-   setting_key          varchar(10),
-   setting_value        varchar(500),
-   primary key (setting_id)
-);
-
-alter table cms_setting comment '网站配置';
-
-/*==============================================================*/
-/* Table: cms_tag                                               */
-/*==============================================================*/
-create table cms_tag
-(
-   tag_id               int(10) unsigned not null auto_increment comment '标签编号',
-   name                 varchar(20) not null comment '名称',
-   description          varchar(200) default NULL comment '描述',
-   icon                 varchar(50) default NULL comment '图标',
-   type                 tinyint(4) not null default 1 comment '类型(1:普通,2:热门...)',
-   alias                varchar(20) default NULL comment '别名',
-   ctime                bigint(20) unsigned not null comment '创建时间',
-   orders               bigint(20) unsigned not null comment '排序',
-   primary key (tag_id),
-   key cms_tag_orders (orders),
-   key cms_tag_alias (alias)
-)
-ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='标签表';
-
-alter table cms_tag comment '标签表';
-
-/*==============================================================*/
-/* Table: cms_user                                              */
-/*==============================================================*/
-create table cms_user
-(
-   user_id              int(10) unsigned not null auto_increment comment '编号',
-   username             varchar(32) default NULL comment '账号',
-   password             varchar(32) default NULL comment '密码',
-   nickname             varchar(32) default NULL comment '昵称',
-   sex                  int(11) default NULL comment '0未知,1男,2女',
-   ctime                bigint(20) default NULL comment '创建时间',
-   content              text comment '备注',
-   primary key (user_id)
-)
-ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8 COMMENT='用户表';
-
-alter table cms_user comment '用户';
-
-/*==============================================================*/
-/* Table: pay_in_order                                          */
-/*==============================================================*/
-create table pay_in_order
-(
-   pay_in_order_id      int(10) unsigned not null auto_increment,
-   pay_vendor_id        int(10),
-   pay_mch_id           int(10),
-   amount               decimal not null,
-   status               tinyint(4) not null,
-   ctime                bigint(20) unsigned not null,
-   primary key (pay_in_order_id)
-);
-
-alter table pay_in_order comment '收入订单表';
-
-/*==============================================================*/
-/* Table: pay_in_order_detail                                   */
-/*==============================================================*/
-create table pay_in_order_detail
-(
-   pay_in_order_detail_id int(10) unsigned not null auto_increment,
-   pay_in_order_id      int(10),
-   product_id           varchar(50),
-   product_name         varchar(100),
-   product_price        decimal,
-   product_count        int(10),
-   remark               varchar(500),
-   primary key (pay_in_order_detail_id)
-);
-
-alter table pay_in_order_detail comment '收入订单明细表';
-
-/*==============================================================*/
-/* Table: pay_mch                                               */
-/*==============================================================*/
-create table pay_mch
-(
-   pay_mch_id           int(10) not null auto_increment,
-   mch_id               varchar(20),
-   name                 varchar(20),
-   reqKey               varchar(50),
-   resKey               varchar(50),
-   primary key (pay_mch_id)
-);
-
-alter table pay_mch comment '支付中心商户管理表';
-
-/*==============================================================*/
-/* Table: pay_out_order                                         */
-/*==============================================================*/
-create table pay_out_order
-(
-   pay_out_order_id     int(10) unsigned not null auto_increment,
-   pay_mch_id           int(10),
-   pay_vendor_id        int(10),
-   amount               decimal not null,
-   status               tinyint(4) not null,
-   ctime                bigint(20) unsigned not null,
-   primary key (pay_out_order_id)
-);
-
-alter table pay_out_order comment '支出订单表';
-
-/*==============================================================*/
-/* Table: pay_out_order_detail                                  */
-/*==============================================================*/
-create table pay_out_order_detail
-(
-   pay_out_order_detail_id int(10) unsigned not null auto_increment,
-   pay_out_order_id     int(10),
-   remark               varchar(500),
-   primary key (pay_out_order_detail_id)
-);
-
-alter table pay_out_order_detail comment '支出订单明细表';
-
-/*==============================================================*/
-/* Table: pay_pay                                               */
-/*==============================================================*/
-create table pay_pay
-(
-   pay_pay_id           int(10) not null auto_increment,
-   pay_type_id          int(10),
-   param                varchar(1000),
-   primary key (pay_pay_id)
-);
-
-alter table pay_pay comment '支付参数配置表';
-
-/*==============================================================*/
-/* Table: pay_type                                              */
-/*==============================================================*/
-create table pay_type
-(
-   pay_type_id          int(10) not null auto_increment,
-   pay_vendor_id        int(10),
-   pay_mch_id           int(10),
-   primary key (pay_type_id)
-);
-
-alter table pay_type comment '商户支持支付类型表';
-
-/*==============================================================*/
-/* Table: pay_vendor                                            */
-/*==============================================================*/
-create table pay_vendor
-(
-   pay_vendor_id        int(10) not null auto_increment,
-   name                 varchar(20),
-   appid                varchar(50),
-   appsecret            varchar(150),
-   config               varchar(1000),
-   primary key (pay_vendor_id)
-);
-
-alter table pay_vendor comment '第三方支付标识表';
-
-/*==============================================================*/
-/* Table: pay_vest                                              */
-/*==============================================================*/
-create table pay_vest
-(
-   pay_vest_id          int(10) not null auto_increment,
-   pay_type_id          int(10),
-   prefix               varchar(20),
-   param                varchar(1000),
-   primary key (pay_vest_id)
-);
-
-alter table pay_vest comment '马甲支付参数配置表';
-
-/*==============================================================*/
-/* Table: upms_organization                                     */
-/*==============================================================*/
-create table upms_organization
-(
-   organization_id      int(10) unsigned not null auto_increment,
-   system_id            int(10) unsigned not null,
-   name                 varchar(20),
-   description          varchar(1000),
-   primary key (organization_id)
-);
-
-alter table upms_organization comment '组织';
-
-/*==============================================================*/
-/* Table: upms_permission                                       */
-/*==============================================================*/
-create table upms_permission
-(
-   permission_id        int(10) unsigned not null auto_increment,
-   system_id            int(10) unsigned not null,
-   primary key (permission_id)
-);
-
-alter table upms_permission comment '权限';
-
-/*==============================================================*/
-/* Table: upms_role                                             */
-/*==============================================================*/
-create table upms_role
-(
-   role_id              int(10) unsigned not null auto_increment,
-   system_id            int(10) unsigned not null,
-   name                 varchar(20),
-   description          varchar(1000),
-   status               tinyint(4) not null,
-   ctime                bigint(20) not null,
-   orders               bigint(20) not null,
-   primary key (role_id)
-);
-
-alter table upms_role comment '角色';
-
-/*==============================================================*/
-/* Table: upms_role_permission                                  */
-/*==============================================================*/
-create table upms_role_permission
-(
-   role_permission_id   int(10) unsigned not null auto_increment,
-   role_id              int(10) unsigned not null,
-   permission_id        int(10) unsigned not null,
-   primary key (role_permission_id)
-);
-
-alter table upms_role_permission comment '角色权限关联表';
-
-/*==============================================================*/
-/* Table: upms_system                                           */
-/*==============================================================*/
-create table upms_system
-(
-   system_id            int(10) unsigned not null auto_increment,
-   icon                 varchar(20),
-   basepath             varchar(100),
-   status               tinyint(4),
-   name                 varchar(20),
-   ctime                bigint(20),
-   orders               bigint(20),
-   primary key (system_id)
-);
-
-alter table upms_system comment '系统';
-
-/*==============================================================*/
-/* Table: upms_user                                             */
-/*==============================================================*/
-create table upms_user
-(
-   user_id              int(10) unsigned not null auto_increment,
-   system_id            int(10) unsigned not null,
-   username             varchar(20) not null,
-   password             varchar(32) not null,
-   salt                 varchar(32),
-   realname             varchar(20),
-   avatar               varchar(50),
-   phone                varchar(20),
-   email                varchar(50),
-   sex                  tinyint(4),
-   ctime                bigint(20),
-   primary key (user_id)
-);
-
-alter table upms_user comment '用户';
-
-/*==============================================================*/
-/* Table: upms_user_organization                                */
-/*==============================================================*/
-create table upms_user_organization
-(
-   user_organization_id int(10) unsigned not null auto_increment,
-   user_id              int(10) unsigned not null,
-   organization_id      int(10) unsigned not null,
-   primary key (user_organization_id)
-);
-
-alter table upms_user_organization comment '用户组织关联表';
-
-/*==============================================================*/
-/* Table: upms_user_permission                                  */
-/*==============================================================*/
-create table upms_user_permission
-(
-   user_permission_id   int(10) unsigned not null auto_increment,
-   user_id              int(10) unsigned not null,
-   permission_id        int(10) unsigned not null,
-   primary key (user_permission_id)
-);
-
-alter table upms_user_permission comment '用户权限关联表';
-
-/*==============================================================*/
-/* Table: upms_user_role                                        */
-/*==============================================================*/
-create table upms_user_role
-(
-   user_role_id         int(10) unsigned not null auto_increment,
-   user_id              int(10) unsigned not null,
-   role_id              int(10),
-   role                 int(10) unsigned not null,
-   primary key (user_role_id)
-);
-
-alter table upms_user_role comment '用户角色关联表';
-
-alter table cms_article_category add constraint FK_Reference_7 foreign key (category_id)
-      references cms_category (category_id) on delete cascade on update cascade;
-
-alter table cms_article_category add constraint FK_Reference_8 foreign key (article_id)
-      references cms_article (article_id) on delete cascade on update cascade;
-
-alter table cms_article_tag add constraint FK_Reference_3 foreign key (article_id)
-      references cms_article (article_id) on delete cascade on update cascade;
-
-alter table cms_article_tag add constraint FK_Reference_4 foreign key (tag_id)
-      references cms_tag (tag_id) on delete cascade on update cascade;
-
-alter table cms_book add constraint FK_Reference_9 foreign key (user_id)
-      references cms_user (user_id) on delete cascade on update cascade;
-
-alter table cms_category add constraint FK_Reference_10 foreign key (pid)
-      references cms_category (category_id) on delete set null on update restrict;
-
-alter table cms_category_tag add constraint FK_Reference_5 foreign key (category_id)
-      references cms_category (category_id) on delete cascade on update cascade;
-
-alter table cms_category_tag add constraint FK_Reference_6 foreign key (tag_id)
-      references cms_tag (tag_id) on delete cascade on update cascade;
-
-alter table cms_comment add constraint FK_Reference_1 foreign key (article_id)
-      references cms_article (article_id) on delete cascade on update cascade;
-
-alter table cms_comment add constraint FK_Reference_2 foreign key (pid)
-      references cms_comment (comment_id) on delete cascade on update cascade;
-
-alter table pay_in_order add constraint FK_Reference_32 foreign key (pay_vendor_id)
-      references pay_vendor (pay_vendor_id) on delete restrict on update restrict;
-
-alter table pay_in_order add constraint FK_Reference_38 foreign key (pay_mch_id)
-      references pay_mch (pay_mch_id) on delete restrict on update restrict;
-
-alter table pay_in_order_detail add constraint FK_Reference_40 foreign key (pay_in_order_id)
-      references pay_in_order (pay_in_order_id) on delete restrict on update restrict;
-
-alter table pay_out_order add constraint FK_Reference_33 foreign key (pay_vendor_id)
-      references pay_vendor (pay_vendor_id) on delete restrict on update restrict;
-
-alter table pay_out_order add constraint FK_Reference_39 foreign key (pay_mch_id)
-      references pay_mch (pay_mch_id) on delete restrict on update restrict;
-
-alter table pay_out_order_detail add constraint FK_Reference_31 foreign key (pay_out_order_id)
-      references pay_out_order (pay_out_order_id) on delete restrict on update restrict;
-
-alter table pay_pay add constraint FK_Reference_35 foreign key (pay_type_id)
-      references pay_type (pay_type_id) on delete restrict on update restrict;
-
-alter table pay_type add constraint FK_Reference_34 foreign key (pay_vendor_id)
-      references pay_vendor (pay_vendor_id) on delete restrict on update restrict;
-
-alter table pay_type add constraint FK_Reference_37 foreign key (pay_mch_id)
-      references pay_mch (pay_mch_id) on delete restrict on update restrict;
-
-alter table pay_vest add constraint FK_Reference_36 foreign key (pay_type_id)
-      references pay_type (pay_type_id) on delete restrict on update restrict;
-
-alter table upms_organization add constraint FK_Reference_15 foreign key (system_id)
-      references upms_system (system_id) on delete restrict on update restrict;
-
-alter table upms_role add constraint FK_Reference_17 foreign key (system_id)
-      references upms_system (system_id) on delete restrict on update restrict;
-
-alter table upms_role_permission add constraint FK_Reference_22 foreign key (permission_id)
-      references upms_permission (permission_id) on delete restrict on update restrict;
-
-alter table upms_role_permission add constraint FK_Reference_23 foreign key (role_id)
-      references upms_role (role_id) on delete restrict on update restrict;
-
-alter table upms_user add constraint FK_Reference_16 foreign key (system_id)
-      references upms_system (system_id) on delete restrict on update restrict;
-
-alter table upms_user_organization add constraint FK_Reference_18 foreign key (user_id)
-      references upms_user (user_id) on delete restrict on update restrict;
-
-alter table upms_user_organization add constraint FK_Reference_19 foreign key (organization_id)
-      references upms_organization (organization_id) on delete restrict on update restrict;
-
-alter table upms_user_permission add constraint FK_Reference_24 foreign key (user_id)
-      references upms_user (user_id) on delete restrict on update restrict;
-
-alter table upms_user_permission add constraint FK_Reference_25 foreign key (permission_id)
-      references upms_permission (permission_id) on delete restrict on update restrict;
-
-alter table upms_user_role add constraint FK_Reference_20 foreign key (user_id)
-      references upms_user (user_id) on delete restrict on update restrict;
-
-alter table upms_user_role add constraint FK_Reference_21 foreign key (role_id)
-      references upms_role (role_id) on delete restrict on update restrict;
-
+/*
+Navicat MySQL Data Transfer
+
+Source Server         : localhost
+Source Server Version : 50621
+Source Host           : localhost:3306
+Source Database       : zheng
+
+Target Server Type    : MYSQL
+Target Server Version : 50621
+File Encoding         : 65001
+
+Date: 2017-01-20 23:33:25
+*/
+
+SET FOREIGN_KEY_CHECKS=0;
+
+-- ----------------------------
+-- Table structure for cms_article
+-- ----------------------------
+DROP TABLE IF EXISTS `cms_article`;
+CREATE TABLE `cms_article` (
+  `article_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '文章编号',
+  `title` varchar(200) NOT NULL COMMENT '文章标题',
+  `author` varchar(50) DEFAULT NULL COMMENT '文章原作者',
+  `fromurl` varchar(300) DEFAULT NULL COMMENT '转载来源网址',
+  `image` varchar(300) DEFAULT NULL COMMENT '封面图',
+  `keywords` varchar(100) DEFAULT NULL COMMENT '关键字',
+  `description` varchar(500) DEFAULT NULL COMMENT '简介',
+  `type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '类型(1:普通,2:热门...)',
+  `allowcomments` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否允许评论(0:不允许,1:允许)',
+  `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态(-1:不通过,0未审核,1:通过)',
+  `content` mediumtext COMMENT '内容',
+  `user_id` int(10) unsigned NOT NULL COMMENT '发布人id',
+  `readnumber` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '阅读数量',
+  `ctime` bigint(20) unsigned NOT NULL COMMENT '创建时间',
+  `orders` bigint(20) unsigned NOT NULL COMMENT '排序',
+  PRIMARY KEY (`article_id`),
+  KEY `cms_article_orders` (`orders`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文章表';
+
+-- ----------------------------
+-- Records of cms_article
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for cms_article_category
+-- ----------------------------
+DROP TABLE IF EXISTS `cms_article_category`;
+CREATE TABLE `cms_article_category` (
+  `article_category_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `article_id` int(10) unsigned NOT NULL COMMENT '文章编号',
+  `category_id` int(10) unsigned NOT NULL COMMENT '类目编号',
+  PRIMARY KEY (`article_category_id`),
+  KEY `cms_article_category_article_id` (`article_id`),
+  KEY `cms_article_category_category_id` (`category_id`),
+  CONSTRAINT `FK_Reference_7` FOREIGN KEY (`category_id`) REFERENCES `cms_category` (`category_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+  CONSTRAINT `FK_Reference_8` FOREIGN KEY (`article_id`) REFERENCES `cms_article` (`article_id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文章类目关联表';
+
+-- ----------------------------
+-- Records of cms_article_category
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for cms_article_tag
+-- ----------------------------
+DROP TABLE IF EXISTS `cms_article_tag`;
+CREATE TABLE `cms_article_tag` (
+  `article_tag_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `article_id` int(10) unsigned NOT NULL COMMENT '文章编号',
+  `tag_id` int(10) unsigned NOT NULL COMMENT '标签编号',
+  PRIMARY KEY (`article_tag_id`),
+  KEY `cms_article_tag_article_id` (`article_id`),
+  KEY `cms_article_tag_tag_id` (`tag_id`),
+  CONSTRAINT `FK_Reference_3` FOREIGN KEY (`article_id`) REFERENCES `cms_article` (`article_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+  CONSTRAINT `FK_Reference_4` FOREIGN KEY (`tag_id`) REFERENCES `cms_tag` (`tag_id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='文章标签关联表';
+
+-- ----------------------------
+-- Records of cms_article_tag
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for cms_book
+-- ----------------------------
+DROP TABLE IF EXISTS `cms_book`;
+CREATE TABLE `cms_book` (
+  `book_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `user_id` int(10) unsigned NOT NULL COMMENT '用户编号',
+  `name` varchar(45) NOT NULL COMMENT '书名',
+  PRIMARY KEY (`book_id`),
+  KEY `FK_book_1` (`user_id`),
+  CONSTRAINT `FK_Reference_9` FOREIGN KEY (`user_id`) REFERENCES `cms_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COMMENT='书';
+
+-- ----------------------------
+-- Records of cms_book
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for cms_category
+-- ----------------------------
+DROP TABLE IF EXISTS `cms_category`;
+CREATE TABLE `cms_category` (
+  `category_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '类目编号',
+  `pid` int(10) unsigned DEFAULT NULL COMMENT '上级编号',
+  `level` tinyint(4) NOT NULL COMMENT '层级',
+  `name` varchar(20) NOT NULL COMMENT '名称',
+  `description` varchar(200) DEFAULT NULL COMMENT '描述',
+  `icon` varchar(50) DEFAULT NULL COMMENT '图标',
+  `type` tinyint(3) NOT NULL DEFAULT '1' COMMENT '类型(1:普通,2:热门...)',
+  `alias` varchar(20) DEFAULT NULL COMMENT '别名',
+  `ctime` bigint(20) unsigned NOT NULL COMMENT '创建时间',
+  `orders` bigint(255) unsigned NOT NULL COMMENT '排序',
+  PRIMARY KEY (`category_id`),
+  KEY `cms_category_orders` (`orders`),
+  KEY `cms_category_pid` (`pid`),
+  KEY `cms_category_alias` (`alias`),
+  KEY `cms_category_level` (`level`),
+  CONSTRAINT `FK_Reference_10` FOREIGN KEY (`pid`) REFERENCES `cms_category` (`category_id`) ON DELETE SET NULL
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='类目表';
+
+-- ----------------------------
+-- Records of cms_category
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for cms_category_tag
+-- ----------------------------
+DROP TABLE IF EXISTS `cms_category_tag`;
+CREATE TABLE `cms_category_tag` (
+  `category_tag_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `category_id` int(10) unsigned NOT NULL COMMENT '类目编号',
+  `tag_id` int(10) unsigned NOT NULL COMMENT '标签编号',
+  PRIMARY KEY (`category_tag_id`),
+  KEY `cms_category_tag_tag_id` (`tag_id`),
+  KEY `cms_category_tag_category_id` (`category_id`),
+  CONSTRAINT `FK_Reference_5` FOREIGN KEY (`category_id`) REFERENCES `cms_category` (`category_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+  CONSTRAINT `FK_Reference_6` FOREIGN KEY (`tag_id`) REFERENCES `cms_tag` (`tag_id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='类目标签关联表';
+
+-- ----------------------------
+-- Records of cms_category_tag
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for cms_comment
+-- ----------------------------
+DROP TABLE IF EXISTS `cms_comment`;
+CREATE TABLE `cms_comment` (
+  `comment_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `pid` int(10) unsigned DEFAULT NULL COMMENT '回复楼中楼编号回复楼中楼编号',
+  `article_id` int(10) unsigned NOT NULL COMMENT '文章编号',
+  `user_id` int(10) unsigned NOT NULL COMMENT '用户编号',
+  `content` text NOT NULL COMMENT '评论内容',
+  `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态(-1:不通过,0:未审核,1:通过)',
+  `ip` varchar(30) DEFAULT NULL COMMENT '评论人ip地址',
+  `agent` varchar(200) DEFAULT NULL COMMENT '评论人终端信息',
+  `ctime` bigint(20) NOT NULL COMMENT '创建时间',
+  PRIMARY KEY (`comment_id`),
+  KEY `cms_comment_article_id` (`article_id`),
+  KEY `FK_Reference_2` (`pid`),
+  CONSTRAINT `FK_Reference_1` FOREIGN KEY (`article_id`) REFERENCES `cms_article` (`article_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+  CONSTRAINT `FK_Reference_2` FOREIGN KEY (`pid`) REFERENCES `cms_comment` (`comment_id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='评论表';
+
+-- ----------------------------
+-- Records of cms_comment
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for cms_page
+-- ----------------------------
+DROP TABLE IF EXISTS `cms_page`;
+CREATE TABLE `cms_page` (
+  `page_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `pid` int(10) DEFAULT NULL,
+  `alias` varchar(20) DEFAULT NULL,
+  `content` mediumtext,
+  `keywords` varchar(100) DEFAULT NULL,
+  `description` varchar(300) DEFAULT NULL,
+  `ctime` bigint(20) DEFAULT NULL,
+  `orders` bigint(20) DEFAULT NULL,
+  PRIMARY KEY (`page_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='页面';
+
+-- ----------------------------
+-- Records of cms_page
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for cms_setting
+-- ----------------------------
+DROP TABLE IF EXISTS `cms_setting`;
+CREATE TABLE `cms_setting` (
+  `setting_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `setting_key` varchar(10) DEFAULT NULL,
+  `setting_value` varchar(500) DEFAULT NULL,
+  PRIMARY KEY (`setting_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='网站配置';
+
+-- ----------------------------
+-- Records of cms_setting
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for cms_tag
+-- ----------------------------
+DROP TABLE IF EXISTS `cms_tag`;
+CREATE TABLE `cms_tag` (
+  `tag_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '标签编号',
+  `name` varchar(20) NOT NULL COMMENT '名称',
+  `description` varchar(200) DEFAULT NULL COMMENT '描述',
+  `icon` varchar(50) DEFAULT NULL COMMENT '图标',
+  `type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '类型(1:普通,2:热门...)',
+  `alias` varchar(20) DEFAULT NULL COMMENT '别名',
+  `ctime` bigint(20) unsigned NOT NULL COMMENT '创建时间',
+  `orders` bigint(20) unsigned NOT NULL COMMENT '排序',
+  PRIMARY KEY (`tag_id`),
+  KEY `cms_tag_orders` (`orders`),
+  KEY `cms_tag_alias` (`alias`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='标签表';
+
+-- ----------------------------
+-- Records of cms_tag
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for cms_user
+-- ----------------------------
+DROP TABLE IF EXISTS `cms_user`;
+CREATE TABLE `cms_user` (
+  `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `username` varchar(32) DEFAULT NULL COMMENT '账号',
+  `password` varchar(32) DEFAULT NULL COMMENT '密码',
+  `nickname` varchar(32) DEFAULT NULL COMMENT '昵称',
+  `sex` int(11) DEFAULT NULL COMMENT '0未知,1男,2女',
+  `ctime` bigint(20) DEFAULT NULL COMMENT '创建时间',
+  `content` text COMMENT '备注',
+  PRIMARY KEY (`user_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8 COMMENT='用户';
+
+-- ----------------------------
+-- Records of cms_user
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for pay_in_order
+-- ----------------------------
+DROP TABLE IF EXISTS `pay_in_order`;
+CREATE TABLE `pay_in_order` (
+  `pay_in_order_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `pay_vendor_id` int(10) DEFAULT NULL,
+  `pay_mch_id` int(10) DEFAULT NULL,
+  `amount` decimal(10,0) NOT NULL,
+  `status` tinyint(4) NOT NULL,
+  `ctime` bigint(20) unsigned NOT NULL,
+  PRIMARY KEY (`pay_in_order_id`),
+  KEY `FK_Reference_32` (`pay_vendor_id`),
+  KEY `FK_Reference_38` (`pay_mch_id`),
+  CONSTRAINT `FK_Reference_32` FOREIGN KEY (`pay_vendor_id`) REFERENCES `pay_vendor` (`pay_vendor_id`),
+  CONSTRAINT `FK_Reference_38` FOREIGN KEY (`pay_mch_id`) REFERENCES `pay_mch` (`pay_mch_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='收入订单表';
+
+-- ----------------------------
+-- Records of pay_in_order
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for pay_in_order_detail
+-- ----------------------------
+DROP TABLE IF EXISTS `pay_in_order_detail`;
+CREATE TABLE `pay_in_order_detail` (
+  `pay_in_order_detail_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `pay_in_order_id` int(10) DEFAULT NULL,
+  `product_id` varchar(50) DEFAULT NULL,
+  `product_name` varchar(100) DEFAULT NULL,
+  `product_price` decimal(10,0) DEFAULT NULL,
+  `product_count` int(10) DEFAULT NULL,
+  `remark` varchar(500) DEFAULT NULL,
+  PRIMARY KEY (`pay_in_order_detail_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='收入订单明细表';
+
+-- ----------------------------
+-- Records of pay_in_order_detail
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for pay_mch
+-- ----------------------------
+DROP TABLE IF EXISTS `pay_mch`;
+CREATE TABLE `pay_mch` (
+  `pay_mch_id` int(10) NOT NULL AUTO_INCREMENT,
+  `mch_id` varchar(20) DEFAULT NULL,
+  `name` varchar(20) DEFAULT NULL,
+  `reqKey` varchar(50) DEFAULT NULL,
+  `resKey` varchar(50) DEFAULT NULL,
+  PRIMARY KEY (`pay_mch_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付中心商户管理表';
+
+-- ----------------------------
+-- Records of pay_mch
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for pay_out_order
+-- ----------------------------
+DROP TABLE IF EXISTS `pay_out_order`;
+CREATE TABLE `pay_out_order` (
+  `pay_out_order_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `pay_mch_id` int(10) DEFAULT NULL,
+  `pay_vendor_id` int(10) DEFAULT NULL,
+  `amount` decimal(10,0) NOT NULL,
+  `status` tinyint(4) NOT NULL,
+  `ctime` bigint(20) unsigned NOT NULL,
+  PRIMARY KEY (`pay_out_order_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支出订单表';
+
+-- ----------------------------
+-- Records of pay_out_order
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for pay_out_order_detail
+-- ----------------------------
+DROP TABLE IF EXISTS `pay_out_order_detail`;
+CREATE TABLE `pay_out_order_detail` (
+  `pay_out_order_detail_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `pay_out_order_id` int(10) DEFAULT NULL,
+  `remark` varchar(500) DEFAULT NULL,
+  PRIMARY KEY (`pay_out_order_detail_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支出订单明细表';
+
+-- ----------------------------
+-- Records of pay_out_order_detail
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for pay_pay
+-- ----------------------------
+DROP TABLE IF EXISTS `pay_pay`;
+CREATE TABLE `pay_pay` (
+  `pay_pay_id` int(10) NOT NULL AUTO_INCREMENT,
+  `pay_type_id` int(10) DEFAULT NULL,
+  `param` varchar(1000) DEFAULT NULL,
+  PRIMARY KEY (`pay_pay_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='支付参数配置表';
+
+-- ----------------------------
+-- Records of pay_pay
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for pay_type
+-- ----------------------------
+DROP TABLE IF EXISTS `pay_type`;
+CREATE TABLE `pay_type` (
+  `pay_type_id` int(10) NOT NULL AUTO_INCREMENT,
+  `pay_vendor_id` int(10) DEFAULT NULL,
+  `pay_mch_id` int(10) DEFAULT NULL,
+  PRIMARY KEY (`pay_type_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商户支持支付类型表';
+
+-- ----------------------------
+-- Records of pay_type
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for pay_vendor
+-- ----------------------------
+DROP TABLE IF EXISTS `pay_vendor`;
+CREATE TABLE `pay_vendor` (
+  `pay_vendor_id` int(10) NOT NULL AUTO_INCREMENT,
+  `name` varchar(20) DEFAULT NULL,
+  `appid` varchar(50) DEFAULT NULL,
+  `appsecret` varchar(150) DEFAULT NULL,
+  `config` varchar(1000) DEFAULT NULL,
+  PRIMARY KEY (`pay_vendor_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='第三方支付标识表';
+
+-- ----------------------------
+-- Records of pay_vendor
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for pay_vest
+-- ----------------------------
+DROP TABLE IF EXISTS `pay_vest`;
+CREATE TABLE `pay_vest` (
+  `pay_vest_id` int(10) NOT NULL AUTO_INCREMENT,
+  `pay_type_id` int(10) DEFAULT NULL,
+  `prefix` varchar(20) DEFAULT NULL,
+  `param` varchar(1000) DEFAULT NULL,
+  PRIMARY KEY (`pay_vest_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='马甲支付参数配置表';
+
+-- ----------------------------
+-- Records of pay_vest
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for tmp_upms_organization
+-- ----------------------------
+DROP TABLE IF EXISTS `tmp_upms_organization`;
+CREATE TABLE `tmp_upms_organization` (
+  `organization_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `system_id` int(10) unsigned NOT NULL,
+  `name` varchar(20) DEFAULT NULL,
+  `description` varchar(1000) DEFAULT NULL,
+  PRIMARY KEY (`organization_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组织';
+
+-- ----------------------------
+-- Records of tmp_upms_organization
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for tmp_upms_permission
+-- ----------------------------
+DROP TABLE IF EXISTS `tmp_upms_permission`;
+CREATE TABLE `tmp_upms_permission` (
+  `permission_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `system_id` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`permission_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='权限';
+
+-- ----------------------------
+-- Records of tmp_upms_permission
+-- ----------------------------
+INSERT INTO `tmp_upms_permission` VALUES ('1', '1');
+
+-- ----------------------------
+-- Table structure for tmp_upms_user
+-- ----------------------------
+DROP TABLE IF EXISTS `tmp_upms_user`;
+CREATE TABLE `tmp_upms_user` (
+  `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `system_id` int(10) unsigned NOT NULL,
+  `username` varchar(20) NOT NULL,
+  `password` varchar(32) NOT NULL,
+  `salt` varchar(32) DEFAULT NULL,
+  `realname` varchar(20) DEFAULT NULL,
+  `avatar` varchar(50) DEFAULT NULL,
+  `phone` varchar(20) DEFAULT NULL,
+  `email` varchar(50) DEFAULT NULL,
+  `sex` tinyint(4) DEFAULT NULL,
+  `ctime` bigint(20) DEFAULT NULL,
+  PRIMARY KEY (`user_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='用户';
+
+-- ----------------------------
+-- Records of tmp_upms_user
+-- ----------------------------
+INSERT INTO `tmp_upms_user` VALUES ('1', '1', 'admin', 'C1F3459C3869B0D28DA59A966D33810E', '2e1dba52a94d4c30ba27999d823c82ac', '管理员', null, null, null, '1', '1');
+
+-- ----------------------------
+-- Table structure for upms_organization
+-- ----------------------------
+DROP TABLE IF EXISTS `upms_organization`;
+CREATE TABLE `upms_organization` (
+  `organization_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `system_id` int(10) unsigned NOT NULL COMMENT '所属系统',
+  `name` varchar(20) DEFAULT NULL COMMENT '组织名称',
+  `description` varchar(1000) DEFAULT NULL COMMENT '组织描述',
+  `ctime` bigint(20) DEFAULT NULL COMMENT '创建时间',
+  PRIMARY KEY (`organization_id`),
+  KEY `FK_Reference_15` (`system_id`),
+  CONSTRAINT `FK_Reference_15` FOREIGN KEY (`system_id`) REFERENCES `upms_system` (`system_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='组织';
+
+-- ----------------------------
+-- Records of upms_organization
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for upms_permission
+-- ----------------------------
+DROP TABLE IF EXISTS `upms_permission`;
+CREATE TABLE `upms_permission` (
+  `permission_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `system_id` int(10) unsigned NOT NULL COMMENT '所属系统',
+  `permission_value` varchar(20) DEFAULT NULL COMMENT '权限值',
+  PRIMARY KEY (`permission_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='权限';
+
+-- ----------------------------
+-- Records of upms_permission
+-- ----------------------------
+INSERT INTO `upms_permission` VALUES ('1', '1', '*:*:*');
+
+-- ----------------------------
+-- Table structure for upms_role
+-- ----------------------------
+DROP TABLE IF EXISTS `upms_role`;
+CREATE TABLE `upms_role` (
+  `role_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `system_id` int(10) unsigned NOT NULL,
+  `name` varchar(20) DEFAULT NULL,
+  `description` varchar(1000) DEFAULT NULL,
+  `status` tinyint(4) NOT NULL,
+  `ctime` bigint(20) NOT NULL,
+  `orders` bigint(20) NOT NULL,
+  PRIMARY KEY (`role_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='角色';
+
+-- ----------------------------
+-- Records of upms_role
+-- ----------------------------
+INSERT INTO `upms_role` VALUES ('1', '1', '超级管理员', '拥有系统所有权限', '1', '1', '1');
+
+-- ----------------------------
+-- Table structure for upms_role_permission
+-- ----------------------------
+DROP TABLE IF EXISTS `upms_role_permission`;
+CREATE TABLE `upms_role_permission` (
+  `role_permission_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `role_id` int(10) unsigned NOT NULL,
+  `permission_id` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`role_permission_id`),
+  KEY `FK_Reference_22` (`permission_id`),
+  CONSTRAINT `FK_Reference_22` FOREIGN KEY (`permission_id`) REFERENCES `upms_permission` (`permission_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色权限关联表';
+
+-- ----------------------------
+-- Records of upms_role_permission
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for upms_system
+-- ----------------------------
+DROP TABLE IF EXISTS `upms_system`;
+CREATE TABLE `upms_system` (
+  `system_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `icon` varchar(20) DEFAULT NULL,
+  `basepath` varchar(100) DEFAULT NULL,
+  `status` smallint(6) DEFAULT NULL,
+  `name` varchar(20) DEFAULT NULL,
+  `ctime` bigint(20) DEFAULT NULL,
+  `orders` bigint(20) DEFAULT NULL,
+  PRIMARY KEY (`system_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='系统';
+
+-- ----------------------------
+-- Records of upms_system
+-- ----------------------------
+INSERT INTO `upms_system` VALUES ('1', null, 'http://upms.zhangshuzheng.cn:1113', '1', 'zheng-upms-app1', '1', '1');
+INSERT INTO `upms_system` VALUES ('2', null, 'http://upms.zhangshuzheng.cn:1114', '1', 'zheng-upms-app2', '2', '2');
+INSERT INTO `upms_system` VALUES ('3', null, 'http://cms.zhangshuzheng.cn:2222', '1', 'zheng-cms-admin', '3', '3');
+INSERT INTO `upms_system` VALUES ('4', null, 'http://upms.zhangshuzheng.cn:1111', '1', 'zheng-upms-server', '4', '4');
+
+-- ----------------------------
+-- Table structure for upms_user
+-- ----------------------------
+DROP TABLE IF EXISTS `upms_user`;
+CREATE TABLE `upms_user` (
+  `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
+  `system_id` int(10) unsigned NOT NULL COMMENT '所属系统',
+  `username` varchar(20) NOT NULL COMMENT '帐号',
+  `password` varchar(32) NOT NULL COMMENT '密码MD5(密码+盐)',
+  `salt` varchar(32) DEFAULT NULL COMMENT '盐',
+  `realname` varchar(20) DEFAULT NULL COMMENT '姓名',
+  `avatar` varchar(50) DEFAULT NULL COMMENT '头像',
+  `phone` varchar(20) DEFAULT NULL COMMENT '电话',
+  `email` varchar(50) DEFAULT NULL COMMENT '邮箱',
+  `sex` tinyint(4) DEFAULT NULL COMMENT '性别',
+  `status` tinyint(4) DEFAULT NULL COMMENT '状态(-1:封,0:未审核,1:正常)',
+  `ctime` bigint(20) DEFAULT NULL COMMENT '创建时间',
+  PRIMARY KEY (`user_id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;
+
+-- ----------------------------
+-- Records of upms_user
+-- ----------------------------
+INSERT INTO `upms_user` VALUES ('1', '1', 'admin', '3038D9CB63B3152A79B8153FB06C02F7', '66f1b370c660445a8657bf8bf1794486', '管理员', null, null, null, null, '1', '1');
+
+-- ----------------------------
+-- Table structure for upms_user_organization
+-- ----------------------------
+DROP TABLE IF EXISTS `upms_user_organization`;
+CREATE TABLE `upms_user_organization` (
+  `user_organization_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `user_id` int(10) unsigned NOT NULL,
+  `organization_id` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`user_organization_id`),
+  KEY `FK_Reference_19` (`organization_id`),
+  CONSTRAINT `FK_Reference_19` FOREIGN KEY (`organization_id`) REFERENCES `upms_organization` (`organization_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户组织关联表';
+
+-- ----------------------------
+-- Records of upms_user_organization
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for upms_user_permission
+-- ----------------------------
+DROP TABLE IF EXISTS `upms_user_permission`;
+CREATE TABLE `upms_user_permission` (
+  `user_permission_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `user_id` int(10) unsigned NOT NULL,
+  `permission_id` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`user_permission_id`),
+  KEY `FK_Reference_25` (`permission_id`),
+  CONSTRAINT `FK_Reference_25` FOREIGN KEY (`permission_id`) REFERENCES `upms_permission` (`permission_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户权限关联表';
+
+-- ----------------------------
+-- Records of upms_user_permission
+-- ----------------------------
+
+-- ----------------------------
+-- Table structure for upms_user_role
+-- ----------------------------
+DROP TABLE IF EXISTS `upms_user_role`;
+CREATE TABLE `upms_user_role` (
+  `user_role_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `user_id` int(10) unsigned NOT NULL,
+  `role_id` int(10) DEFAULT NULL,
+  `role` int(10) unsigned NOT NULL,
+  PRIMARY KEY (`user_role_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户角色关联表';
+
+-- ----------------------------
+-- Records of upms_user_role
+-- ----------------------------

+ 20 - 5
zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/mapper/UpmsOrganizationMapper.xml

@@ -6,6 +6,7 @@
     <result column="system_id" jdbcType="INTEGER" property="systemId" />
     <result column="name" jdbcType="VARCHAR" property="name" />
     <result column="description" jdbcType="VARCHAR" property="description" />
+    <result column="ctime" jdbcType="BIGINT" property="ctime" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -66,7 +67,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    organization_id, system_id, name, description
+    organization_id, system_id, name, description, ctime
   </sql>
   <select id="selectByExample" parameterType="com.zheng.upms.dao.model.UpmsOrganizationExample" resultMap="BaseResultMap">
     select
@@ -108,9 +109,9 @@
   </delete>
   <insert id="insert" parameterType="com.zheng.upms.dao.model.UpmsOrganization">
     insert into upms_organization (organization_id, system_id, name, 
-      description)
+      description, ctime)
     values (#{organizationId,jdbcType=INTEGER}, #{systemId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, 
-      #{description,jdbcType=VARCHAR})
+      #{description,jdbcType=VARCHAR}, #{ctime,jdbcType=BIGINT})
   </insert>
   <insert id="insertSelective" parameterType="com.zheng.upms.dao.model.UpmsOrganization">
     insert into upms_organization
@@ -127,6 +128,9 @@
       <if test="description != null">
         description,
       </if>
+      <if test="ctime != null">
+        ctime,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="organizationId != null">
@@ -141,6 +145,9 @@
       <if test="description != null">
         #{description,jdbcType=VARCHAR},
       </if>
+      <if test="ctime != null">
+        #{ctime,jdbcType=BIGINT},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.zheng.upms.dao.model.UpmsOrganizationExample" resultType="java.lang.Long">
@@ -164,6 +171,9 @@
       <if test="record.description != null">
         description = #{record.description,jdbcType=VARCHAR},
       </if>
+      <if test="record.ctime != null">
+        ctime = #{record.ctime,jdbcType=BIGINT},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -174,7 +184,8 @@
     set organization_id = #{record.organizationId,jdbcType=INTEGER},
       system_id = #{record.systemId,jdbcType=INTEGER},
       name = #{record.name,jdbcType=VARCHAR},
-      description = #{record.description,jdbcType=VARCHAR}
+      description = #{record.description,jdbcType=VARCHAR},
+      ctime = #{record.ctime,jdbcType=BIGINT}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -191,6 +202,9 @@
       <if test="description != null">
         description = #{description,jdbcType=VARCHAR},
       </if>
+      <if test="ctime != null">
+        ctime = #{ctime,jdbcType=BIGINT},
+      </if>
     </set>
     where organization_id = #{organizationId,jdbcType=INTEGER}
   </update>
@@ -198,7 +212,8 @@
     update upms_organization
     set system_id = #{systemId,jdbcType=INTEGER},
       name = #{name,jdbcType=VARCHAR},
-      description = #{description,jdbcType=VARCHAR}
+      description = #{description,jdbcType=VARCHAR},
+      ctime = #{ctime,jdbcType=BIGINT}
     where organization_id = #{organizationId,jdbcType=INTEGER}
   </update>
   <cache type="org.mybatis.caches.ehcache.LoggingEhcache" />

+ 22 - 5
zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/mapper/UpmsPermissionMapper.xml

@@ -4,6 +4,7 @@
   <resultMap id="BaseResultMap" type="com.zheng.upms.dao.model.UpmsPermission">
     <id column="permission_id" jdbcType="INTEGER" property="permissionId" />
     <result column="system_id" jdbcType="INTEGER" property="systemId" />
+    <result column="permission_value" jdbcType="VARCHAR" property="permissionValue" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -64,7 +65,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    permission_id, system_id
+    permission_id, system_id, permission_value
   </sql>
   <select id="selectByExample" parameterType="com.zheng.upms.dao.model.UpmsPermissionExample" resultMap="BaseResultMap">
     select
@@ -105,8 +106,10 @@
     </if>
   </delete>
   <insert id="insert" parameterType="com.zheng.upms.dao.model.UpmsPermission">
-    insert into upms_permission (permission_id, system_id)
-    values (#{permissionId,jdbcType=INTEGER}, #{systemId,jdbcType=INTEGER})
+    insert into upms_permission (permission_id, system_id, permission_value
+      )
+    values (#{permissionId,jdbcType=INTEGER}, #{systemId,jdbcType=INTEGER}, #{permissionValue,jdbcType=VARCHAR}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.zheng.upms.dao.model.UpmsPermission">
     insert into upms_permission
@@ -117,6 +120,9 @@
       <if test="systemId != null">
         system_id,
       </if>
+      <if test="permissionValue != null">
+        permission_value,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="permissionId != null">
@@ -125,6 +131,9 @@
       <if test="systemId != null">
         #{systemId,jdbcType=INTEGER},
       </if>
+      <if test="permissionValue != null">
+        #{permissionValue,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.zheng.upms.dao.model.UpmsPermissionExample" resultType="java.lang.Long">
@@ -142,6 +151,9 @@
       <if test="record.systemId != null">
         system_id = #{record.systemId,jdbcType=INTEGER},
       </if>
+      <if test="record.permissionValue != null">
+        permission_value = #{record.permissionValue,jdbcType=VARCHAR},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -150,7 +162,8 @@
   <update id="updateByExample" parameterType="map">
     update upms_permission
     set permission_id = #{record.permissionId,jdbcType=INTEGER},
-      system_id = #{record.systemId,jdbcType=INTEGER}
+      system_id = #{record.systemId,jdbcType=INTEGER},
+      permission_value = #{record.permissionValue,jdbcType=VARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -161,12 +174,16 @@
       <if test="systemId != null">
         system_id = #{systemId,jdbcType=INTEGER},
       </if>
+      <if test="permissionValue != null">
+        permission_value = #{permissionValue,jdbcType=VARCHAR},
+      </if>
     </set>
     where permission_id = #{permissionId,jdbcType=INTEGER}
   </update>
   <update id="updateByPrimaryKey" parameterType="com.zheng.upms.dao.model.UpmsPermission">
     update upms_permission
-    set system_id = #{systemId,jdbcType=INTEGER}
+    set system_id = #{systemId,jdbcType=INTEGER},
+      permission_value = #{permissionValue,jdbcType=VARCHAR}
     where permission_id = #{permissionId,jdbcType=INTEGER}
   </update>
   <cache type="org.mybatis.caches.ehcache.LoggingEhcache" />

+ 7 - 7
zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/mapper/UpmsSystemMapper.xml

@@ -5,7 +5,7 @@
     <id column="system_id" jdbcType="INTEGER" property="systemId" />
     <result column="icon" jdbcType="VARCHAR" property="icon" />
     <result column="basepath" jdbcType="VARCHAR" property="basepath" />
-    <result column="status" jdbcType="TINYINT" property="status" />
+    <result column="status" jdbcType="SMALLINT" property="status" />
     <result column="name" jdbcType="VARCHAR" property="name" />
     <result column="ctime" jdbcType="BIGINT" property="ctime" />
     <result column="orders" jdbcType="BIGINT" property="orders" />
@@ -114,7 +114,7 @@
       status, name, ctime, 
       orders)
     values (#{systemId,jdbcType=INTEGER}, #{icon,jdbcType=VARCHAR}, #{basepath,jdbcType=VARCHAR}, 
-      #{status,jdbcType=TINYINT}, #{name,jdbcType=VARCHAR}, #{ctime,jdbcType=BIGINT}, 
+      #{status,jdbcType=SMALLINT}, #{name,jdbcType=VARCHAR}, #{ctime,jdbcType=BIGINT}, 
       #{orders,jdbcType=BIGINT})
   </insert>
   <insert id="insertSelective" parameterType="com.zheng.upms.dao.model.UpmsSystem">
@@ -153,7 +153,7 @@
         #{basepath,jdbcType=VARCHAR},
       </if>
       <if test="status != null">
-        #{status,jdbcType=TINYINT},
+        #{status,jdbcType=SMALLINT},
       </if>
       <if test="name != null">
         #{name,jdbcType=VARCHAR},
@@ -185,7 +185,7 @@
         basepath = #{record.basepath,jdbcType=VARCHAR},
       </if>
       <if test="record.status != null">
-        status = #{record.status,jdbcType=TINYINT},
+        status = #{record.status,jdbcType=SMALLINT},
       </if>
       <if test="record.name != null">
         name = #{record.name,jdbcType=VARCHAR},
@@ -206,7 +206,7 @@
     set system_id = #{record.systemId,jdbcType=INTEGER},
       icon = #{record.icon,jdbcType=VARCHAR},
       basepath = #{record.basepath,jdbcType=VARCHAR},
-      status = #{record.status,jdbcType=TINYINT},
+      status = #{record.status,jdbcType=SMALLINT},
       name = #{record.name,jdbcType=VARCHAR},
       ctime = #{record.ctime,jdbcType=BIGINT},
       orders = #{record.orders,jdbcType=BIGINT}
@@ -224,7 +224,7 @@
         basepath = #{basepath,jdbcType=VARCHAR},
       </if>
       <if test="status != null">
-        status = #{status,jdbcType=TINYINT},
+        status = #{status,jdbcType=SMALLINT},
       </if>
       <if test="name != null">
         name = #{name,jdbcType=VARCHAR},
@@ -242,7 +242,7 @@
     update upms_system
     set icon = #{icon,jdbcType=VARCHAR},
       basepath = #{basepath,jdbcType=VARCHAR},
-      status = #{status,jdbcType=TINYINT},
+      status = #{status,jdbcType=SMALLINT},
       name = #{name,jdbcType=VARCHAR},
       ctime = #{ctime,jdbcType=BIGINT},
       orders = #{orders,jdbcType=BIGINT}

+ 18 - 3
zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/mapper/UpmsUserMapper.xml

@@ -12,6 +12,7 @@
     <result column="phone" jdbcType="VARCHAR" property="phone" />
     <result column="email" jdbcType="VARCHAR" property="email" />
     <result column="sex" jdbcType="TINYINT" property="sex" />
+    <result column="status" jdbcType="TINYINT" property="status" />
     <result column="ctime" jdbcType="BIGINT" property="ctime" />
   </resultMap>
   <sql id="Example_Where_Clause">
@@ -74,7 +75,7 @@
   </sql>
   <sql id="Base_Column_List">
     user_id, system_id, username, password, salt, realname, avatar, phone, email, sex, 
-    ctime
+    status, ctime
   </sql>
   <select id="selectByExample" parameterType="com.zheng.upms.dao.model.UpmsUserExample" resultMap="BaseResultMap">
     select
@@ -118,11 +119,11 @@
     insert into upms_user (user_id, system_id, username, 
       password, salt, realname, 
       avatar, phone, email, 
-      sex, ctime)
+      sex, status, ctime)
     values (#{userId,jdbcType=INTEGER}, #{systemId,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, 
       #{password,jdbcType=VARCHAR}, #{salt,jdbcType=VARCHAR}, #{realname,jdbcType=VARCHAR}, 
       #{avatar,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, 
-      #{sex,jdbcType=TINYINT}, #{ctime,jdbcType=BIGINT})
+      #{sex,jdbcType=TINYINT}, #{status,jdbcType=TINYINT}, #{ctime,jdbcType=BIGINT})
   </insert>
   <insert id="insertSelective" parameterType="com.zheng.upms.dao.model.UpmsUser">
     insert into upms_user
@@ -157,6 +158,9 @@
       <if test="sex != null">
         sex,
       </if>
+      <if test="status != null">
+        status,
+      </if>
       <if test="ctime != null">
         ctime,
       </if>
@@ -192,6 +196,9 @@
       <if test="sex != null">
         #{sex,jdbcType=TINYINT},
       </if>
+      <if test="status != null">
+        #{status,jdbcType=TINYINT},
+      </if>
       <if test="ctime != null">
         #{ctime,jdbcType=BIGINT},
       </if>
@@ -236,6 +243,9 @@
       <if test="record.sex != null">
         sex = #{record.sex,jdbcType=TINYINT},
       </if>
+      <if test="record.status != null">
+        status = #{record.status,jdbcType=TINYINT},
+      </if>
       <if test="record.ctime != null">
         ctime = #{record.ctime,jdbcType=BIGINT},
       </if>
@@ -256,6 +266,7 @@
       phone = #{record.phone,jdbcType=VARCHAR},
       email = #{record.email,jdbcType=VARCHAR},
       sex = #{record.sex,jdbcType=TINYINT},
+      status = #{record.status,jdbcType=TINYINT},
       ctime = #{record.ctime,jdbcType=BIGINT}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -291,6 +302,9 @@
       <if test="sex != null">
         sex = #{sex,jdbcType=TINYINT},
       </if>
+      <if test="status != null">
+        status = #{status,jdbcType=TINYINT},
+      </if>
       <if test="ctime != null">
         ctime = #{ctime,jdbcType=BIGINT},
       </if>
@@ -308,6 +322,7 @@
       phone = #{phone,jdbcType=VARCHAR},
       email = #{email,jdbcType=VARCHAR},
       sex = #{sex,jdbcType=TINYINT},
+      status = #{status,jdbcType=TINYINT},
       ctime = #{ctime,jdbcType=BIGINT}
     where user_id = #{userId,jdbcType=INTEGER}
   </update>

+ 39 - 1
zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/model/UpmsOrganization.java

@@ -3,14 +3,41 @@ package com.zheng.upms.dao.model;
 import java.io.Serializable;
 
 public class UpmsOrganization implements Serializable {
+    /**
+     * 编号
+     *
+     * @mbg.generated
+     */
     private Integer organizationId;
 
+    /**
+     * 所属系统
+     *
+     * @mbg.generated
+     */
     private Integer systemId;
 
+    /**
+     * 组织名称
+     *
+     * @mbg.generated
+     */
     private String name;
 
+    /**
+     * 组织描述
+     *
+     * @mbg.generated
+     */
     private String description;
 
+    /**
+     * 创建时间
+     *
+     * @mbg.generated
+     */
+    private Long ctime;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getOrganizationId() {
@@ -45,6 +72,14 @@ public class UpmsOrganization implements Serializable {
         this.description = description;
     }
 
+    public Long getCtime() {
+        return ctime;
+    }
+
+    public void setCtime(Long ctime) {
+        this.ctime = ctime;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -55,6 +90,7 @@ public class UpmsOrganization implements Serializable {
         sb.append(", systemId=").append(systemId);
         sb.append(", name=").append(name);
         sb.append(", description=").append(description);
+        sb.append(", ctime=").append(ctime);
         sb.append("]");
         return sb.toString();
     }
@@ -74,7 +110,8 @@ public class UpmsOrganization implements Serializable {
         return (this.getOrganizationId() == null ? other.getOrganizationId() == null : this.getOrganizationId().equals(other.getOrganizationId()))
             && (this.getSystemId() == null ? other.getSystemId() == null : this.getSystemId().equals(other.getSystemId()))
             && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
-            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()));
+            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
+            && (this.getCtime() == null ? other.getCtime() == null : this.getCtime().equals(other.getCtime()));
     }
 
     @Override
@@ -85,6 +122,7 @@ public class UpmsOrganization implements Serializable {
         result = prime * result + ((getSystemId() == null) ? 0 : getSystemId().hashCode());
         result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
         result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
+        result = prime * result + ((getCtime() == null) ? 0 : getCtime().hashCode());
         return result;
     }
 }

+ 60 - 0
zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/model/UpmsOrganizationExample.java

@@ -386,6 +386,66 @@ public class UpmsOrganizationExample implements Serializable {
             addCriterion("description not between", value1, value2, "description");
             return (Criteria) this;
         }
+
+        public Criteria andCtimeIsNull() {
+            addCriterion("ctime is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCtimeIsNotNull() {
+            addCriterion("ctime is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCtimeEqualTo(Long value) {
+            addCriterion("ctime =", value, "ctime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCtimeNotEqualTo(Long value) {
+            addCriterion("ctime <>", value, "ctime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCtimeGreaterThan(Long value) {
+            addCriterion("ctime >", value, "ctime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCtimeGreaterThanOrEqualTo(Long value) {
+            addCriterion("ctime >=", value, "ctime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCtimeLessThan(Long value) {
+            addCriterion("ctime <", value, "ctime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCtimeLessThanOrEqualTo(Long value) {
+            addCriterion("ctime <=", value, "ctime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCtimeIn(List<Long> values) {
+            addCriterion("ctime in", values, "ctime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCtimeNotIn(List<Long> values) {
+            addCriterion("ctime not in", values, "ctime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCtimeBetween(Long value1, Long value2) {
+            addCriterion("ctime between", value1, value2, "ctime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCtimeNotBetween(Long value1, Long value2) {
+            addCriterion("ctime not between", value1, value2, "ctime");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria implements Serializable {

+ 29 - 1
zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/model/UpmsPermission.java

@@ -3,10 +3,27 @@ package com.zheng.upms.dao.model;
 import java.io.Serializable;
 
 public class UpmsPermission implements Serializable {
+    /**
+     * 编号
+     *
+     * @mbg.generated
+     */
     private Integer permissionId;
 
+    /**
+     * 所属系统
+     *
+     * @mbg.generated
+     */
     private Integer systemId;
 
+    /**
+     * 权限值
+     *
+     * @mbg.generated
+     */
+    private String permissionValue;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getPermissionId() {
@@ -25,6 +42,14 @@ public class UpmsPermission implements Serializable {
         this.systemId = systemId;
     }
 
+    public String getPermissionValue() {
+        return permissionValue;
+    }
+
+    public void setPermissionValue(String permissionValue) {
+        this.permissionValue = permissionValue;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -33,6 +58,7 @@ public class UpmsPermission implements Serializable {
         sb.append("Hash = ").append(hashCode());
         sb.append(", permissionId=").append(permissionId);
         sb.append(", systemId=").append(systemId);
+        sb.append(", permissionValue=").append(permissionValue);
         sb.append("]");
         return sb.toString();
     }
@@ -50,7 +76,8 @@ public class UpmsPermission implements Serializable {
         }
         UpmsPermission other = (UpmsPermission) that;
         return (this.getPermissionId() == null ? other.getPermissionId() == null : this.getPermissionId().equals(other.getPermissionId()))
-            && (this.getSystemId() == null ? other.getSystemId() == null : this.getSystemId().equals(other.getSystemId()));
+            && (this.getSystemId() == null ? other.getSystemId() == null : this.getSystemId().equals(other.getSystemId()))
+            && (this.getPermissionValue() == null ? other.getPermissionValue() == null : this.getPermissionValue().equals(other.getPermissionValue()));
     }
 
     @Override
@@ -59,6 +86,7 @@ public class UpmsPermission implements Serializable {
         int result = 1;
         result = prime * result + ((getPermissionId() == null) ? 0 : getPermissionId().hashCode());
         result = prime * result + ((getSystemId() == null) ? 0 : getSystemId().hashCode());
+        result = prime * result + ((getPermissionValue() == null) ? 0 : getPermissionValue().hashCode());
         return result;
     }
 }

+ 70 - 0
zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/model/UpmsPermissionExample.java

@@ -246,6 +246,76 @@ public class UpmsPermissionExample implements Serializable {
             addCriterion("system_id not between", value1, value2, "systemId");
             return (Criteria) this;
         }
+
+        public Criteria andPermissionValueIsNull() {
+            addCriterion("permission_value is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPermissionValueIsNotNull() {
+            addCriterion("permission_value is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPermissionValueEqualTo(String value) {
+            addCriterion("permission_value =", value, "permissionValue");
+            return (Criteria) this;
+        }
+
+        public Criteria andPermissionValueNotEqualTo(String value) {
+            addCriterion("permission_value <>", value, "permissionValue");
+            return (Criteria) this;
+        }
+
+        public Criteria andPermissionValueGreaterThan(String value) {
+            addCriterion("permission_value >", value, "permissionValue");
+            return (Criteria) this;
+        }
+
+        public Criteria andPermissionValueGreaterThanOrEqualTo(String value) {
+            addCriterion("permission_value >=", value, "permissionValue");
+            return (Criteria) this;
+        }
+
+        public Criteria andPermissionValueLessThan(String value) {
+            addCriterion("permission_value <", value, "permissionValue");
+            return (Criteria) this;
+        }
+
+        public Criteria andPermissionValueLessThanOrEqualTo(String value) {
+            addCriterion("permission_value <=", value, "permissionValue");
+            return (Criteria) this;
+        }
+
+        public Criteria andPermissionValueLike(String value) {
+            addCriterion("permission_value like", value, "permissionValue");
+            return (Criteria) this;
+        }
+
+        public Criteria andPermissionValueNotLike(String value) {
+            addCriterion("permission_value not like", value, "permissionValue");
+            return (Criteria) this;
+        }
+
+        public Criteria andPermissionValueIn(List<String> values) {
+            addCriterion("permission_value in", values, "permissionValue");
+            return (Criteria) this;
+        }
+
+        public Criteria andPermissionValueNotIn(List<String> values) {
+            addCriterion("permission_value not in", values, "permissionValue");
+            return (Criteria) this;
+        }
+
+        public Criteria andPermissionValueBetween(String value1, String value2) {
+            addCriterion("permission_value between", value1, value2, "permissionValue");
+            return (Criteria) this;
+        }
+
+        public Criteria andPermissionValueNotBetween(String value1, String value2) {
+            addCriterion("permission_value not between", value1, value2, "permissionValue");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria implements Serializable {

+ 3 - 3
zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/model/UpmsSystem.java

@@ -9,7 +9,7 @@ public class UpmsSystem implements Serializable {
 
     private String basepath;
 
-    private Byte status;
+    private Short status;
 
     private String name;
 
@@ -43,11 +43,11 @@ public class UpmsSystem implements Serializable {
         this.basepath = basepath;
     }
 
-    public Byte getStatus() {
+    public Short getStatus() {
         return status;
     }
 
-    public void setStatus(Byte status) {
+    public void setStatus(Short status) {
         this.status = status;
     }
 

+ 10 - 10
zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/model/UpmsSystemExample.java

@@ -337,52 +337,52 @@ public class UpmsSystemExample implements Serializable {
             return (Criteria) this;
         }
 
-        public Criteria andStatusEqualTo(Byte value) {
+        public Criteria andStatusEqualTo(Short value) {
             addCriterion("status =", value, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusNotEqualTo(Byte value) {
+        public Criteria andStatusNotEqualTo(Short value) {
             addCriterion("status <>", value, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusGreaterThan(Byte value) {
+        public Criteria andStatusGreaterThan(Short value) {
             addCriterion("status >", value, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusGreaterThanOrEqualTo(Byte value) {
+        public Criteria andStatusGreaterThanOrEqualTo(Short value) {
             addCriterion("status >=", value, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusLessThan(Byte value) {
+        public Criteria andStatusLessThan(Short value) {
             addCriterion("status <", value, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusLessThanOrEqualTo(Byte value) {
+        public Criteria andStatusLessThanOrEqualTo(Short value) {
             addCriterion("status <=", value, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusIn(List<Byte> values) {
+        public Criteria andStatusIn(List<Short> values) {
             addCriterion("status in", values, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusNotIn(List<Byte> values) {
+        public Criteria andStatusNotIn(List<Short> values) {
             addCriterion("status not in", values, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusBetween(Byte value1, Byte value2) {
+        public Criteria andStatusBetween(Short value1, Short value2) {
             addCriterion("status between", value1, value2, "status");
             return (Criteria) this;
         }
 
-        public Criteria andStatusNotBetween(Byte value1, Byte value2) {
+        public Criteria andStatusNotBetween(Short value1, Short value2) {
             addCriterion("status not between", value1, value2, "status");
             return (Criteria) this;
         }

+ 73 - 0
zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/model/UpmsUser.java

@@ -3,26 +3,88 @@ package com.zheng.upms.dao.model;
 import java.io.Serializable;
 
 public class UpmsUser implements Serializable {
+    /**
+     * 编号
+     *
+     * @mbg.generated
+     */
     private Integer userId;
 
+    /**
+     * 所属系统
+     *
+     * @mbg.generated
+     */
     private Integer systemId;
 
+    /**
+     * 帐号
+     *
+     * @mbg.generated
+     */
     private String username;
 
+    /**
+     * 密码MD5(密码+盐)
+     *
+     * @mbg.generated
+     */
     private String password;
 
+    /**
+     * 盐
+     *
+     * @mbg.generated
+     */
     private String salt;
 
+    /**
+     * 姓名
+     *
+     * @mbg.generated
+     */
     private String realname;
 
+    /**
+     * 头像
+     *
+     * @mbg.generated
+     */
     private String avatar;
 
+    /**
+     * 电话
+     *
+     * @mbg.generated
+     */
     private String phone;
 
+    /**
+     * 邮箱
+     *
+     * @mbg.generated
+     */
     private String email;
 
+    /**
+     * 性别
+     *
+     * @mbg.generated
+     */
     private Byte sex;
 
+    /**
+     * 状态(-1:封,0:未审核,1:正常)
+     *
+     * @mbg.generated
+     */
+    private Byte status;
+
+    /**
+     * 创建时间
+     *
+     * @mbg.generated
+     */
     private Long ctime;
 
     private static final long serialVersionUID = 1L;
@@ -107,6 +169,14 @@ public class UpmsUser implements Serializable {
         this.sex = sex;
     }
 
+    public Byte getStatus() {
+        return status;
+    }
+
+    public void setStatus(Byte status) {
+        this.status = status;
+    }
+
     public Long getCtime() {
         return ctime;
     }
@@ -131,6 +201,7 @@ public class UpmsUser implements Serializable {
         sb.append(", phone=").append(phone);
         sb.append(", email=").append(email);
         sb.append(", sex=").append(sex);
+        sb.append(", status=").append(status);
         sb.append(", ctime=").append(ctime);
         sb.append("]");
         return sb.toString();
@@ -158,6 +229,7 @@ public class UpmsUser implements Serializable {
             && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
             && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
             && (this.getSex() == null ? other.getSex() == null : this.getSex().equals(other.getSex()))
+            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
             && (this.getCtime() == null ? other.getCtime() == null : this.getCtime().equals(other.getCtime()));
     }
 
@@ -175,6 +247,7 @@ public class UpmsUser implements Serializable {
         result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
         result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
         result = prime * result + ((getSex() == null) ? 0 : getSex().hashCode());
+        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
         result = prime * result + ((getCtime() == null) ? 0 : getCtime().hashCode());
         return result;
     }

+ 60 - 0
zheng-upms/zheng-upms-dao/src/main/java/com/zheng/upms/dao/model/UpmsUserExample.java

@@ -797,6 +797,66 @@ public class UpmsUserExample implements Serializable {
             return (Criteria) this;
         }
 
+        public Criteria andStatusIsNull() {
+            addCriterion("status is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNotNull() {
+            addCriterion("status is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusEqualTo(Byte value) {
+            addCriterion("status =", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotEqualTo(Byte value) {
+            addCriterion("status <>", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThan(Byte value) {
+            addCriterion("status >", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThanOrEqualTo(Byte value) {
+            addCriterion("status >=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThan(Byte value) {
+            addCriterion("status <", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThanOrEqualTo(Byte value) {
+            addCriterion("status <=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIn(List<Byte> values) {
+            addCriterion("status in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotIn(List<Byte> values) {
+            addCriterion("status not in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusBetween(Byte value1, Byte value2) {
+            addCriterion("status between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotBetween(Byte value1, Byte value2) {
+            addCriterion("status not between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
         public Criteria andCtimeIsNull() {
             addCriterion("ctime is null");
             return (Criteria) this;

Некоторые файлы не были показаны из-за большого количества измененных файлов