db DDL 반영

dev
Jonguk. Lim 6 months ago
parent be1f4522db
commit 0edad33de1

@ -1,56 +1,61 @@
create table tb_dsuse_mgt CREATE TABLE tb_dsuse_mgt
( (
dscdmng_id varchar(10) not null comment '폐기관리_id' dscdmng_id varchar(10) NOT NULL COMMENT '폐기관리_id',
primary key, user_id varchar(10) NULL COMMENT '사용자_아이디',
user_id varchar(10) null comment '사용자_아이디', prgrs_stts_cd varchar(10) NULL COMMENT '진행_상태_코드',
prgrs_stts_cd varchar(10) null comment '진행_상태_코드', bssh_cd varchar(10) NOT NULL COMMENT '마약류취급자식별_번호',
bssh_cd varchar(10) not null comment '마약류취급자식별_번호', rnd_dtl_rpt_cnt decimal NULL COMMENT '수불_상세_보고_수',
rnd_dtl_rpt_cnt decimal null comment '수불_상세_보고_수', hdr_de varchar(8) NULL COMMENT '취급_일자',
hdr_de varchar(8) null comment '취급_일자', rpt_de varchar(8) NULL COMMENT '보고_일자',
rpt_de varchar(8) null comment '보고_일자', dsuse_se_cd varchar(10) NULL COMMENT '폐기_구분_코드',
dsuse_se_cd varchar(10) null comment '폐기_구분_코드', dsuse_prv_cd varchar(10) NULL COMMENT '폐기_사유_코드',
dsuse_prv_cd varchar(10) null comment '폐기_사유_코드', dsuse_mth_cd varchar(10) NULL COMMENT '폐기_방법_코드',
dsuse_mth_cd varchar(10) null comment '폐기_방법_코드', dsuse_loc varchar(120) NULL COMMENT '폐기_장소',
dsuse_loc varchar(120) null comment '폐기_장소', dsuse_de varchar(8) NULL COMMENT '폐기_일자',
dsuse_de varchar(8) null comment '폐기_일자', usr_rpt_id_no varchar(30) NULL COMMENT '사용자_보고_식별_번호',
usr_rpt_id_no varchar(30) null comment '사용자_보고_식별_번호', org_usr_rpt_id_no varchar(30) NULL COMMENT '원_사용자_보고_식별_번호',
org_usr_rpt_id_no varchar(30) null comment '원_사용자_보고_식별_번호', rpt_ty_cd varchar(1) NULL COMMENT '보고_유형_코드',
rpt_ty_cd varchar(1) null comment '보고_유형_코드', stts varchar(1) NULL COMMENT '처리상태',
stts varchar(1) null comment '처리상태', use_yn varchar(1) NOT NULL COMMENT '사용_여부',
use_yn varchar(1) not null comment '사용_여부', reg_dt varchar(14) NOT NULL COMMENT '등록_일시',
reg_dt varchar(14) not null comment '등록_일시', rgtr varchar(10) NOT NULL COMMENT '등록자',
rgtr varchar(10) not null comment '등록자', mdfcn_dt varchar(14) NULL COMMENT '수정_일시',
mdfcn_dt varchar(14) null comment '수정_일시', mdfr varchar(10) NULL COMMENT '수정자',
mdfr varchar(10) null comment '수정자' PRIMARY KEY (dscdmng_id)
) ) COMMENT '폐기관리';
comment '폐기관리';
create index idx_tb_dsuse_mgt_01 CREATE INDEX idx_tb_dsuse_mgt_01
on tb_dsuse_mgt (org_usr_rpt_id_no, usr_rpt_id_no); ON tb_dsuse_mgt (org_usr_rpt_id_no ASC, usr_rpt_id_no ASC);
create table tb_dsuse_mgt_dtl CREATE TABLE tb_dsuse_mgt_dtl
( (
dscdmng_id varchar(10) not null comment '폐기관리_id', dscdmng_id varchar(10) NOT NULL COMMENT '폐기관리_id',
dscdmng_sn varchar(3) not null comment '폐기관리_순번', dscdmng_sn varchar(3) NOT NULL COMMENT '폐기관리_순번',
prduct_cd varchar(14) not null comment '제품_코드', prduct_cd varchar(14) NOT NULL COMMENT '제품_코드',
prduct_nm varchar(300) null comment '제품_명', prduct_nm varchar(300) NULL COMMENT '제품_명',
min_distb_qy decimal null comment '최소_유통단위_수량', min_distb_qy decimal NULL COMMENT '최소_유통단위_수량',
pce_qy decimal null comment '낱개단위_수량', pce_qy decimal NULL COMMENT '낱개단위_수량',
mnf_no varchar(20) null comment '제조_번호', mnf_no varchar(20) NULL COMMENT '제조_번호',
prd_valid_de varchar(8) null comment '제품_유효기한_일자', prd_valid_de varchar(8) NULL COMMENT '제품_유효기한_일자',
mnf_seq varchar(42) null comment '제조_일련번호', mnf_seq varchar(42) NULL COMMENT '제조_일련번호',
dsuse_qy decimal not null comment '폐기_수량', dsuse_qy decimal NOT NULL COMMENT '폐기_수량',
usr_rpt_id_no varchar(30) null comment '사용자_보고_식별_번호', usr_rpt_id_no varchar(30) NULL COMMENT '사용자_보고_식별_번호',
usr_rpt_ln_id_no varchar(35) null comment '사용자_보고_라인_식별_번호', usr_rpt_ln_id_no varchar(35) NULL COMMENT '사용자_보고_라인_식별_번호',
use_yn varchar(1) not null comment '사용_여부', use_yn varchar(1) NOT NULL COMMENT '사용_여부',
reg_dt varchar(14) not null comment '등록_일시', reg_dt varchar(14) NOT NULL COMMENT '등록_일시',
rgtr varchar(10) not null comment '등록자', rgtr varchar(10) NOT NULL COMMENT '등록자',
mdfcn_dt varchar(14) null comment '수정_일시', mdfcn_dt varchar(14) NULL COMMENT '수정_일시',
mdfr varchar(10) null comment '수정자', mdfr varchar(10) NULL COMMENT '수정자',
primary key (dscdmng_id, dscdmng_sn) PRIMARY KEY (dscdmng_id, dscdmng_sn)
) ) COMMENT '폐기관리_상세';
comment '폐기관리_상세';
create index idx_tb_dsuse_mgt_dtl_01 CREATE INDEX idx_tb_dsuse_mgt_dtl_01
on tb_dsuse_mgt_dtl (usr_rpt_id_no, usr_rpt_ln_id_no); ON tb_dsuse_mgt_dtl (usr_rpt_id_no ASC, usr_rpt_ln_id_no ASC);
ALTER TABLE tb_dsuse_mgt_dtl
ADD CONSTRAINT FK_tb_dsuse_mgt_TO_tb_dsuse_mgt_dtl
FOREIGN KEY (dscdmng_id)
REFERENCES tb_dsuse_mgt (dscdmng_id);
CREATE TABLE tb_dsuse_rpt_info CREATE TABLE tb_dsuse_rpt_info
( (
@ -70,7 +75,7 @@ CREATE TABLE tb_dsuse_rpt_info
dsuse_de varchar(80) NULL COMMENT '폐기_일자', dsuse_de varchar(80) NULL COMMENT '폐기_일자',
status varchar(1) NULL COMMENT '처리상태(0-정상,1-취소,2-변경)', status varchar(1) NULL COMMENT '처리상태(0-정상,1-취소,2-변경)',
rpt_prg_stts_cd varchar(10) NULL COMMENT '보고_진행_상태_코드', rpt_prg_stts_cd varchar(10) NULL COMMENT '보고_진행_상태_코드',
org_usr_rpt_id_no varchar(30) null comment '원_사용자_보고_식별_번호', org_usr_rpt_id_no varchar(30) NULL COMMENT '원_사용자_보고_식별_번호',
use_yn varchar(1) NOT NULL COMMENT '사용_여부', use_yn varchar(1) NOT NULL COMMENT '사용_여부',
reg_dt varchar(14) NOT NULL COMMENT '등록_일시', reg_dt varchar(14) NOT NULL COMMENT '등록_일시',
rgtr varchar(10) NOT NULL COMMENT '등록자', rgtr varchar(10) NOT NULL COMMENT '등록자',
@ -78,8 +83,6 @@ CREATE TABLE tb_dsuse_rpt_info
mdfr varchar(10) NULL COMMENT '수정자', mdfr varchar(10) NULL COMMENT '수정자',
PRIMARY KEY (usr_rpt_id_no) PRIMARY KEY (usr_rpt_id_no)
) COMMENT '폐기_보고_정보'; ) COMMENT '폐기_보고_정보';
create or replace index idx_tb_dsuse_rpt_info_01
on tb_dsuse_rpt_info (org_usr_rpt_id_no);
CREATE TABLE tb_dsuse_rpt_info_dtl CREATE TABLE tb_dsuse_rpt_info_dtl
( (
@ -98,11 +101,15 @@ CREATE TABLE tb_dsuse_rpt_info_dtl
rgtr varchar(10) NOT NULL COMMENT '등록자', rgtr varchar(10) NOT NULL COMMENT '등록자',
mdfcn_dt varchar(14) NULL COMMENT '수정_일시', mdfcn_dt varchar(14) NULL COMMENT '수정_일시',
mdfr varchar(10) NULL COMMENT '수정자', mdfr varchar(10) NULL COMMENT '수정자',
PRIMARY KEY (usr_rpt_id_no, usr_rpt_ln_id_no), PRIMARY KEY (usr_rpt_id_no, usr_rpt_ln_id_no)
constraint fk_dsuse_rpt_info_dtl_to_dsuse_rpt_info
foreign key (usr_rpt_id_no) references tb_dsuse_mgt (usr_rpt_id_no)
) COMMENT '폐기_보고_정보_상세'; ) COMMENT '폐기_보고_정보_상세';
ALTER TABLE tb_dsuse_rpt_info_dtl
ADD CONSTRAINT FK_tb_dsuse_rpt_info_TO_tb_dsuse_rpt_info_dtl
FOREIGN KEY (usr_rpt_id_no)
REFERENCES tb_dsuse_rpt_info (usr_rpt_id_no);
CREATE TABLE tb_bssh_info CREATE TABLE tb_bssh_info
( (
bssh_cd varchar(10) NOT NULL COMMENT '마약류취급자식별_번호', bssh_cd varchar(10) NOT NULL COMMENT '마약류취급자식별_번호',
@ -123,10 +130,8 @@ CREATE TABLE tb_bssh_info
mdfcn_dt varchar(14) NULL COMMENT '수정_일시', mdfcn_dt varchar(14) NULL COMMENT '수정_일시',
mdfr varchar(10) NULL COMMENT '수정자', mdfr varchar(10) NULL COMMENT '수정자',
PRIMARY KEY (bssh_cd) PRIMARY KEY (bssh_cd)
) COMMENT '취급자_정보'; ) COMMENT '취급자_정보';
CREATE TABLE tb_prduct_info CREATE TABLE tb_prduct_info
( (
prduct_cd varchar(14) NOT NULL COMMENT '제품_코드', prduct_cd varchar(14) NOT NULL COMMENT '제품_코드',
@ -149,41 +154,6 @@ CREATE TABLE tb_prduct_info
PRIMARY KEY (prduct_cd) PRIMARY KEY (prduct_cd)
) COMMENT '품목_정보'; ) COMMENT '품목_정보';
CREATE TABLE tb_storge_info
(
bssh_cd varchar(10) NOT NULL COMMENT '마약류취급자식별_번호',
bssh_nm varchar(120) NULL COMMENT '업체_명',
use_at char NULL COMMENT '사용_유무',
storge_se_nm varchar(200) NULL COMMENT '저장소_유형',
storge_no varchar(16) NULL COMMENT '저장소_번호',
storge_nm varchar(100) NULL COMMENT '저장소_명',
bass_adres varchar(200) NULL COMMENT '기본_주소',
bass_dtl_adres varchar(200) NULL COMMENT '상세_주소',
use_yn varchar(1) NOT NULL COMMENT '사용_여부',
reg_dt varchar(14) NOT NULL COMMENT '등록_일시',
rgtr varchar(10) NOT NULL COMMENT '등록자',
mdfcn_dt varchar(14) NULL COMMENT '수정_일시',
mdfr varchar(10) NULL COMMENT '수정자',
PRIMARY KEY (bssh_cd)
) COMMENT '저장소_정보';
CREATE TABLE tb_jrdt_gov_info
(
bssh_cd varchar(10) NOT NULL COMMENT '마약류취급자식별_번호',
of_cd varchar(10) NULL COMMENT '기관_코드',
of_nm varchar(100) NULL COMMENT '기관_명',
up_of_nm varchar(100) NULL COMMENT '상위_기관_명',
top_of_nm varchar(100) NULL COMMENT '최상위_기관_명',
bass_adres varchar(200) NULL COMMENT '기본_주소',
bass_dtl_adres varchar(200) NULL COMMENT '상세_주소',
use_yn varchar(1) NOT NULL COMMENT '사용_여부',
reg_dt varchar(14) NOT NULL COMMENT '등록_일시',
rgtr varchar(10) NOT NULL COMMENT '등록자',
mdfcn_dt varchar(14) NULL COMMENT '수정_일시',
mdfr varchar(10) NULL COMMENT '수정자',
PRIMARY KEY (bssh_cd)
) COMMENT '관할_관청_정보';
CREATE TABLE tb_cmm_api_log CREATE TABLE tb_cmm_api_log
( (
request_id varchar(40) NOT NULL COMMENT '요청 id', request_id varchar(40) NOT NULL COMMENT '요청 id',
@ -215,67 +185,8 @@ CREATE TABLE tb_cmm_refresh_token
) COMMENT '리프레쉬토큰'; ) COMMENT '리프레쉬토큰';
CREATE TABLE tb_purchase_info
(
rptr_entrps_nm varchar(120) NULL COMMENT '판매_업체_명',
prduct_nm varchar(300) NULL COMMENT '제품_명',
hdr_de char(8) NULL COMMENT '취급_일자',
mnf_no varchar(20) NULL COMMENT '제조_번호',
mnf_seq varchar(42) NULL COMMENT '제조_일련번호',
min_distb_qy decimal NULL COMMENT '최소_유통단위_수량',
prd_min_distb_unit varchar(10) NULL COMMENT '제품_최소_유통_단위',
prd_min_distb_qy decimal NULL COMMENT '제품_최소_유통단위_수량',
pce_qy decimal NULL COMMENT '낱개단위_수량',
prd_tot_pce_qy decimal NULL COMMENT '제품_총_낱개단위_수량',
prd_pce_unit varchar(10) NULL COMMENT '제품_낱개_단위',
storge_no varchar(16) NULL COMMENT '저장소_번호',
storge_nm varchar(100) NULL COMMENT '저장소_명',
bizrno varchar(10) NULL COMMENT '사업자등록번호',
prd_sgtin varchar(68) NULL COMMENT '제품_바코드',
prd_valid_de varchar(8) NULL COMMENT '제품_유효기한_일자',
pcm_rpt_at varchar(1) NULL COMMENT '구입보고존재여부',
usr_rpt_id_no varchar(30) NULL COMMENT '판매사용자_보고_식별_번호',
chrg_nm varchar(120) NULL COMMENT '판매담당자_명',
chrg_tel_no varchar(60) NULL COMMENT '판매담당자_전화_번호',
ref_usr_rpt_id_no varchar(22) NULL COMMENT '참조_사용자_보고_식별_번호',
prtm_se_nm varchar(200) NULL COMMENT '중점/일반_구분',
rpt_de char(8) NULL COMMENT '보고_일자',
rpt_ty_nm varchar(1) NULL COMMENT '보고_유형_명',
induty_cd_nm varchar(200) NULL COMMENT '판매업체업종_명',
bssh_cd varchar(10) NOT NULL COMMENT '판매업체식별_번호',
prduct_cd varchar(14) NOT NULL COMMENT '제품_코드',
use_yn varchar(1) NOT NULL,
reg_dt varchar(14) NOT NULL,
rgtr varchar(10) NOT NULL,
mdfcn_dt varchar(14) NULL ,
mdfr varchar(10) NULL ,
PRIMARY KEY (bssh_cd, prduct_cd)
) COMMENT '구입대상_정보';
CREATE TABLE tb_stock_info
(
storge_no varchar(16) NOT NULL COMMENT '저장소_번호',
prduct_cd varchar(14) NOT NULL COMMENT '제품_코드',
storge_nm varchar(100) NULL COMMENT '저장소_명',
prduct_nm varchar(300) NULL COMMENT '제품_명',
mnf_no varchar(20) NULL COMMENT '제조_번호',
prd_valid_de char(8) NULL COMMENT '제품_유효_기한',
mnf_seq varchar(42) NULL COMMENT '제조_일련번호',
prd_min_distb_unit varchar(100) NULL COMMENT '제품_최소_유통_단위',
prd_tot_pce_qy int NULL COMMENT '제품_총_낱개단위_수량',
pce_invt_qy decimal NULL COMMENT '낱개단위_재고_수량',
prd_pce_unit varchar(100) NULL COMMENT '제품_낱개_단위',
prtm_se_cd varchar(200) NULL COMMENT '중점/일반관리_구분_코드',
storge_se_nm varchar(200) NULL COMMENT '저장소_구분_명',
min_distb_invt_qy decimal NULL COMMENT '최소_유통_단위재고_수량',
hdr_de char(8) NULL COMMENT '취급_일자',
ddln_ym char(8) NULL COMMENT '재고기준_년월',
use_yn varchar(1) NOT NULL,
reg_dt varchar(14) NOT NULL,
rgtr varchar(10) NOT NULL,
mdfcn_dt varchar(14) NULL ,
mdfr varchar(10) NULL ,
PRIMARY KEY (storge_no, prduct_cd)
) COMMENT '재고_정보';

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save