<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-295  評論-26  文章-1  trackbacks-0
    /**********************
     * 用戶-產品-訂單模塊
     **********************/
    
    /*
        表名稱: CUSTOMER(客戶信息表)
        ID       (客戶編號)
        NAME     (姓名)
        LOGINID  (登陸ID)
        PASSWD   (密碼)
        EMAIL    (EMAIL)
        ADDRESS  (地址)
        STATUS   (狀態)
    */
    create table customer (
        id int not null identity,
        name varchar(80) not null,
        loginid varchar(20) not null,
        passwd varchar(255) not null,
        email varchar(80) null,
        address varchar(80) null,
        status varchar(20)  null,
        constraint pk_customer primary key (id)
    );
    
    /*
    	表名稱: CATEGORY(產品類別表)
    	ID    (類別編碼)
    	NAME  (類別名)
    	DESCN (描述)
    	Primary Key: PK_CATEGORY PRIMARY KEY(ID)
    */
    create table category (
    	id int not null identity,
    	name varchar(80) not null,
    	descn varchar(255) null,
    	constraint pk_category primary key (id)
    );
    
    /*
    	表名稱: PRODUCT(產品表)
    	ID             (產品編碼)
    	CATEGORY_ID    (類別ID)
            NAME           (產品名稱)
    	DESCN          (描述)
    	INVENTORY      (存貨)
    	UNITPRICE      (單價)
    	STATUS         (狀態)
    	ATTR1          (自定義屬性1)
    	ATTR2          (自定義屬性2)
    	ATTR3          (自定義屬性3)
    	ATTR4          (自定義屬性4)
    	TYPE           (類型)
            CREATETIME     (創建的日期)
            CREATE_USER_ID (創建的操作員)
            MODIFYTIME     (最后一次修改的日期)
            MODIFY_USER_ID (最后一次修改的操作員)
    	*/
    create table product (
        id int not null identity,
        category_id int not null,
        name varchar(80) not null,
        descn varchar(255) null,
        inventory int null,
        unitprice decimal(10,2) null,
        status varchar(20) null,
        attr1 varchar(255) null,
        attr2 varchar(255) null,
        attr3 varchar(255) null,
        attr4 varchar(255) null,
        type varchar(20) default 'product',
        createtime date null,
        create_user_id int null,
        modifytime date null,
        modify_user_id int null,
        constraint pk_product primary key (id),
        constraint fk_product_1 foreign key (category_id)
        references category (id),
        constraint fk_product_2 foreign key (create_user_id)
        references users (id),
        constraint fk_product_3 foreign key (modify_user_id)
        references users (id)
    );
    
    /*
    	表名稱: ORDERS(訂單信息表)
    	ID             (訂單編碼)
    	CUSTOMER_ID    (用戶編碼)
    	ORDERDATE      (下訂日期)
    	TOTALPRICE     (總費用)
    	ORIGINALPRICE   (原價格)
    	APPLYRULES     (所使用的促銷規則)
    	REGION         (送貨地區)
    	SHIPADDR       (發貨地址)
    	SHIPDATE       (發貨日期)
    	STATUS         (訂單狀態)
    */
    create table orders (
          id int not null identity,
          customer_id int not null,
          orderdate date not null,
          totalprice decimal(10,2) not null,
          originalprice decimal(10,2),
          applyRules varchar(255) ,
          region varchar(255),
          shipaddr varchar(80) ,
          shipdate date ,
          status varchar(2) default '1',
          constraint pk_orders primary key (id),
          constraint FK_ORDERS_1 foreign key (CUSTOMER_ID) REFERENCES CUSTOMER(ID)
    
    );
    
    /*
    	表名稱: ORDER_ITEM(訂單貨物表)
    	ORDER_ID       (訂單編碼)
    	LINENUM        (訂單行號)
    	PRODUCT_ID     (產品編碼)
    	QUANTITY       (數量)
    	UNITPRICE      (單價)
    */
    create table order_item (
          order_id int not null,
          linenum int not null,
          product_id int not null,
          quantity int not null,
          unitprice decimal(10,2) not null,
          constraint pk_orderitem primary key (order_id, linenum),
          constraint FK_ITEM_1 foreign key (ORDER_ID) REFERENCES orders(ID),
          constraint FK_ITEM_2 foreign key (PRODUCT_ID) REFERENCES PRODUCT(ID)
    );
    
    /****************************
     * 管理員及安全模塊
     ****************************/
    
    /*
    	表名稱: log4j_log(日志信息)
    	ID             (序號)
    	LOGINID        (登陸ID)
    	PRIORITY       (級別)
    	LOGDATE        (時間)
    	CLASS          (類名)
    	METHOD         (方法名)
    	MSG            (信息)
    */
    create table log4j_log(
          id int not null identity,
          loginid varchar(20) not null,
          priority varchar(10) not null,
          logdate varchar(21) not null,
          class   varchar(255) not null,
          method varchar(100) null,
          msg varchar(255) null,
          constraint pk_log4j_msg primary key (id)
    );
    
    
    /*
      表名稱:change_history(領域對象修改記錄)
    */
    create table change_history(
        id int not null identity,
        entitytype varchar(20) not null,
        entityid   int not null,
        changeColumns varchar(255) null,
        constraint pk_product primary key (id)
    );
    /*
    	表名稱: users(用戶)
    	loginid 登陸ID
    	passwd 密碼
    	name   用戶名
    	email  郵箱
    	region 管理地區
    	status 狀態
    	descn  用戶描述
    */
    create table users(
          id int not null identity,
          loginid varchar(20) not null,
          passwd varchar(255) not null,
          name varchar(80) not null,
          email varchar(255),
          region varchar(255),
          status VARCHAR(2) default 1,
          descn varchar(255) null,
          constraint pk_users primary key (id)
    );
    
    /*
    	表名稱: roles(角色)
    	name 角色名稱
    	descn 角色描述
    */
    create table roles(
          id int not null identity,
          name varchar(80) not null,
          descn varchar(255) null,
          constraint pk_roles primary key (id)
    );
    
    /*
      表名稱:  user_role(用戶角色表)
      user_id 用戶ID
      role_id 角色ID
    */
    create table user_role
    (
      user_id int not null,
      role_id int not null,
      constraint pk_user_role primary key (user_id,role_id),
      constraint fk_user_role_1 foreign key (user_id) REFERENCES users(ID),
      constraint fk_user_role_2 foreign key (role_id) REFERENCES roles(ID)
    );
    
    /*
      表名稱: permissions  (權限)
      name    權限名稱
      descn   描述
      operation 操作
      status 狀態
    */
    create table permissions
    (
      id            int not null identity,
      name          varchar(80) not null,
      descn         varchar(255) null,
      operation     varchar(80) null,
      status VARCHAR(2) default '1',
      constraint pk_permissons primary key (id)
    );
    
    /*
      表名稱: role_permis(角色權限)
      role_id 角色ID
      permis_id 權限ID
    */
    create table role_permis
    (
      role_id int not null,
      permis_id int not null,
      constraint pk_role_permis primary key (role_id,permis_id),
      constraint fk_role_role_permis_1 foreign key (role_id) REFERENCES roles(ID),
      constraint fk_role_role_permis_2 foreign key (permis_id) REFERENCES permissions(ID)
    );
    
    /*
      表名稱: resources  (資源)
      name  資源名稱(模塊名稱)
      res_type 資源類型
      res_string 資源串
      descn  資源描述
    */
    create table resources
    (
      id            int not null identity,
      name          varchar(80) not null,
      res_type varchar(20) not null,
      res_string varchar(255) not null,
      descn         varchar(255) null,
      constraint pk_resources primary key (id)
    );
    
    /*
      表名稱: permis_resc(權限資源)
      resource_id   資源ID
      operation_id  操作ID
    
    */
    create table permis_resc
    (
      permis_id  int not null,
      resc_id   int not null,
      constraint pk_permis_resc primary key (permis_id,resc_id),
      constraint fk_role_permis_resc_1 foreign key (resc_id) REFERENCES resources(ID),
      constraint fk_role_permis_resc_2 foreign key (permis_id) REFERENCES permissions(ID)
    );
    
    /*
      表名稱: acl_object_identity(保護的ACLDomain對象列表)
      object_identity   受保護的ACL對象的標識符,一般是ClassName + ID
      parent_object  該對象關聯的父對象
      acl_class  Acegi用來描述該類的Class,一般用來表示Mark等信息
    */
    create table acl_object_identity (
      id            int not null identity,
      object_identity varchar(250) not null,
      parent_object integer,
      acl_class varchar(250) NOT NULL,
      constraint unique_object_identity unique(object_identity), 
      foreign key (parent_object) REFERENCES acl_object_identity(id)
    );
    
    /*
      表名稱: permis_resc(ACL授權列表)
      acl_object_identity   對應acl_object_identity表的id,表示一個Acl保護的對象。
      recipient  用戶名或角色名
      mask  所授權限
    */
    create table acl_permission (
      id            int not null identity,
      acl_object_identity integer not null,
      recipient varchar(100) NOT NULL,
      mask integer not null,
      constraint unique_recipient unique(acl_object_identity, recipient),
      foreign key (acl_object_identity) REFERENCES acl_object_identity(id)
    );
    


    大盤預測 國富論
    posted on 2008-01-21 20:19 華夢行 閱讀(205) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 免费福利在线视频| 国产福利电影一区二区三区,免费久久久久久久精 | 亚洲精品黄色视频在线观看免费资源| 亚洲videosbestsex日本| 可以免费看黄的网站| 亚洲午夜电影在线观看| 两性刺激生活片免费视频| 国产亚洲国产bv网站在线| 成人奭片免费观看| 亚洲欧美一区二区三区日产| 日韩黄色免费观看| 久久亚洲中文字幕无码| 亚洲国产精品成人一区| 男女拍拍拍免费视频网站| 亚洲香蕉成人AV网站在线观看| 国产午夜无码精品免费看| 亚洲黄色网址大全| 在人线av无码免费高潮喷水| 亚洲欧洲无码一区二区三区| 免费国产一级特黄久久| 两性色午夜免费视频| 夜夜亚洲天天久久| 好吊妞在线成人免费| 黄色毛片免费网站| 亚洲国产精品无码久久久秋霞2| 一级毛片免费播放| 亚洲天然素人无码专区| 免费国产高清视频| 人人玩人人添人人澡免费| 亚洲国产成人久久综合一区| 成人毛片免费播放| 亚洲日韩在线观看免费视频| 久久亚洲AV成人出白浆无码国产| 无码高潮少妇毛多水多水免费| 免费一区二区无码视频在线播放| 亚洲成A人片777777| 国产成人A在线观看视频免费| 四虎成人精品国产永久免费无码 | 四虎永久在线精品免费影视| 少妇性饥渴无码A区免费| 亚洲熟妇自偷自拍另欧美|