---------------------------------------------------------
--车辆使用附表:车辆管理相关表
-----------------------------------------------------------
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 '责任人';
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 '初始结余';
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 '计划开始用车时间';
COMMENT ON COLUMN YCSQB.JHJZYCRQ IS '计划截止用车日期';
COMMENT ON COLUMN YCSQB.JHJZYCSJ IS '计划截止用车时间';
COMMENT ON COLUMN YCSQB.CCSY IS '出车事由'; |
|