---------------------------------------------------------
--車輛使用附表:車輛管理相關(guān)表
-----------------------------------------------------------
Declare
n_Is_Exist Number(1) := 0;
Begin
Select Nvl(Count(*), 0) Into n_Is_Exist From User_Tables Where Table_Name = Upper('CLJBXXB');
If n_Is_Exist > 0 Then
Execute Immediate 'Drop Table CLJBXXB Cascade Constraints';
End If;
Select Nvl(Count(*), 0) Into n_Is_Exist From User_Tables Where Table_Name = Upper('KSYCCSXXB');
If n_Is_Exist > 0 Then
Execute Immediate 'Drop Table KSYCCSXXB Cascade Constraints';
End If;
Select Nvl(Count(*), 0) Into n_Is_Exist From User_Tables Where Table_Name = Upper('YCSQB');
If n_Is_Exist > 0 Then
Execute Immediate 'Drop Table YCSQB Cascade Constraints';
End If;
Select Nvl(Count(*), 0) Into n_Is_Exist From User_Tables Where Table_Name = Upper('CLSYJLB');
If n_Is_Exist > 0 Then
Execute Immediate 'Drop Table CLSYJLB Cascade Constraints';
End If;
Select Nvl(Count(*), 0) Into n_Is_Exist From User_Tables Where Table_Name = Upper('KSSYTJB');
If n_Is_Exist > 0 Then
Execute Immediate 'Drop Table KSSYTJB Cascade Constraints';
End If;
Select Nvl(Count(*), 0) Into n_Is_Exist From User_Tables Where Table_Name = Upper('YHTJB');
If n_Is_Exist > 0 Then
Execute Immediate 'Drop Table YHTJB Cascade Constraints';
End If;
End;
/
--車輛基本信息表
CREATE TABLE CLJBXXB
( ID VARCHAR2(36) NOT NULL ,
CLBH VARCHAR2(255) NOT NULL,
CX VARCHAR2(255) ,
PZ VARCHAR2(255) ,
CPH VARCHAR2(255) ,
CLZP BLOB,
ZRR VARCHAR2(36) ,
SFZSY NUMBER(1,0) ,
BZ VARCHAR2(255) ,
CONSTRAINT PK_CLJBXXB PRIMARY KEY (ID)) ;
COMMENT ON COLUMN CLJBXXB.ID IS 'ID';
COMMENT ON COLUMN CLJBXXB.CLBH IS '車輛編號';
COMMENT ON COLUMN CLJBXXB.CX IS '車型';
COMMENT ON COLUMN CLJBXXB.PZ IS '配置';
COMMENT ON COLUMN CLJBXXB.CPH IS '車牌號';
COMMENT ON COLUMN CLJBXXB.CLZP IS '車輛照片';
COMMENT ON COLUMN CLJBXXB.ZRR IS '責(zé)任人';
COMMENT ON COLUMN CLJBXXB.SFZSY IS '是否在使用';
COMMENT ON COLUMN CLJBXXB.BZ IS '備注';
--科室用車初始信息表
CREATE TABLE KSYCCSXXB
( ID VARCHAR2(36) NOT NULL ,
KSMC VARCHAR2(36) NOT NULL ,
CLID VARCHAR2(255) ,
MYEDSYGL NUMBER(18,0) ,
CSJY NUMBER(18,0) ,
BZ VARCHAR2(255) ,
CONSTRAINT PK_KSYCCSXXB PRIMARY KEY (KSMC)) ;
COMMENT ON COLUMN KSYCCSXXB.ID IS 'ID';
COMMENT ON COLUMN KSYCCSXXB.KSMC IS '科室名稱';
COMMENT ON COLUMN KSYCCSXXB.CLID IS '車輛ID';
COMMENT ON COLUMN KSYCCSXXB.MYEDSYGL IS '每月額定使用公里';
COMMENT ON COLUMN KSYCCSXXB.CSJY IS '初始結(jié)余';
COMMENT ON COLUMN KSYCCSXXB.BZ IS '備注';
--用車申請表
CREATE TABLE YCSQB
( ID VARCHAR2(36) NOT NULL ,
CLID VARCHAR2(255) ,
JHKSYCRQ DATE,
JHKSYCSJ DATE,
JHJZYCRQ DATE,
JHJZYCSJ DATE,
CCSY VARCHAR2(255) ,
MDD NUMBER(18,0) ,
SJ VARCHAR2(36) ,
BZ VARCHAR2(255) ,
SQR VARCHAR2(36) ,
SQRSSKS VARCHAR2(36) ,
SQSJ DATE,
SPR VARCHAR2(36) ,
SPSJ DATE,
SJKSYCRQ DATE,
SJKSYCSJ DATE,
SJJZYCRQ DATE,
SJJZYCSJ DATE,
SJDDD VARCHAR2(255) ,
GLS NUMBER(18,0) ,
YH VARCHAR2(255) ,
YHF NUMBER(18,0) ,
QTFY NUMBER(18,0) ,
YCQRR VARCHAR2(255) ,
YCQRSJ DATE,
YF VARCHAR2(255) ,
ZT VARCHAR2(255) ,
DDJLJ VARCHAR2(255) ,
CLMC VARCHAR2(255) ,
PCYJ VARCHAR2(255) ,
CONSTRAINT PK_YCSQB PRIMARY KEY (ID));
COMMENT ON COLUMN YCSQB.ID IS 'ID';
COMMENT ON COLUMN YCSQB.CLID IS '車輛ID';
COMMENT ON COLUMN YCSQB.JHKSYCSJ IS '計(jì)劃開始用車時(shí)間';
COMMENT ON COLUMN YCSQB.JHJZYCRQ IS '計(jì)劃截止用車日期';
COMMENT ON COLUMN YCSQB.JHJZYCSJ IS '計(jì)劃截止用車時(shí)間';
COMMENT ON COLUMN YCSQB.CCSY IS '出車事由'; |
|