﻿/* Sequence 저장테이블 */
CREATE TABLE COMTECOPSEQ
(
	TABLE_NAME            VARCHAR(60)  NOT NULL ,
	NEXT_ID               NUMERIC(30)  NULL ,
CONSTRAINT  COMTECOPSEQ_PK PRIMARY KEY (TABLE_NAME)
);




/* 공통분류코드 */
CREATE TABLE COMTCCMMNCLCODE
(
	CL_CODE               CHAR(3)  NOT NULL ,
	CL_CODE_NM            VARCHAR(180)  NULL ,
	CL_CODE_DC            VARCHAR(600)  NULL ,
	USE_AT                CHAR(1)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
CONSTRAINT  COMTCCMMNCLCODE_PK PRIMARY KEY (CL_CODE)
);




/* 공통코드 */
CREATE TABLE COMTCCMMNCODE
(
	CODE_ID               VARCHAR(18)  NOT NULL ,
	CODE_ID_NM            VARCHAR(180)  NULL ,
	CODE_ID_DC            VARCHAR(600)  NULL ,
	USE_AT                CHAR(1)  NULL ,
	CL_CODE               CHAR(3)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
CONSTRAINT  COMTCCMMNCODE_PK PRIMARY KEY (CODE_ID)
);




/* 공통상세코드 */
CREATE TABLE COMTCCMMNDETAILCODE
(
	CODE_ID               VARCHAR(18)  NOT NULL ,
	CODE                  VARCHAR(45)  NOT NULL ,
	CODE_NM               VARCHAR(180)  NULL ,
	CODE_DC               VARCHAR(600)  NULL ,
	USE_AT                CHAR(1)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
CONSTRAINT  COMTCCMMNDETAILCODE_PK PRIMARY KEY (CODE_ID,CODE)
);




/* 권한그룹정보 */
CREATE TABLE COMTNAUTHORGROUPINFO
(
	GROUP_ID              CHAR(20)  NOT NULL ,
	GROUP_NM              VARCHAR(180)  NOT NULL ,
	GROUP_CREAT_DE        CHAR(40)  NOT NULL ,
	GROUP_DC              VARCHAR(300)  NULL ,
CONSTRAINT  COMTNAUTHORGROUPINFO_PK PRIMARY KEY (GROUP_ID)
);




/* 일반회원 */
CREATE TABLE COMTNGNRLMBER
(
	MBER_ID               VARCHAR(60)  NOT NULL ,
	PASSWORD              VARCHAR(600)  NOT NULL ,
	PASSWORD_HINT         VARCHAR(300)  NULL ,
	PASSWORD_CNSR         VARCHAR(300)  NULL ,
	IHIDNUM               VARCHAR(600)  NULL ,
	MBER_NM               VARCHAR(150)  NOT NULL ,
	ZIP                   VARCHAR(18)  NOT NULL ,
	ADRES                 VARCHAR(300)  NOT NULL ,
	AREA_NO               VARCHAR(12)  NOT NULL ,
	MBER_STTUS            VARCHAR(45)  NULL ,
	DETAIL_ADRES          VARCHAR(300)  NULL ,
	END_TELNO             VARCHAR(12)  NOT NULL ,
	MBTLNUM               VARCHAR(60)  NOT NULL ,
	GROUP_ID              CHAR(20)  NULL ,
	MBER_FXNUM            VARCHAR(60)  NULL ,
	MBER_EMAIL_ADRES      VARCHAR(150)  NULL ,
	MIDDLE_TELNO          VARCHAR(12)  NOT NULL ,
	SBSCRB_DE             DATETIME  NULL ,
	SEXDSTN_CODE          CHAR(1)  NULL ,
	ESNTL_ID              CHAR(20)  NOT NULL ,
CONSTRAINT  COMTNGNRLMBER_PK PRIMARY KEY (MBER_ID)
);




/* 조직정보 */
CREATE TABLE COMTNORGNZTINFO
(
	ORGNZT_ID             CHAR(20)  NOT NULL ,
	ORGNZT_NM             VARCHAR(60)  NOT NULL ,
	ORGNZT_DC             VARCHAR(300)  NULL ,
CONSTRAINT  COMTNORGNZTINFO_PK PRIMARY KEY (ORGNZT_ID)
);




/* 업무사용자정보 */
CREATE TABLE COMTNEMPLYRINFO
(
	EMPLYR_ID             VARCHAR(60)  NOT NULL ,
	ORGNZT_ID             CHAR(20)  NULL ,
	USER_NM               VARCHAR(180)  NOT NULL ,
	PASSWORD              VARCHAR(600)  NOT NULL ,
	EMPL_NO               VARCHAR(60)  NULL ,
	IHIDNUM               VARCHAR(600)  NULL ,
	SEXDSTN_CODE          CHAR(1)  NULL ,
	BRTHDY                CHAR(20)  NULL ,
	FXNUM                 VARCHAR(60)  NULL ,
	HOUSE_ADRES           VARCHAR(300)  NOT NULL ,
	PASSWORD_HINT         VARCHAR(300)  NOT NULL ,
	PASSWORD_CNSR         VARCHAR(300)  NOT NULL ,
	HOUSE_END_TELNO       VARCHAR(12)  NOT NULL ,
	AREA_NO               VARCHAR(12)  NOT NULL ,
	DETAIL_ADRES          VARCHAR(300)  NULL ,
	ZIP                   VARCHAR(18)  NOT NULL ,
	OFFM_TELNO            VARCHAR(60)  NULL ,
	MBTLNUM               VARCHAR(60)  NULL ,
	EMAIL_ADRES           VARCHAR(150)  NULL ,
	OFCPS_NM              VARCHAR(180)  NULL ,
	HOUSE_MIDDLE_TELNO    VARCHAR(12)  NOT NULL ,
	GROUP_ID              CHAR(20)  NULL ,
	PSTINST_CODE          CHAR(8)  NULL ,
	EMPLYR_STTUS_CODE     CHAR(1)  NOT NULL ,
	ESNTL_ID              CHAR(20)  NOT NULL ,
	CRTFC_DN_VALUE        VARCHAR(300)  NULL ,
	SBSCRB_DE             DATETIME  NULL ,
CONSTRAINT  COMTNEMPLYRINFO_PK PRIMARY KEY (EMPLYR_ID)
);




/* 기업회원 */
CREATE TABLE COMTNENTRPRSMBER
(
	ENTRPRS_MBER_ID       VARCHAR(60)  NOT NULL ,
	ENTRPRS_SE_CODE       CHAR(8)  NULL ,
	BIZRNO                VARCHAR(30)  NULL ,
	JURIRNO               VARCHAR(39)  NULL ,
	CMPNY_NM              VARCHAR(180)  NOT NULL ,
	CXFC                  VARCHAR(150)  NULL ,
	ZIP                   VARCHAR(18)  NOT NULL ,
	ADRES                 VARCHAR(300)  NOT NULL ,
	ENTRPRS_MIDDLE_TELNO  VARCHAR(12)  NOT NULL ,
	FXNUM                 VARCHAR(60)  NULL ,
	INDUTY_CODE           CHAR(1)  NULL ,
	APPLCNT_NM            VARCHAR(150)  NOT NULL ,
	APPLCNT_IHIDNUM       VARCHAR(600)  NULL ,
	SBSCRB_DE             DATETIME  NULL ,
	ENTRPRS_MBER_STTUS    VARCHAR(45)  NULL ,
	ENTRPRS_MBER_PASSWORD  VARCHAR(600)  NULL ,
	ENTRPRS_MBER_PASSWORD_HINT  VARCHAR(300)  NOT NULL ,
	ENTRPRS_MBER_PASSWORD_CNSR  VARCHAR(300)  NOT NULL ,
	GROUP_ID              CHAR(20)  NULL ,
	DETAIL_ADRES          VARCHAR(300)  NULL ,
	ENTRPRS_END_TELNO     VARCHAR(12)  NOT NULL ,
	AREA_NO               VARCHAR(12)  NOT NULL ,
	APPLCNT_EMAIL_ADRES   VARCHAR(150)  NOT NULL ,
	ESNTL_ID              CHAR(20)  NOT NULL ,
CONSTRAINT  COMTNENTRPRSMBER_PK PRIMARY KEY (ENTRPRS_MBER_ID)
);




/* 파일속성 */
CREATE TABLE COMTNFILE
(
	ATCH_FILE_ID          CHAR(20)  NOT NULL ,
	CREAT_DT              DATETIME  NOT NULL ,
	USE_AT                CHAR(1)  NULL ,
CONSTRAINT  COMTNFILE_PK PRIMARY KEY (ATCH_FILE_ID)
);




/* 파일상세정보 */
CREATE TABLE COMTNFILEDETAIL
(
	ATCH_FILE_ID          CHAR(20)  NOT NULL ,
	FILE_SN               NUMERIC(10)  NOT NULL ,
	FILE_STRE_COURS       VARCHAR(6000)  NOT NULL ,
	STRE_FILE_NM          VARCHAR(765)  NOT NULL ,
	ORIGNL_FILE_NM        VARCHAR(765)  NULL ,
	FILE_EXTSN            VARCHAR(60)  NOT NULL ,
	FILE_CN               STRING  NULL ,
	FILE_SIZE             NUMERIC(8)  NULL ,
CONSTRAINT  COMTNFILEDETAIL_PK PRIMARY KEY (ATCH_FILE_ID,FILE_SN)
);




/* 메일발신관리 */
CREATE TABLE COMTHEMAILDSPTCHMANAGE
(
	MSSAGE_ID             VARCHAR(60)  NOT NULL ,
	EMAIL_CN              STRING  NULL ,
	SNDR                  VARCHAR(150)  NOT NULL ,
	RCVER                 VARCHAR(150)  NOT NULL ,
	SJ                    VARCHAR(180)  NOT NULL ,
	SNDNG_RESULT_CODE     CHAR(1)  NULL ,
	DSPTCH_DT             CHAR(20)  NOT NULL ,
	ATCH_FILE_ID          CHAR(20)  NULL ,
CONSTRAINT  COMTHEMAILDSPTCHMANAGE_PK PRIMARY KEY (MSSAGE_ID)
);




/* 사용자보안설정 */
CREATE TABLE COMTNEMPLYRSCRTYESTBS
(
	SCRTY_DTRMN_TRGET_ID  VARCHAR(60)  NOT NULL ,
	MBER_TY_CODE          CHAR(5)  NULL ,
	AUTHOR_CODE           VARCHAR(90)  NOT NULL 
);

CREATE INDEX COMTNEMPLYRSCRTYESTBS_i04 ON COMTNEMPLYRSCRTYESTBS(AUTHOR_CODE  ASC);



/* 사용자정보뷰 */
CREATE  VIEW COMVNUSERMASTER ( ESNTL_ID,USER_ID,PASSWORD,USER_NM,USER_ZIP,USER_ADRES,USER_EMAIL,GROUP_ID, USER_SE, ORGNZT_ID ) 
AS  SELECT ESNTL_ID, MBER_ID,PASSWORD,MBER_NM,ZIP,ADRES,MBER_EMAIL_ADRES,' ','GNR' AS USER_SE, ' ' ORGNZT_ID
		FROM COMTNGNRLMBER
	UNION ALL
		SELECT ESNTL_ID,EMPLYR_ID,PASSWORD,USER_NM,ZIP,HOUSE_ADRES,EMAIL_ADRES,GROUP_ID ,'USR' AS USER_SE, ORGNZT_ID
		FROM COMTNEMPLYRINFO
	UNION ALL
		SELECT ESNTL_ID,ENTRPRS_MBER_ID,ENTRPRS_MBER_PASSWORD,CMPNY_NM,ZIP,ADRES,APPLCNT_EMAIL_ADRES,' ' ,'ENT' AS USER_SE, ' ' ORGNZT_ID
		FROM COMTNENTRPRSMBER ORDER BY ESNTL_ID;


/* 권한정보 */
CREATE TABLE COMTNAUTHORINFO
(
	AUTHOR_CODE           VARCHAR(90)  NOT NULL ,
	AUTHOR_NM             VARCHAR(180)  NOT NULL ,
	AUTHOR_DC             VARCHAR(600)  NULL ,
	AUTHOR_CREAT_DE       CHAR(40)  NOT NULL ,
CONSTRAINT  COMTNAUTHORINFO_PK PRIMARY KEY (AUTHOR_CODE)
);




/* 롤 계층구조 */
CREATE TABLE COMTNROLES_HIERARCHY
(
	PARNTS_ROLE           VARCHAR(90)  NOT NULL ,
	CHLDRN_ROLE           VARCHAR(90)  NOT NULL ,
CONSTRAINT  COMTNROLES_HIERARCHY_PK PRIMARY KEY (PARNTS_ROLE,CHLDRN_ROLE)
);

CREATE UNIQUE INDEX COMTNROLES_HIERARCHY_i01 ON COMTNROLES_HIERARCHY(PARNTS_ROLE  ASC);



/* 롤정보 */
CREATE TABLE COMTNROLEINFO
(
	ROLE_CODE             VARCHAR(150)  NOT NULL ,
	ROLE_NM               VARCHAR(180)  NOT NULL ,
	ROLE_PTTRN            VARCHAR(900)  NULL ,
	ROLE_DC               VARCHAR(600)  NULL ,
	ROLE_TY               VARCHAR(240)  NULL ,
	ROLE_SORT             VARCHAR(30)  NULL ,
	ROLE_CREAT_DE         CHAR(40)  NOT NULL ,
CONSTRAINT  COMTNROLEINFO_PK PRIMARY KEY (ROLE_CODE)
);




/* 권한롤관계 */
CREATE TABLE COMTNAUTHORROLERELATE
(
	AUTHOR_CODE           VARCHAR(90)  NOT NULL ,
	ROLE_CODE             VARCHAR(150)  NOT NULL ,
	CREAT_DT              DATETIME  NULL ,
CONSTRAINT  COMTNAUTHORROLERELATE_PK PRIMARY KEY (AUTHOR_CODE,ROLE_CODE)
);




/* 템플릿 */
CREATE TABLE COMTNTMPLATINFO
(
	TMPLAT_ID             CHAR(20)  NOT NULL ,
	TMPLAT_NM             VARCHAR(765)  NULL ,
	TMPLAT_COURS          VARCHAR(6000)  NULL ,
	USE_AT                CHAR(1)  NULL ,
	TMPLAT_SE_CODE        CHAR(6)  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
CONSTRAINT  COMTNTMPLATINFO_PK PRIMARY KEY (TMPLAT_ID)
);




/* 게시판마스터 */
CREATE TABLE COMTNBBSMASTER
(
	BBS_ID                CHAR(20)  NOT NULL ,
	BBS_NM                VARCHAR(765)  NOT NULL ,
	BBS_INTRCN            VARCHAR(7200)  NULL ,
	BBS_TY_CODE           CHAR(6)  NOT NULL ,
	REPLY_POSBL_AT        CHAR(1)  NULL ,
	FILE_ATCH_POSBL_AT    CHAR(1)  NOT NULL ,
	ATCH_POSBL_FILE_NUMBER  NUMERIC(2)  NOT NULL ,
	ATCH_POSBL_FILE_SIZE  NUMERIC(8)  NULL ,
	USE_AT                CHAR(1)  NOT NULL ,
	TMPLAT_ID             CHAR(20)  NULL ,
	CMMNTY_ID			CHAR(20) NULL,
	FRST_REGISTER_ID      VARCHAR(60)  NOT NULL ,
	FRST_REGIST_PNTTM     DATETIME  NOT NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
CONSTRAINT  COMTNBBSMASTER_PK PRIMARY KEY (BBS_ID)
);




/* 게시판 */
CREATE TABLE COMTNBBS
(
	NTT_ID                NUMERIC(20)  NOT NULL ,
	BBS_ID                CHAR(20)  NOT NULL ,
	NTT_NO                NUMERIC(20)  NULL ,
	NTT_SJ                VARCHAR(6000)  NULL ,
	NTT_CN                STRING  NULL ,
	ANSWER_AT             CHAR(1)  NULL ,
	PARNTSCTT_NO          NUMERIC(10)  NULL ,
	ANSWER_LC             NUMERIC(8)  NULL ,
	SORT_ORDR             NUMERIC(8)  NULL ,
	RDCNT                 NUMERIC(10)  NULL ,
	USE_AT                CHAR(1)  NOT NULL ,
	NTCE_BGNDE            CHAR(20)  NULL ,
	NTCE_ENDDE            CHAR(20)  NULL ,
	NTCR_ID               VARCHAR(60)  NULL ,
	NTCR_NM               VARCHAR(60)  NULL ,
	PASSWORD              VARCHAR(600)  NULL ,
	ATCH_FILE_ID          CHAR(20)  NULL ,
	NOTICE_AT				CHAR(1) NULL,
	SJ_BOLD_AT				CHAR(1) NULL,
	SECRET_AT				CHAR(1) NULL,
	FRST_REGIST_PNTTM     DATETIME  NOT NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NOT NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
CONSTRAINT  COMTNBBS_PK PRIMARY KEY (NTT_ID,BBS_ID)
);




/* 커뮤니티 속성 */
CREATE TABLE COMTNCMMNTY
(
	CMMNTY_ID             CHAR(20)  NOT NULL ,
	CMMNTY_NM             VARCHAR(765)  NOT NULL ,
	CMMNTY_INTRCN         VARCHAR(7200)  NULL ,
	USE_AT                CHAR(1)  NOT NULL ,
	REGIST_SE_CODE        CHAR(6)  NULL ,
	TMPLAT_ID             CHAR(20)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NOT NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NOT NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
CONSTRAINT  COMTNCMMNTY_PK PRIMARY KEY (CMMNTY_ID)
);




/* 댓글 */
CREATE TABLE COMTNCOMMENT
(
	NTT_ID                NUMERIC(20)  NOT NULL ,
	BBS_ID                CHAR(20)  NOT NULL ,
	ANSWER_NO             NUMERIC(20)  NOT NULL ,
	WRTER_ID              VARCHAR(60)  NULL ,
	WRTER_NM              VARCHAR(60)  NULL ,
	ANSWER                VARCHAR(600)  NULL ,
	USE_AT                CHAR(1)  NOT NULL ,
	FRST_REGIST_PNTTM     DATETIME  NOT NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NOT NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
	PASSWORD              VARCHAR(600)  NULL ,
CONSTRAINT  COMTNCOMMENT_PK PRIMARY KEY (NTT_ID,BBS_ID,ANSWER_NO)
);




/* 스크랩 */
CREATE TABLE COMTNSCRAP
(
	SCRAP_ID              CHAR(20)  NOT NULL ,
	NTT_ID                NUMERIC(20)  NOT NULL ,
	BBS_ID                CHAR(20)  NOT NULL ,
	SCRAP_NM              VARCHAR(300)  NOT NULL ,
	USE_AT                CHAR(1)  NOT NULL ,
	FRST_REGIST_PNTTM     DATETIME  NOT NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NOT NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
CONSTRAINT  COMTNSCRAP_PK PRIMARY KEY (SCRAP_ID)
);




/* 게시판활용 */
CREATE TABLE COMTNBBSUSE
(
	BBS_ID                CHAR(20)  NOT NULL ,
	TRGET_ID              CHAR(20)  NOT NULL ,
	USE_AT                CHAR(1)  NOT NULL ,
	REGIST_SE_CODE        CHAR(6)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NOT NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
CONSTRAINT  COMTNBBSUSE_PK PRIMARY KEY (BBS_ID,TRGET_ID)
);




/* 커뮤니티사용자 */
CREATE TABLE COMTNCMMNTYUSER
(
	CMMNTY_ID             CHAR(20)  NOT NULL ,
	EMPLYR_ID             VARCHAR(60)  NOT NULL ,
	MNGR_AT               CHAR(1)  NOT NULL ,
	MBER_STTUS			VARCHAR(15) NULL,
	SBSCRB_DE             DATETIME  NULL ,
	SECSN_DE              CHAR(20)  NULL ,
	USE_AT                CHAR(1)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NOT NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NOT NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
CONSTRAINT  COMTNCMMNTYUSER_PK PRIMARY KEY (CMMNTY_ID,EMPLYR_ID)
);




/* 일정정보 */
CREATE TABLE COMTNSCHDULINFO
(
	SCHDUL_ID             CHAR(20)  NOT NULL ,
	SCHDUL_SE             CHAR(1)  NULL ,
	SCHDUL_DEPT_ID        VARCHAR(60)  NULL ,
	SCHDUL_KND_CODE       CHAR(1)  NULL ,
	SCHDUL_BGNDE          CHAR(20)  NULL ,
	SCHDUL_ENDDE          CHAR(20)  NULL ,
	SCHDUL_NM             VARCHAR(765)  NULL ,
	SCHDUL_CN             VARCHAR(7500)  NULL ,
	SCHDUL_PLACE          VARCHAR(765)  NULL ,
	SCHDUL_IPCR_CODE      CHAR(1)  NULL ,
	SCHDUL_CHARGER_ID     VARCHAR(60)  NULL ,
	ATCH_FILE_ID          CHAR(20)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
	REPTIT_SE_CODE        CHAR(1)  NULL ,
CONSTRAINT  COMTNSCHDULINFO_PK PRIMARY KEY (SCHDUL_ID)
);




/* 일지정보 */
CREATE TABLE COMTNDIARYINFO
(
	SCHDUL_ID             CHAR(20)  NOT NULL ,
	DIARY_ID              CHAR(20)  NOT NULL ,
	DIARY_PROGRSRT        NUMERIC(3)  NULL ,
	DIARY_NM              VARCHAR(765)  NULL ,
	DRCT_MATTER           VARCHAR(7500)  NULL ,
	PARTCLR_MATTER        VARCHAR(7500)  NULL ,
	ATCH_FILE_ID          CHAR(20)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
CONSTRAINT  COMTNDIARYINFO_PK PRIMARY KEY (SCHDUL_ID,DIARY_ID)
);




/* 명함정보속성 */
CREATE TABLE COMTNNCRD
(
	NCRD_ID               CHAR(20)  NOT NULL ,
	NCRD_TRGTER_ID        VARCHAR(60)  NULL ,
	NM                    VARCHAR(150)  NOT NULL ,
	TELNO                 VARCHAR(60)  NULL ,
	NATION_NO             VARCHAR(30)  NULL ,
	AREA_NO               VARCHAR(12)  NULL ,
	MIDDLE_TELNO          VARCHAR(12)  NULL ,
	END_TELNO             VARCHAR(12)  NULL ,
	MBTLNUM               VARCHAR(60)  NULL ,
	IDNTFC_NO             VARCHAR(30)  NULL ,
	MIDDLE_MBTLNUM        VARCHAR(12)  NULL ,
	END_MBTLNUM           VARCHAR(12)  NULL ,
	EMAIL_ADRES           VARCHAR(150)  NULL ,
	CMPNY_NM              VARCHAR(180)  NULL ,
	DEPT_NM               VARCHAR(180)  NULL ,
	ADRES                 VARCHAR(300)  NULL ,
	DETAIL_ADRES          VARCHAR(300)  NULL ,
	OFCPS_NM              VARCHAR(180)  NULL ,
	CLSF_NM               VARCHAR(180)  NULL ,
	EXTRL_USER_AT         CHAR(1)  NULL ,
	OTHBC_AT              CHAR(1)  NOT NULL ,
	RM                    VARCHAR(7500)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NOT NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
CONSTRAINT  COMTNNCRD_PK PRIMARY KEY (NCRD_ID)
);




/* 주소록관리 */
CREATE TABLE COMTNADBKMANAGE
(
	ADBK_ID               CHAR(20)  NOT NULL ,
	ADBK_NM               VARCHAR(150)  NOT NULL ,
	OTHBC_SCOPE           VARCHAR(60)  NOT NULL ,
	USE_AT                CHAR(1)  NOT NULL ,
	WRTER_ID              VARCHAR(60)  NULL ,
	TRGET_ORGNZT_ID       CHAR(20)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NOT NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NOT NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
CONSTRAINT  COMTNADBKMANAGE_PK PRIMARY KEY (ADBK_ID)
);




/* 주소록 */
CREATE TABLE COMTNADBK
(
	EMPLYR_ID             VARCHAR(60) NULL ,
	NCRD_ID               CHAR(20)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
	ADBK_CONSTNT_ID       CHAR(20)  NOT NULL ,
	NM                    VARCHAR(150)  NULL ,
	EMAIL_ADRES           VARCHAR(150)  NULL ,
	MBTLNUM               VARCHAR(60)  NULL ,
	FXNUM                 VARCHAR(60)  NULL ,
	OFFM_TELNO            VARCHAR(60)  NULL ,
	HOUSE_TELNO           VARCHAR(60)  NULL ,
	ADBK_ID               CHAR(20)  NOT NULL ,
CONSTRAINT  COMTNADBK_PK PRIMARY KEY (ADBK_CONSTNT_ID,ADBK_ID)
);




/* 약관정보 */
CREATE TABLE COMTNSTPLATINFO
(
	USE_STPLAT_ID         CHAR(20)  NOT NULL ,
	USE_STPLAT_NM         VARCHAR(300)  NULL ,
	USE_STPLAT_CN         STRING  NULL ,
	INFO_PROVD_AGRE_CN    STRING  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
CONSTRAINT  COMTNSTPLATINFO_PK PRIMARY KEY (USE_STPLAT_ID)
);




/* 업무사용자정보변경내역 */
CREATE TABLE COMTHEMPLYRINFOCHANGEDTLS
(
	EMPLYR_ID             VARCHAR(60)  NOT NULL ,
	CHANGE_DE             CHAR(20)  NULL ,
	ORGNZT_ID             CHAR(20)  NULL ,
	GROUP_ID              CHAR(20)  NULL ,
	EMPL_NO               VARCHAR(60)  NULL ,
	SEXDSTN_CODE          CHAR(1)  NULL ,
	BRTHDY                CHAR(20)  NULL ,
	FXNUM                 VARCHAR(60)  NULL ,
	HOUSE_ADRES           VARCHAR(300)  NULL ,
	HOUSE_END_TELNO       VARCHAR(12)  NULL ,
	AREA_NO               VARCHAR(12)  NULL ,
	DETAIL_ADRES          VARCHAR(300)  NULL ,
	ZIP                   VARCHAR(18)  NULL ,
	OFFM_TELNO            VARCHAR(60)  NULL ,
	MBTLNUM               VARCHAR(60)  NULL ,
	EMAIL_ADRES           VARCHAR(150)  NULL ,
	HOUSE_MIDDLE_TELNO    VARCHAR(12)  NULL ,
	PSTINST_CODE          CHAR(8)  NULL ,
	EMPLYR_STTUS_CODE     CHAR(1)  NULL ,
	ESNTL_ID              CHAR(20)  NULL ,
CONSTRAINT  COMTHEMPLYRINFOCHANGEDTLS_PK PRIMARY KEY (EMPLYR_ID,CHANGE_DE)
);




/* 마이페이지 컨텐츠 */
CREATE TABLE COMTNINDVDLPGECNTNTS
(
	CNTNTS_ID             VARCHAR(60)  NOT NULL ,
	CNTNTS_NM             VARCHAR(300)  NOT NULL ,
	CNTC_URL              VARCHAR(765)  NOT NULL ,
	CNTNTS_USE_AT         CHAR(1)  NOT NULL ,
	CNTNTS_LINK_URL       VARCHAR(3000)  NULL ,
	CNTNTS_DC             VARCHAR(750)  NULL ,
CONSTRAINT  COMTNINDVDLPGECNTNTS_PK PRIMARY KEY (CNTNTS_ID)
);




/* 마이페이지 설정 */
CREATE TABLE COMTNINDVDLPGEESTBS
(
	EMPLYR_ID             VARCHAR(60)  NOT NULL ,
	UPEND_IMAGE           VARCHAR(3072)  NULL ,
	TITLEBAR_COLOR        CHAR(7)  NULL ,
	ALGN_MTHD             CHAR(1)  NULL ,
	ALGN_CO               NUMERIC(10)  NULL ,
CONSTRAINT  COMTNINDVDLPGEESTBS_PK PRIMARY KEY (EMPLYR_ID)
);




/* 도움말정보 */
CREATE TABLE COMTNHPCMINFO
(
	HPCM_ID               CHAR(20)  NOT NULL ,
	HPCM_SE_CODE          CHAR(1)  NULL ,
	HPCM_DFN              VARCHAR(3000)  NULL ,
	HPCM_DC               VARCHAR(7500)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
CONSTRAINT  COMTNHPCMINFO_PK PRIMARY KEY (HPCM_ID)
);




/* 용어사전정보 */
CREATE TABLE COMTNWORDDICARYINFO
(
	WORD_ID               CHAR(20)  NOT NULL ,
	WORD_NM               VARCHAR(765)  NULL ,
	ENG_NM                VARCHAR(180)  NULL ,
	WORD_DC               VARCHAR(12000)  NULL ,
	SYNONM                VARCHAR(300)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
CONSTRAINT  COMTNWORDDICARYINFO_PK PRIMARY KEY (WORD_ID)
);




/* FAQ정보 */
CREATE TABLE COMTNFAQINFO
(
	FAQ_ID                CHAR(20)  NOT NULL ,
	QESTN_SJ              VARCHAR(765)  NULL ,
	QESTN_CN              VARCHAR(7500)  NULL ,
	ANSWER_CN             VARCHAR(7500)  NULL ,
	RDCNT                 NUMERIC(10)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NOT NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NOT NULL ,
	LAST_UPDT_PNTTM       DATETIME  NOT NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NOT NULL ,
	ATCH_FILE_ID          CHAR(20)  NULL ,
	QNA_PROCESS_STTUS_CODE  CHAR(1)  NULL ,
CONSTRAINT  COMTNFAQINFO_PK PRIMARY KEY (FAQ_ID)
);




/* QA정보 */
CREATE TABLE COMTNQAINFO
(
	QA_ID                 CHAR(20)  NOT NULL ,
	QESTN_SJ              VARCHAR(765)  NULL ,
	QESTN_CN              VARCHAR(7500)  NULL ,
	WRITNG_DE             CHAR(20)  NULL ,
	RDCNT                 NUMERIC(10)  NULL ,
	EMAIL_ADRES           VARCHAR(150)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
	QNA_PROCESS_STTUS_CODE  CHAR(1)  NULL ,
	WRTER_NM              VARCHAR(60)  NULL ,
	ANSWER_CN             VARCHAR(7500)  NULL ,
	WRITNG_PASSWORD       VARCHAR(60)  NULL ,
	ANSWER_DE             CHAR(20)  NULL ,
	EMAIL_ANSWER_AT       CHAR(1)  NULL ,
	AREA_NO               VARCHAR(12)  NULL ,
	MIDDLE_TELNO          VARCHAR(12)  NULL ,
	END_TELNO             VARCHAR(12)  NULL ,
CONSTRAINT  COMTNQAINFO_PK PRIMARY KEY (QA_ID)
);




/* 행정용어사전관리 */
CREATE TABLE COMTNADMINISTRATIONWORD
(
	ADMINIST_WORD_ID      CHAR(20)  NOT NULL ,
	ADMINIST_WORD_NM      VARCHAR(765)  NULL ,
	ADMINIST_WORD_ENG_NM  VARCHAR(765)  NULL ,
	ADMINIST_WORD_ABRV_NM  VARCHAR(765)  NULL ,
	THEMA_RELM            VARCHAR(765)  NULL ,
	WORD_SE               VARCHAR(765)  NULL ,
	RELATE_STD_WORD       VARCHAR(765)  NULL ,
	ADMINIST_WORD_DFN     VARCHAR(7500)  NULL ,
	ADMINIST_WORD_DC      VARCHAR(12000)  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
CONSTRAINT  COMTNADMINISTRATIONWORD_PK PRIMARY KEY (ADMINIST_WORD_ID)
);




/* 온라인메뉴얼 */
CREATE TABLE COMTNONLINEMANUAL
(
	ONLINE_MNL_ID         CHAR(20)  NOT NULL ,
	ONLINE_MNL_SE_CODE    CHAR(3)  NULL ,
	ONLINE_MNL_DFN        STRING  NULL ,
	ONLINE_MNL_DC         STRING  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	ONLINE_MNL_NM         VARCHAR(765)  NULL ,
CONSTRAINT  COMTNONLINEMANUAL_PK PRIMARY KEY (ONLINE_MNL_ID)
);




/* 상담내역 */
CREATE TABLE COMTNCNSLTLIST
(
	CNSLT_ID              CHAR(20)  NOT NULL ,
	CNSLT_SJ              VARCHAR(765)  NULL ,
	OTHBC_AT              CHAR(1)  NULL ,
	EMAIL_ADRES           VARCHAR(150)  NULL ,
	CNSLT_CN              VARCHAR(7500)  NULL ,
	MANAGT_CN             VARCHAR(7500)  NULL ,
	MANAGT_DE             CHAR(20)  NULL ,
	RDCNT                 NUMERIC(10)  NULL ,
	ATCH_FILE_ID          CHAR(20)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
	AREA_NO               VARCHAR(12)  NULL ,
	MIDDLE_TELNO          VARCHAR(12)  NULL ,
	END_TELNO             VARCHAR(12)  NULL ,
	FRST_MBTLNUM          VARCHAR(12)  NULL ,
	MIDDLE_MBTLNUM        VARCHAR(12)  NULL ,
	END_MBTLNUM           VARCHAR(12)  NULL ,
	WRITNG_DE             CHAR(20)  NULL ,
	WRTER_NM              VARCHAR(60)  NULL ,
	EMAIL_ANSWER_AT       CHAR(1)  NULL ,
	QNA_PROCESS_STTUS_CODE  CHAR(1)  NULL ,
	WRITNG_PASSWORD       VARCHAR(60)  NULL ,
CONSTRAINT  COMTNCNSLTLIST_PK PRIMARY KEY (CNSLT_ID)
);




/* 온라인POLL관리 */
CREATE TABLE COMTNONLINEPOLLMANAGE
(
	POLL_ID               CHAR(20)  NOT NULL ,
	POLL_NM               VARCHAR(765)  NULL ,
	POLL_BGNDE            CHAR(10)  NULL ,
	POLL_ENDDE            CHAR(10)  NULL ,
	POLL_KND              CHAR(3)  NULL ,
	POLL_DSUSE_ENNC       CHAR(1)  NULL ,
	POLL_ATMC_DSUSE_ENNC  CHAR(1)  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
CONSTRAINT  COMTNONLINEPOLLMANAGE_PK PRIMARY KEY (POLL_ID)
);




/* 온라인POLL항목 */
CREATE TABLE COMTNONLINEPOLLIEM
(
	POLL_IEM_NM           VARCHAR(765)  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	POLL_IEM_ID           CHAR(20)  NOT NULL ,
	POLL_ID               CHAR(20)  NOT NULL ,
CONSTRAINT  COMTNONLINEPOLLIEM_PK PRIMARY KEY (POLL_ID,POLL_IEM_ID)
);




/* 온라인POLL결과 */
CREATE TABLE COMTNONLINEPOLLRESULT
(
	POLL_RESULT_ID        CHAR(20)  NOT NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	POLL_IEM_ID           CHAR(20)  NOT NULL ,
	POLL_ID               CHAR(20)  NOT NULL ,
CONSTRAINT  COMTNONLINEPOLLRESULT_PK PRIMARY KEY (POLL_RESULT_ID,POLL_IEM_ID,POLL_ID)
);




/* 뉴스정보 */
CREATE TABLE COMTNNEWSINFO
(
	NEWS_ID               CHAR(20)  NOT NULL ,
	NEWS_SJ               VARCHAR(300)  NULL ,
	NEWS_CN               VARCHAR(7500)  NULL ,
	NEWS_ORIGIN           VARCHAR(750)  NULL ,
	NTCE_AT               CHAR(1)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NOT NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NOT NULL ,
	LAST_UPDT_PNTTM       DATETIME  NOT NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NOT NULL ,
	NTCE_DE               CHAR(20)  NULL ,
	ATCH_FILE_ID          CHAR(20)  NULL ,
CONSTRAINT  COMTNNEWSINFO_PK PRIMARY KEY (NEWS_ID)
);




/* 사이트목록 */
CREATE TABLE COMTNSITELIST
(
	SITE_ID               CHAR(20)  NOT NULL ,
	SITE_NM               VARCHAR(300)  NULL ,
	SITE_URL              VARCHAR(300)  NULL ,
	SITE_DC               VARCHAR(3000)  NULL ,
	SITE_THEMA_CL_CODE    VARCHAR(6)  NULL ,
	ACTVTY_AT             CHAR(1)  NULL ,
	USE_AT                CHAR(1)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
CONSTRAINT  COMTNSITELIST_PK PRIMARY KEY (SITE_ID)
);




/* 추천사이트정보 */
CREATE TABLE COMTNRECOMENDSITEINFO
(
	RECOMEND_SITE_ID      CHAR(20)  NOT NULL ,
	RECOMEND_SITE_NM      VARCHAR(300)  NULL ,
	RECOMEND_SITE_URL     VARCHAR(765)  NULL ,
	RECOMEND_SITE_DC      VARCHAR(3000)  NULL ,
	RECOMEND_RESN_CN      VARCHAR(3000)  NULL ,
	RECOMEND_CONFM_AT     CHAR(1)  NULL ,
	CONFM_DE              CHAR(20)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
CONSTRAINT  COMTNRECOMENDSITEINFO_PK PRIMARY KEY (RECOMEND_SITE_ID)
);




/* 행사/이벤트정보 */
CREATE TABLE COMTNEVENTINFO
(
	EVENT_ID              CHAR(20)  NOT NULL ,
	BSNS_YEAR             CHAR(4)  NULL ,
	BSNS_CODE             VARCHAR(6)  NULL ,
	EVENT_CN              VARCHAR(3000)  NULL ,
	EVENT_SVC_BGNDE       CHAR(20)  NULL ,
	SVC_USE_NMPR_CO       NUMERIC(10)  NULL ,
	CHARGER_NM            VARCHAR(150)  NULL ,
	PRPARETG_CN           VARCHAR(7500)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
	EVENT_SVC_ENDDE       CHAR(20)  NULL ,
	EVENT_TY_CODE         CHAR(1)  NULL ,
	EVENT_CONFM_AT        CHAR(1)  NULL ,
	EVENT_CONFM_DE        CHAR(20)  NULL ,
CONSTRAINT  COMTNEVENTINFO_PK PRIMARY KEY (EVENT_ID)
);




/* 외부인사정보 */
CREATE TABLE COMTNEXTRLHRINFO
(
	EVENT_ID              CHAR(20)  NOT NULL ,
	EXTRL_HR_ID           CHAR(20)  NOT NULL ,
	SEXDSTN_CODE          CHAR(1)  NULL ,
	EXTRL_HR_NM           VARCHAR(180)  NULL ,
	OCCP_TY_CODE          CHAR(1)  NULL ,
	PSITN_INSTT_NM        VARCHAR(300)  NULL ,
	BRTHDY                CHAR(20)  NULL ,
	AREA_NO               VARCHAR(12)  NULL ,
	MIDDLE_TELNO          VARCHAR(12)  NULL ,
	END_TELNO             VARCHAR(12)  NULL ,
	EMAIL_ADRES           VARCHAR(150)  NULL ,
	FRST_REGIST_PNTTM     DATETIME  NULL ,
	FRST_REGISTER_ID      VARCHAR(60)  NULL ,
	LAST_UPDT_PNTTM       DATETIME  NULL ,
	LAST_UPDUSR_ID        VARCHAR(60)  NULL ,
CONSTRAINT  COMTNEXTRLHRINFO_PK PRIMARY KEY (EVENT_ID,EXTRL_HR_ID)
);




