Index: ProcessManagement.sql
===================================================================
--- ProcessManagement.sql	(revision 197)
+++ ProcessManagement.sql	(revision 198)
@@ -1,2007 +1,1027 @@
-SET SESSION FOREIGN_KEY_CHECKS=0;
+-- Project Name : noname
+-- Date/Time    : 2017/06/14 16:16:18
+-- Author       : Horiuchi
+-- RDBMS Type   : MySQL
+-- Application  : A5:SQL Mk-2
 
-/* Drop Indexes */
+-- 担当者行動予定データ
+drop index ActionScheduleData_Index1 on actionscheduledata;
+drop index ActionScheduleData_Index2 on actionscheduledata;
+drop index ActionScheduleData_Index3 on actionscheduledata;
 
-DROP INDEX ActionScheduleData_Index1 ON ActionScheduleData;
-DROP INDEX ActionScheduleData_Index2 ON ActionScheduleData;
-DROP INDEX ActionScheduleData_Index3 ON ActionScheduleData;
-DROP INDEX AttendDaily_Index1 ON AttendanceDailyData;
-DROP INDEX AttendDaily_Index2 ON AttendanceDailyData;
-DROP INDEX BusinessTypeMaster_Index1 ON BusinessTypeMaster;
-DROP INDEX ComponentLinkMaster_Index1 ON ComponentLinkMaster;
-DROP INDEX ComponentLinkMaster_Index2 ON ComponentLinkMaster;
-DROP INDEX ComponentMaster_Index1 ON ComponentMaster;
-DROP INDEX ComponentToTypeMaster_Index1 ON ComponentToTypeMaster;
-DROP INDEX ComponentToTypeMaster_Index2 ON ComponentToTypeMaster;
-DROP INDEX BaseInfo_Index1 ON ConstructionBaseInfo;
-DROP INDEX BaseInfo_Index2 ON ConstructionBaseInfo;
-DROP INDEX BaseInfo_Index3 ON ConstructionBaseInfo;
-DROP INDEX BaseInfo_Index4 ON ConstructionBaseInfo;
-DROP INDEX BaseInfo_Index5 ON ConstructionBaseInfo;
-DROP INDEX BaseInfoDetail_Idx1 ON ConstructionBaseInfoDetail;
-DROP INDEX BaseInfoDetail_Idx2 ON ConstructionBaseInfoDetail;
-DROP INDEX LedgerDetail_Index01 ON ConstructionLedgerDetail;
-DROP INDEX LedgerDetail_Index02 ON ConstructionLedgerDetail;
-DROP INDEX LedgerDetail_Index03 ON ConstructionLedgerDetail;
-DROP INDEX LedgerExcute_Index1 ON ConstructionLedgerExcute;
-DROP INDEX ConstructionLink_Index1 ON ConstructionLink;
-DROP INDEX ConstructionLink_Index2 ON ConstructionLink;
-DROP INDEX ConstructionLink_Index3 ON ConstructionLink;
-DROP INDEX ConstructionSpecMaster_Index1 ON ConstructionSpecMaster;
-DROP INDEX CostDataOfPerson_Index1 ON CostDataOfPerson;
-DROP INDEX CostDataOfPerson_Index2 ON CostDataOfPerson;
-DROP INDEX CostomerRegist_Index1 ON CostomerRegist;
-DROP INDEX DailyDataConstruction_Index1 ON DailyDataConstruction;
-DROP INDEX DailyDataConstruction_Index2 ON DailyDataConstruction;
-DROP INDEX DailyDataConstruction_Index3 ON DailyDataConstruction;
-DROP INDEX DailyDataDetail_Index ON DailyDataDetail;
-DROP INDEX DailyDataField_Index ON DailyDataField;
-DROP INDEX DailyDataMaterials_Index ON DailyDataMaterials;
-DROP INDEX DailyDataSubcontractors_Index ON DailyDataSubcontractors;
-DROP INDEX DailyDataVehicles_Index ON DailyDataVehicles;
-DROP INDEX DepartmentMaster_index1 ON DepartmentMaster;
-DROP INDEX EstimateData_Index1 ON EstimateData;
-DROP INDEX EstimateDataBody_Index1 ON EstimateDataBody;
-DROP INDEX EstimateDataDetail_Index1 ON EstimateDataDetail;
-DROP INDEX HolidayCalender_Index1 ON HolidayCalenderMaster;
-DROP INDEX HolidayCalenderMaster_Index2 ON HolidayCalenderMaster;
-DROP INDEX HolidayCalenderMaster_Index3 ON HolidayCalenderMaster;
-DROP INDEX InputSearchLogData_Index1 ON InputSearchLogData;
-DROP INDEX MessageBoardData_Index1 ON MessageBoardData;
-DROP INDEX MessageBoardData_Index2 ON MessageBoardData;
-DROP INDEX MessageBoardTerget_Index1 ON MessageBoardTerget;
-DROP INDEX PersonDepartmentMaster_Index1 ON PersonDepartmentMaster;
-DROP INDEX PersonDepartmentMaster_Index2 ON PersonDepartmentMaster;
-DROP INDEX PersonInChargeMaster_Index1 ON PersonInChargeMaster;
-DROP INDEX PersonInChargeMaster_Index2 ON PersonInChargeMaster;
-DROP INDEX PersonSalaryMaster_Index1 ON PersonSalaryMaster;
-DROP INDEX PersonSalaryMaster_Index2 ON PersonSalaryMaster;
-DROP INDEX ProcessExcuteMaster_Index1 ON ProcessExcuteMaster;
-DROP INDEX ProcessExcuteMaster_Index2 ON ProcessExcuteMaster;
-DROP INDEX POrderDetail_Index1 ON PurchaseOrderDetail;
-DROP INDEX SalesGraphData_Idx1 ON SalesGraphData;
-DROP INDEX SalesGraphData_idx2 ON SalesGraphData;
-DROP INDEX SecurityMaster_Index1 ON SecurityMaster;
-DROP INDEX SecurityMaster_Index2 ON SecurityMaster;
-DROP INDEX SecurityMaster_Index3 ON SecurityMaster;
-DROP INDEX SubContractorJobItem_Index1 ON SubContractorJobItem;
-DROP INDEX SubContractorJobItem_Index2 ON SubContractorJobItem;
-DROP INDEX SubContractorJobLink_Index1 ON SubContractorJobLink;
-DROP INDEX SubContractorJobLink_Index2 ON SubContractorJobLink;
-DROP INDEX SubContractorMaster_Index1 ON SubContractorMaster;
-DROP INDEX TermMaster_Index1 ON TermMaster;
-DROP INDEX TranceportDailyData_Index1 ON TranceportDailyData;
-DROP INDEX UnitMaster_Index1 ON UnitMaster;
-DROP INDEX VehicleScheduleData_Index1 ON VehicleScheduleData;
-DROP INDEX VehicleScheduleData_Index2 ON VehicleScheduleData;
-DROP INDEX VehicleScheduleData_Index3 ON VehicleScheduleData;
+drop table if exists actionscheduledata cascade;
 
+create table actionscheduledata (
+  TargetDate date not null comment '対象日'
+  , PersonCode decimal(8,0) not null comment '担当者コード'
+  , ActionSchedule varchar(30) comment '行動予定'
+  , TargetYear year(4) not null comment '該当年'
+  , TargetMonth year(4) not null comment '該当月'
+  , TargetDay year(4) not null comment '該当日'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint actionscheduledata_PKC primary key (TargetDate,PersonCode)
+) comment '担当者行動予定データ' ;
 
+create index ActionScheduleData_Index1
+  on actionscheduledata(TargetYear);
 
-/* Drop Tables */
+create index ActionScheduleData_Index2
+  on actionscheduledata(TargetMonth);
 
-DROP TABLE IF EXISTS ActionScheduleData;
-DROP TABLE IF EXISTS ApprovalMaster;
-DROP TABLE IF EXISTS AttendanceDailyData;
-DROP TABLE IF EXISTS AttendanceData;
-DROP TABLE IF EXISTS BK_ConstructionLedger;
-DROP TABLE IF EXISTS BK_ConstructionLedgerDetail;
-DROP TABLE IF EXISTS BK_ConstructionLedgerExcute;
-DROP TABLE IF EXISTS BK_EstimateData;
-DROP TABLE IF EXISTS BK_EstimateDataBody;
-DROP TABLE IF EXISTS BK_EstimateDataDetail;
-DROP TABLE IF EXISTS BusinessTypeMaster;
-DROP TABLE IF EXISTS CommonCostLarge;
-DROP TABLE IF EXISTS CommonCostLinkMS;
-DROP TABLE IF EXISTS CommonCostMiddle;
-DROP TABLE IF EXISTS CommonCostMiddleSearchWord;
-DROP TABLE IF EXISTS ComponentLinkMaster;
-DROP TABLE IF EXISTS ComponentMaster;
-DROP TABLE IF EXISTS ComponentToTypeMaster;
-DROP TABLE IF EXISTS ConstructionBaseInfo;
-DROP TABLE IF EXISTS ConstructionBaseInfoDetail;
-DROP TABLE IF EXISTS ConstructionBudget;
-DROP TABLE IF EXISTS ConstructionBudgetDetail;
-DROP TABLE IF EXISTS ConstructionItemMaster;
-DROP TABLE IF EXISTS ConstructionLedger;
-DROP TABLE IF EXISTS ConstructionLedgerDetail;
-DROP TABLE IF EXISTS ConstructionLedgerExcute;
-DROP TABLE IF EXISTS ConstructionLink;
-DROP TABLE IF EXISTS ConstructionProgressDate;
-DROP TABLE IF EXISTS ConstructionSpecMaster;
-DROP TABLE IF EXISTS ConstructionSpecUnitPrice;
-DROP TABLE IF EXISTS ConstructionTypeMaster;
-DROP TABLE IF EXISTS CostDataOfPerson;
-DROP TABLE IF EXISTS CostomerRegist;
-DROP TABLE IF EXISTS DailyDataConstruction;
-DROP TABLE IF EXISTS DailyDataDetail;
-DROP TABLE IF EXISTS DailyDataField;
-DROP TABLE IF EXISTS DailyDataMaterials;
-DROP TABLE IF EXISTS DailyDataSubcontractors;
-DROP TABLE IF EXISTS DailyDataVehicles;
-DROP TABLE IF EXISTS DayMaster;
-DROP TABLE IF EXISTS DepartmentExpensesMaster;
-DROP TABLE IF EXISTS DepartmentMaster;
-DROP TABLE IF EXISTS DivisionMaster;
-DROP TABLE IF EXISTS EstimateBudget;
-DROP TABLE IF EXISTS EstimateBudgetDetail;
-DROP TABLE IF EXISTS EstimateData;
-DROP TABLE IF EXISTS EstimateDataBody;
-DROP TABLE IF EXISTS EstimateDataDetail;
-DROP TABLE IF EXISTS HolidayCalenderMaster;
-DROP TABLE IF EXISTS InputSearchLogData;
-DROP TABLE IF EXISTS MessageBoardData;
-DROP TABLE IF EXISTS MessageBoardTerget;
-DROP TABLE IF EXISTS MessageBrowsingHistory;
-DROP TABLE IF EXISTS MonthMaster;
-DROP TABLE IF EXISTS OrderersMaster;
-DROP TABLE IF EXISTS OrdersPriceData;
-DROP TABLE IF EXISTS PersonApproval;
-DROP TABLE IF EXISTS PersonApprovalComment;
-DROP TABLE IF EXISTS PersonDepartmentMaster;
-DROP TABLE IF EXISTS PersonInChargeMaster;
-DROP TABLE IF EXISTS PersonSalaryMaster;
-DROP TABLE IF EXISTS ProceedingsData;
-DROP TABLE IF EXISTS ProceedingsDataAttend;
-DROP TABLE IF EXISTS ProceedingsDataDetail;
-DROP TABLE IF EXISTS ProcessApproval;
-DROP TABLE IF EXISTS ProcessApprovalComment;
-DROP TABLE IF EXISTS ProcessApprovalDetail;
-DROP TABLE IF EXISTS ProcessExcuteMaster;
-DROP TABLE IF EXISTS PurchaseOrder;
-DROP TABLE IF EXISTS PurchaseOrderDetail;
-DROP TABLE IF EXISTS SalesGraphData;
-DROP TABLE IF EXISTS SecurityMaster;
-DROP TABLE IF EXISTS SubConstrJobItemRegist;
-DROP TABLE IF EXISTS SubConstrJobLinkRegist;
-DROP TABLE IF EXISTS SubConstrRegist;
-DROP TABLE IF EXISTS SubContractorItemMaster;
-DROP TABLE IF EXISTS SubContractorJobCategory;
-DROP TABLE IF EXISTS SubContractorJobItem;
-DROP TABLE IF EXISTS SubContractorJobLink;
-DROP TABLE IF EXISTS SubContractorMaster;
-DROP TABLE IF EXISTS SuppliersMaster;
-DROP TABLE IF EXISTS SystemExecute;
-DROP TABLE IF EXISTS SystemMaster;
-DROP TABLE IF EXISTS TermMaster;
-DROP TABLE IF EXISTS TranceportDailyData;
-DROP TABLE IF EXISTS TypeExpensesMaster;
-DROP TABLE IF EXISTS UnitMaster;
-DROP TABLE IF EXISTS VehicleMaster;
-DROP TABLE IF EXISTS VehicleRecordData;
-DROP TABLE IF EXISTS VehicleScheduleData;
-DROP TABLE IF EXISTS YearMaster;
+create index ActionScheduleData_Index3
+  on actionscheduledata(TargetDay);
 
+-- 承認経路マスタ
+drop table if exists approvalmaster cascade;
 
+create table approvalmaster (
+  ApprovalCode decimal(3,0) unsigned not null comment '承認機能番号'
+  , DepartmentCode decimal(5,0) unsigned not null comment '部署コード'
+  , SeqNo decimal(2,0) not null comment '枝番'
+  , DisplayOrder decimal(2,0) not null comment '表示順'
+  , ApprovalPerson decimal(8,0) unsigned not null comment '承認者コード'
+  , ApprovalAuthority decimal(1,0) not null comment '承認権限区分'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint approvalmaster_PKC primary key (ApprovalCode,DepartmentCode,SeqNo)
+) comment '承認経路マスタ' ;
 
+-- 出勤日報データ
+drop index AttendDaily_Index1 on attendancedailydata;
+drop index AttendDaily_Index2 on attendancedailydata;
 
-/* Create Tables */
+drop table if exists attendancedailydata cascade;
 
--- 担当者行動予定データ
-CREATE TABLE ActionScheduleData
-(
-	TargetDate date NOT NULL COMMENT '対象日',
-	PersonCode decimal(8,0) NOT NULL COMMENT '担当者コード',
-	ActionSchedule varchar(30) COMMENT '行動予定',
-	TargetYear year(4) NOT NULL COMMENT '該当年',
-	TargetMonth year(2) NOT NULL COMMENT '該当月',
-	TargetDay year(2) NOT NULL COMMENT '該当日',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (TargetDate, PersonCode)
-) COMMENT = '担当者行動予定データ';
+create table attendancedailydata (
+  PersonCode decimal(8,0) unsigned not null comment '作成者コード'
+  , AttendanceDate date not null comment '日報作成日'
+  , SeqNo decimal(3,0) unsigned not null comment '明細行番号'
+  , ActionResult varchar(30) not null comment '行動実績'
+  , OvertimeHours decimal(4,1) not null comment '残業時間'
+  , WorkingComment varchar(120) comment 'コメント'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint attendancedailydata_PKC primary key (PersonCode,AttendanceDate,SeqNo)
+) comment '出勤日報データ' ;
 
+create index AttendDaily_Index1
+  on attendancedailydata(ActionResult);
 
--- 承認経路マスタ
-CREATE TABLE ApprovalMaster
-(
-	ApprovalCode decimal(3,0) unsigned NOT NULL COMMENT '承認機能番号',
-	DepartmentCode decimal(5,0) unsigned NOT NULL COMMENT '部署コード',
-	SeqNo decimal(2) NOT NULL COMMENT '枝番',
-	DisplayOrder decimal(2) NOT NULL COMMENT '表示順',
-	ApprovalPerson decimal(8) unsigned NOT NULL COMMENT '承認者コード',
-	ApprovalAuthority decimal(1) NOT NULL COMMENT '承認権限区分',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ApprovalCode, DepartmentCode, SeqNo)
-) COMMENT = '承認経路マスタ';
+create index AttendDaily_Index2
+  on attendancedailydata(AttendanceDate);
 
+-- 出勤管理データ
+drop table if exists attendancedata cascade;
 
--- 出勤日報データ
-CREATE TABLE AttendanceDailyData
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '作成者コード',
-	AttendanceDate date NOT NULL COMMENT '日報作成日',
-	SeqNo decimal(3) unsigned NOT NULL COMMENT '明細行番号',
-	ActionResult varchar(30) NOT NULL COMMENT '行動実績',
-	OvertimeHours decimal(4,1) NOT NULL COMMENT '残業時間',
-	WorkingComment varchar(120) COMMENT 'コメント',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, AttendanceDate, SeqNo)
-) COMMENT = '出勤日報データ';
+create table attendancedata (
+  PersonCode decimal(8,0) unsigned not null comment '作成者コード'
+  , AttendanceMonth date not null comment '出勤管理年月'
+  , LastDays decimal(2,0) unsigned not null comment '当月最終日'
+  , AttendDayCount decimal(2,0) unsigned not null comment '出勤日数'
+  , TotalOverTimes decimal(4,1) not null comment '残業時間数'
+  , OrderDate date not null comment '申請日'
+  , OrderNo decimal(2,0) unsigned not null comment '申請受付番号'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint attendancedata_PKC primary key (PersonCode,AttendanceMonth)
+) comment '出勤管理データ' ;
 
+-- 銀行営業日マスタ
+drop table if exists bankbusinessdaymaster cascade;
 
--- 出勤管理データ
-CREATE TABLE AttendanceData
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '作成者コード',
-	AttendanceMonth date NOT NULL COMMENT '出勤管理年月',
-	LastDays decimal(2) unsigned NOT NULL COMMENT '当月最終日',
-	AttendDayCount decimal(2) unsigned NOT NULL COMMENT '出勤日数',
-	TotalOverTimes decimal(4,1) NOT NULL COMMENT '残業時間数',
-	OrderDate date NOT NULL COMMENT '申請日',
-	OrderNo decimal(2) unsigned NOT NULL COMMENT '申請受付番号',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, AttendanceMonth)
-) COMMENT = '出勤管理データ';
+create table bankbusinessdaymaster (
+  YEARMONTH decimal(6,0) default '0' not null comment '年月'
+  , BANKBUSINESSDAY decimal(2,0) default '0' not null comment '銀行営業日'
+  , NOTE varchar(120) comment '備考'
+  , DELETEFLG decimal(1,0) comment '削除フラグ'
+  , ENTRYDATE datetime comment '登録年月日'
+  , UPDATEDATE datetime comment '更新年月日'
+  , constraint bankbusinessdaymaster_PKC primary key (YEARMONTH,BANKBUSINESSDAY)
+) comment '銀行営業日マスタ' ;
 
+-- 業者請求データ
+drop table if exists billingdata cascade;
 
+create table billingdata (
+  COMPANYCODE decimal(8,0) default '0' not null comment '協力会社コード'
+  , TARGETDATE decimal(6,0) default '0' not null comment '対象年月'
+  , SEQNO decimal(3,0) default '0' not null comment '連番'
+  , BILLPRICE decimal(10,0) comment '請求金額'
+  , ENTRYDATE datetime comment '登録年月日'
+  , UPDATEDATE datetime comment '更新年月日'
+  , constraint billingdata_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO)
+) comment '業者請求データ' ;
+
+-- 業者請求明細データ
+drop table if exists billingdatadetail cascade;
+
+create table billingdatadetail (
+  COMPANYCODE decimal(8,0) default '0' not null comment '協力会社コード'
+  , TARGETDATE decimal(6,0) default '0' not null comment '対象年月'
+  , SEQNO decimal(3,0) default '0' not null comment '連番'
+  , LINECOUNT decimal(3,0) default '0' not null comment '行番号'
+  , CONSTRUCTIONCODE decimal(10,0) comment '工事番号'
+  , FIELDNAME varchar(120) comment '現場名'
+  , BILLPRICE decimal(10,0) comment '請求金額'
+  , HIGHWPRICE decimal(10,0) comment '高速代'
+  , HARDWPRICE decimal(10,0) comment '金物代'
+  , INDSWASTETAX decimal(10,0) comment '産廃税'
+  , NOTE varchar(120) comment '備考'
+  , ENTRYDATE datetime comment '登録年月日'
+  , UPDATEDATE datetime comment '更新年月日'
+  , constraint billingdatadetail_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT)
+) comment '業者請求明細データ' ;
+
+-- 業者請求支払サマリーデータ
+drop table if exists billingpaymentsummary cascade;
+
+create table billingpaymentsummary (
+  COMPANYCODE decimal(8,0) default '0' not null comment '協力会社コード'
+  , TARGETDATE decimal(6,0) default '0' not null comment '対象年月'
+  , CHARGEPAYMENTKIND decimal(1,0) default '0' not null comment '請求支払区分'
+  , PAYDAY date comment '支払日'
+  , BILLPRICESTOTAL decimal(10,0) comment '請求金額小計'
+  , CONSUMPTIONTAXRATE decimal(6,3) comment '消費税率'
+  , CONSUMPTIONTAXPRICE decimal(10,0) comment '消費税額'
+  , HIGHWPRICESTOTAL decimal(10,0) comment '高速代小計'
+  , HARDWPRICESTOTAL decimal(10,0) comment '金物代小計'
+  , INDSWASTETAXSTOTAL decimal(10,0) comment '産廃税小計'
+  , CNSTRPRICERATE decimal(6,3) comment '協力金比率'
+  , CNSTRPRICESTOTAL decimal(10,0) comment '協力金小計'
+  , BILLINGPRICETOTAL decimal(10,0) comment '請求金額合計'
+  , ENTRYDATE datetime comment '登録年月日'
+  , UPDATEDATE datetime comment '更新年月日'
+  , constraint billingpaymentsummary_PKC primary key (COMPANYCODE,TARGETDATE,CHARGEPAYMENTKIND)
+) comment '業者請求支払サマリーデータ' ;
+
 -- 工事詳細台帳データ【退避用】
-CREATE TABLE BK_ConstructionLedger
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	ConstructionPeriod decimal(4) unsigned NOT NULL COMMENT '事業期',
-	CreatorCode decimal(8,0) COMMENT '作成者コード',
-	CreatorName varchar(60) COMMENT '作成者名',
-	CreateDate date NOT NULL COMMENT '作成日',
-	ConstructionTimes decimal(5,2) NOT NULL COMMENT '工期（単位・月）',
-	ConstructionStart date NOT NULL COMMENT '契約工期開始',
-	ConstructionEnd date NOT NULL COMMENT '契約工期完了',
-	OrdersDecisionPrice decimal(14,0) NOT NULL COMMENT '税抜受注決定金額',
-	CompanyExpenses decimal(10,0) NOT NULL COMMENT '会社経費合計',
-	DepartmentExpenses decimal(10,0) NOT NULL COMMENT '部署経費合計',
-	SalesExpenses decimal(10,0) NOT NULL COMMENT '営業経費合計',
-	TotalPayment decimal(10,0) NOT NULL COMMENT '総支払額',
-	GrossProfit decimal(10,0) NOT NULL COMMENT '粗利',
-	Allowance decimal(10,0) NOT NULL COMMENT '給与',
-	NetProfit decimal(10,0) NOT NULL COMMENT '純利益',
-	ComplateFlg decimal(1) NOT NULL COMMENT '入力完了フラグ',
-	IntegrationFlg decimal(1) NOT NULL COMMENT '受注金額積算フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode)
-) COMMENT = '工事詳細台帳データ【退避用】';
+drop table if exists bk_constructionledger cascade;
 
+create table bk_constructionledger (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , ConstructionPeriod decimal(4,0) unsigned not null comment '事業期'
+  , CreatorCode decimal(8,0) comment '作成者コード'
+  , CreatorName varchar(60) comment '作成者名'
+  , CreateDate date not null comment '作成日'
+  , ConstructionTimes decimal(5,2) not null comment '工期（単位・月）'
+  , ConstructionStart date not null comment '契約工期開始'
+  , ConstructionEnd date not null comment '契約工期完了'
+  , OrdersDecisionPrice decimal(14,0) not null comment '税抜受注決定金額'
+  , CompanyExpenses decimal(10,0) not null comment '会社経費合計'
+  , DepartmentExpenses decimal(10,0) not null comment '部署経費合計'
+  , SalesExpenses decimal(10,0) not null comment '営業経費合計'
+  , TotalPayment decimal(10,0) not null comment '総支払額'
+  , GrossProfit decimal(10,0) not null comment '粗利'
+  , Allowance decimal(10,0) not null comment '給与'
+  , NetProfit decimal(10,0) not null comment '純利益'
+  , ComplateFlg decimal(1,0) not null comment '入力完了フラグ'
+  , IntegrationFlg decimal(1,0) not null comment '受注金額積算フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint bk_constructionledger_PKC primary key (ConstructionCode)
+) comment '工事詳細台帳データ【退避用】' ;
 
 -- 工事詳細台帳明細データ【退避用】
-CREATE TABLE BK_ConstructionLedgerDetail
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	GroupCount decimal(2,0) unsigned NOT NULL COMMENT 'グループ番号',
-	LineCount decimal(5) unsigned NOT NULL COMMENT '行番号',
-	ComponentCode decimal(5,0) unsigned NOT NULL COMMENT '構成キー',
-	ItemCode decimal(5,0) unsigned NOT NULL COMMENT '工種キー',
-	FirstString varchar(120) COMMENT '項目名称',
-	SecondString varchar(120) COMMENT '工事内容',
-	CompanyType decimal(1) NOT NULL COMMENT '協力会社コードタイプ',
-	CompanyCode decimal(8,0) NOT NULL COMMENT '協力会社コード',
-	CompanyName varchar(120) COMMENT '協力会社名称',
-	EstimatePrice decimal(12,0) NOT NULL COMMENT '予算（見積）金額',
-	ExecutionAmount decimal(12,0) NOT NULL COMMENT '実行金額',
-	AmountConfigRate decimal(5,2) NOT NULL COMMENT '金額構成率',
-	PaymentBurden decimal(12,0) NOT NULL COMMENT '支払補填額',
-	FixDataFlg decimal(1) NOT NULL COMMENT '固定データフラグ',
-	IndependentFlg decimal(1) NOT NULL COMMENT '独立データフラグ',
-	FluctuationFlg decimal(1) NOT NULL COMMENT '増減データフラグ',
-	SalaryFlg decimal(1) NOT NULL COMMENT '給与振分区分',
-	SalaryDays decimal(4) NOT NULL COMMENT '給与振分日数',
-	OperatingFlg decimal(1) NOT NULL COMMENT '担当中フラグ',
-	SourceCode decimal(10) unsigned NOT NULL COMMENT '元工事番号',
-	JoinTitleFlg decimal(1) NOT NULL COMMENT '工事名称タイトル',
-	SalaryOnRegist decimal(12,0) NOT NULL COMMENT '登録時月額給与',
-	PurchaseOrderFlg decimal(2) NOT NULL COMMENT '注文書発行フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, GroupCount, LineCount)
-) COMMENT = '工事詳細台帳明細データ【退避用】';
+drop table if exists bk_constructionledgerdetail cascade;
 
+create table bk_constructionledgerdetail (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , GroupCount decimal(2,0) unsigned not null comment 'グループ番号'
+  , LineCount decimal(5,0) unsigned not null comment '行番号'
+  , ComponentCode decimal(5,0) unsigned not null comment '構成キー'
+  , ItemCode decimal(5,0) unsigned not null comment '工種キー'
+  , FirstString varchar(120) comment '項目名称'
+  , SecondString varchar(120) comment '工事内容'
+  , CompanyType decimal(1,0) not null comment '協力会社コードタイプ'
+  , CompanyCode decimal(8,0) not null comment '協力会社コード'
+  , CompanyName varchar(120) comment '協力会社名称'
+  , EstimatePrice decimal(12,0) not null comment '予算（見積）金額'
+  , ExecutionAmount decimal(12,0) not null comment '実行金額'
+  , AmountConfigRate decimal(5,2) not null comment '金額構成率'
+  , PaymentBurden decimal(12,0) not null comment '支払補填額'
+  , FixDataFlg decimal(1,0) not null comment '固定データフラグ'
+  , IndependentFlg decimal(1,0) not null comment '独立データフラグ'
+  , FluctuationFlg decimal(1,0) not null comment '増減データフラグ'
+  , SalaryFlg decimal(1,0) not null comment '給与振分区分'
+  , SalaryDays decimal(4,0) not null comment '給与振分日数'
+  , OperatingFlg decimal(1,0) not null comment '担当中フラグ'
+  , SourceCode decimal(10,0) unsigned not null comment '元工事番号'
+  , JoinTitleFlg decimal(1,0) not null comment '工事名称タイトル'
+  , SalaryOnRegist decimal(12,0) not null comment '登録時月額給与'
+  , PurchaseOrderFlg decimal(2,0) not null comment '注文書発行フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint bk_constructionledgerdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
+) comment '工事詳細台帳明細データ【退避用】' ;
 
 -- 工事詳細台帳実行データ【退避用】
-CREATE TABLE BK_ConstructionLedgerExcute
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	GroupCount decimal(2,0) unsigned NOT NULL COMMENT 'グループ番号',
-	LineCount decimal(5) unsigned NOT NULL COMMENT '行番号',
-	ColumnCount decimal(3) NOT NULL COMMENT '列番号',
-	PaymentAmount decimal(12,0) NOT NULL COMMENT '支払金額',
-	TargetMonth date NOT NULL COMMENT '対象年月',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, GroupCount, LineCount, ColumnCount)
-) COMMENT = '工事詳細台帳実行データ【退避用】';
+drop table if exists bk_constructionledgerexcute cascade;
 
+create table bk_constructionledgerexcute (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , GroupCount decimal(2,0) unsigned not null comment 'グループ番号'
+  , LineCount decimal(5,0) unsigned not null comment '行番号'
+  , ColumnCount decimal(3,0) not null comment '列番号'
+  , PaymentAmount decimal(12,0) not null comment '支払金額'
+  , TargetMonth date not null comment '対象年月'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint bk_constructionledgerexcute_PKC primary key (ConstructionCode,GroupCount,LineCount,ColumnCount)
+) comment '工事詳細台帳実行データ【退避用】' ;
 
 -- 積算見積データ【退避用】
-CREATE TABLE BK_EstimateData
-(
-	SaveDate datetime NOT NULL COMMENT '退避日付',
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	LineCount decimal(3) unsigned NOT NULL COMMENT '行番号',
-	ComponentCode decimal(5,0) unsigned NOT NULL COMMENT '構成キー',
-	FixedItemCode varchar(1) COMMENT '固定項目キー',
-	ItemName varchar(120) COMMENT '作業名称',
-	SpecName varchar(120) COMMENT '作業／品質・形状・寸法',
-	PriceValue decimal(14,0) NOT NULL COMMENT '金額',
-	note varchar(60) COMMENT '備考',
-	MyExpensesFlg decimal(1) NOT NULL COMMENT '自社経費フラグ',
-	InputFlg decimal(1) NOT NULL COMMENT '入力フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (SaveDate, ConstructionCode, LineCount)
-) COMMENT = '積算見積データ【退避用】';
+drop table if exists bk_estimatedata cascade;
 
+create table bk_estimatedata (
+  SaveDate datetime not null comment '退避日付'
+  , ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , LineCount decimal(3,0) unsigned not null comment '行番号'
+  , ComponentCode decimal(5,0) unsigned not null comment '構成キー'
+  , FixedItemCode varchar(1) comment '固定項目キー'
+  , ItemName varchar(120) comment '作業名称'
+  , SpecName varchar(120) comment '作業／品質・形状・寸法'
+  , PriceValue decimal(14,0) not null comment '金額'
+  , note varchar(60) comment '備考'
+  , MyExpensesFlg decimal(1,0) not null comment '自社経費フラグ'
+  , InputFlg decimal(1,0) not null comment '入力フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint bk_estimatedata_PKC primary key (SaveDate,ConstructionCode,LineCount)
+) comment '積算見積データ【退避用】' ;
 
 -- 積算見積ページデータ【退避用】
-CREATE TABLE BK_EstimateDataBody
-(
-	SaveDate datetime NOT NULL COMMENT '退避日付',
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	PageCount decimal(4) unsigned NOT NULL COMMENT 'ページ番号',
-	Category decimal(1) NOT NULL COMMENT 'ページ区分',
-	UnionComponentCode decimal(5) unsigned NOT NULL COMMENT '所属構成キー',
-	ComponentCode decimal(5,0) unsigned NOT NULL COMMENT '構成キー',
-	ItemCode decimal(5,0) unsigned NOT NULL COMMENT '工種キー',
-	SelectComponent decimal(5) unsigned NOT NULL COMMENT '選択構成キー',
-	PageTitle varchar(120) NOT NULL COMMENT 'ページ表示名',
-	DetailLineCount decimal(3) unsigned NOT NULL COMMENT '明細行番号',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (SaveDate, ConstructionCode, PageCount)
-) COMMENT = '積算見積ページデータ【退避用】';
+drop table if exists bk_estimatedatabody cascade;
 
+create table bk_estimatedatabody (
+  SaveDate datetime not null comment '退避日付'
+  , ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , PageCount decimal(4,0) unsigned not null comment 'ページ番号'
+  , Category decimal(1,0) not null comment 'ページ区分'
+  , UnionComponentCode decimal(5,0) unsigned not null comment '所属構成キー'
+  , ComponentCode decimal(5,0) unsigned not null comment '構成キー'
+  , ItemCode decimal(5,0) unsigned not null comment '工種キー'
+  , SelectComponent decimal(5,0) unsigned not null comment '選択構成キー'
+  , PageTitle varchar(120) not null comment 'ページ表示名'
+  , DetailLineCount decimal(3,0) unsigned not null comment '明細行番号'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint bk_estimatedatabody_PKC primary key (SaveDate,ConstructionCode,PageCount)
+) comment '積算見積ページデータ【退避用】' ;
 
 -- 積算見積データ明細【退避用】
-CREATE TABLE BK_EstimateDataDetail
-(
-	SaveDate datetime NOT NULL COMMENT '退避日付',
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	PageCount decimal(4) unsigned NOT NULL COMMENT 'ページ番号',
-	LineCount decimal(3) unsigned NOT NULL COMMENT '行番号',
-	DataType decimal(1) NOT NULL COMMENT 'データ種別',
-	ComponentCode decimal(5,0) unsigned NOT NULL COMMENT '構成キー',
-	ItemCode decimal(5,0) unsigned NOT NULL COMMENT '工種キー',
-	SpecCode decimal(5,0) unsigned NOT NULL COMMENT '作業キー',
-	ItemName varchar(120) COMMENT '作業名称',
-	SpecName varchar(120) COMMENT '作業／品質・形状・寸法',
-	Unitcount decimal(8,2) NOT NULL COMMENT '数量',
-	UnitName varchar(30) COMMENT '単位名称',
-	UnitPrice decimal(9,2) NOT NULL COMMENT '単価',
-	LineTotal decimal(12,0) NOT NULL COMMENT '金額',
-	note varchar(60) COMMENT '備考',
-	CompanyCode decimal(8) NOT NULL COMMENT '協力会社コード',
-	MyExpensesFlg decimal(1) NOT NULL COMMENT '自社経費フラグ',
-	InputFlg decimal(1) COMMENT '入力フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (SaveDate, ConstructionCode, PageCount, LineCount)
-) COMMENT = '積算見積データ明細【退避用】';
+drop table if exists bk_estimatedatadetail cascade;
 
+create table bk_estimatedatadetail (
+  SaveDate datetime not null comment '退避日付'
+  , ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , PageCount decimal(4,0) unsigned not null comment 'ページ番号'
+  , LineCount decimal(3,0) unsigned not null comment '行番号'
+  , DataType decimal(1,0) not null comment 'データ種別'
+  , ComponentCode decimal(5,0) unsigned not null comment '構成キー'
+  , ItemCode decimal(5,0) unsigned not null comment '工種キー'
+  , SpecCode decimal(5,0) unsigned not null comment '作業キー'
+  , ItemName varchar(120) comment '作業名称'
+  , SpecName varchar(120) comment '作業／品質・形状・寸法'
+  , Unitcount decimal(8,2) not null comment '数量'
+  , UnitName varchar(30) comment '単位名称'
+  , UnitPrice decimal(9,2) not null comment '単価'
+  , LineTotal decimal(12,0) not null comment '金額'
+  , note varchar(60) comment '備考'
+  , CompanyCode decimal(8,0) not null comment '協力会社コード'
+  , MyExpensesFlg decimal(1,0) not null comment '自社経費フラグ'
+  , InputFlg decimal(1,0) comment '入力フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint bk_estimatedatadetail_PKC primary key (SaveDate,ConstructionCode,PageCount,LineCount)
+) comment '積算見積データ明細【退避用】' ;
 
 -- 法人格マスタ
-CREATE TABLE BusinessTypeMaster
-(
-	BusinessTypeCode decimal(5,0) unsigned NOT NULL COMMENT '法人格コード',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	BusinessTypeName varchar(100) DEFAULT '' NOT NULL COMMENT '業種名',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (BusinessTypeCode)
-) COMMENT = '法人格マスタ';
+drop index BusinessTypeMaster_Index1 on businesstypemaster;
 
+drop table if exists businesstypemaster cascade;
 
+create table businesstypemaster (
+  BusinessTypeCode decimal(5,0) unsigned not null comment '法人格コード'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , BusinessTypeName varchar(100) not null comment '業種名'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint businesstypemaster_PKC primary key (BusinessTypeCode)
+) comment '法人格マスタ' ;
+
+create index BusinessTypeMaster_Index1
+  on businesstypemaster(DisplayOrder);
+
 -- 共通費大項目マスタ
-CREATE TABLE CommonCostLarge
-(
-	LargeCode decimal(5,0) unsigned NOT NULL COMMENT '大項目キー',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	LargeName varchar(50) DEFAULT '' NOT NULL COMMENT '大項目名称',
-	CommentText varchar(120) COMMENT '説明書き',
-	DeleteFlg decimal(1) NOT NULL COMMENT '削除フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (LargeCode)
-) COMMENT = '共通費大項目マスタ';
+drop table if exists commoncostlarge cascade;
 
+create table commoncostlarge (
+  LargeCode decimal(5,0) unsigned not null comment '大項目キー'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , LargeName varchar(50) not null comment '大項目名称'
+  , CommentText varchar(120) comment '説明書き'
+  , DeleteFlg decimal(1,0) not null comment '削除フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint commoncostlarge_PKC primary key (LargeCode)
+) comment '共通費大項目マスタ' ;
 
 -- 共通費工種関連マスタ
-CREATE TABLE CommonCostLinkMS
-(
-	LargeCode decimal(5,0) unsigned NOT NULL COMMENT '大項目キー',
-	MiddleCode decimal(5,0) unsigned NOT NULL COMMENT '中項目キー',
-	ItemCode decimal(5,0) unsigned NOT NULL COMMENT '工種キー',
-	EntryDate datetime COMMENT '登録日付',
-	UpdateDate datetime COMMENT '更新日付',
-	PRIMARY KEY (LargeCode, MiddleCode, ItemCode)
-) COMMENT = '共通費工種関連マスタ';
+drop table if exists commoncostlinkms cascade;
 
+create table commoncostlinkms (
+  LargeCode decimal(5,0) unsigned not null comment '大項目キー'
+  , MiddleCode decimal(5,0) unsigned not null comment '中項目キー'
+  , ItemCode decimal(5,0) unsigned not null comment '工種キー'
+  , EntryDate datetime comment '登録日付'
+  , UpdateDate datetime comment '更新日付'
+  , constraint commoncostlinkms_PKC primary key (LargeCode,MiddleCode,ItemCode)
+) comment '共通費工種関連マスタ' ;
 
 -- 共通費中項目マスタ
-CREATE TABLE CommonCostMiddle
-(
-	LargeCode decimal(5,0) unsigned NOT NULL COMMENT '大項目キー',
-	MiddleCode decimal(5,0) unsigned NOT NULL COMMENT '中項目キー',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	MiddleName varchar(50) DEFAULT '' NOT NULL COMMENT '中項目名称',
-	CommentText varchar(120) COMMENT '説明書き',
-	DeleteFlg decimal(1) NOT NULL COMMENT '削除フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (LargeCode, MiddleCode)
-) COMMENT = '共通費中項目マスタ';
+drop table if exists commoncostmiddle cascade;
 
+create table commoncostmiddle (
+  LargeCode decimal(5,0) unsigned not null comment '大項目キー'
+  , MiddleCode decimal(5,0) unsigned not null comment '中項目キー'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , MiddleName varchar(50) not null comment '中項目名称'
+  , CommentText varchar(120) comment '説明書き'
+  , DeleteFlg decimal(1,0) not null comment '削除フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint commoncostmiddle_PKC primary key (LargeCode,MiddleCode)
+) comment '共通費中項目マスタ' ;
 
 -- 共通費中項目キーマスタ
-CREATE TABLE CommonCostMiddleSearchWord
-(
-	LargeCode decimal(5,0) unsigned NOT NULL COMMENT '大項目キー',
-	MiddleCode decimal(5,0) unsigned NOT NULL COMMENT '中項目キー',
-	SeqNo decimal(5) unsigned NOT NULL COMMENT '順序',
-	SearchWord varchar(50) DEFAULT '' NOT NULL COMMENT '検索項目',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (LargeCode, MiddleCode, SeqNo)
-) COMMENT = '共通費中項目キーマスタ';
+drop table if exists commoncostmiddlesearchword cascade;
 
+create table commoncostmiddlesearchword (
+  LargeCode decimal(5,0) unsigned not null comment '大項目キー'
+  , MiddleCode decimal(5,0) unsigned not null comment '中項目キー'
+  , SeqNo decimal(5,0) unsigned not null comment '順序'
+  , SearchWord varchar(50) not null comment '検索項目'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint commoncostmiddlesearchword_PKC primary key (LargeCode,MiddleCode,SeqNo)
+) comment '共通費中項目キーマスタ' ;
 
 -- 構成工種関連マスタ
-CREATE TABLE ComponentLinkMaster
-(
-	ComponentCode decimal(5,0) unsigned NOT NULL COMMENT '構成キー',
-	ItemCode decimal(5,0) unsigned NOT NULL COMMENT '工種キー',
-	DisplayOrder decimal(5) unsigned COMMENT '表示順',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ComponentCode, ItemCode)
-) COMMENT = '構成工種関連マスタ';
+drop index ComponentLinkMaster_Index1 on componentlinkmaster;
+drop index ComponentLinkMaster_Index2 on componentlinkmaster;
 
+drop table if exists componentlinkmaster cascade;
 
--- 構成マスタ
-CREATE TABLE ComponentMaster
-(
-	ComponentCode decimal(5,0) unsigned NOT NULL COMMENT '構成キー',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	ComponentName varchar(120) DEFAULT '' NOT NULL COMMENT '構成名称',
-	SubItemsFlg decimal(1) COMMENT '下位項目フラグ',
-	DirectInputFlg decimal(1) COMMENT '直接入力フラグ',
-	MyExpensesFlg decimal(1) COMMENT '自社経費フラグ',
-	DeleteFlg decimal(1) NOT NULL COMMENT '削除フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ComponentCode)
-) COMMENT = '構成マスタ';
+create table componentlinkmaster (
+  ComponentCode decimal(5,0) unsigned not null comment '構成キー'
+  , ItemCode decimal(5,0) unsigned not null comment '工種キー'
+  , DisplayOrder decimal(5,0) unsigned comment '表示順'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint componentlinkmaster_PKC primary key (ComponentCode,ItemCode)
+) comment '構成工種関連マスタ' ;
 
+create index ComponentLinkMaster_Index1
+  on componentlinkmaster(ComponentCode);
 
--- 構成工事種別関連マスタ
-CREATE TABLE ComponentToTypeMaster
-(
-	ComponentCode decimal(5,0) unsigned NOT NULL COMMENT '構成キー',
-	TypeCode decimal(5,0) unsigned NOT NULL COMMENT '工事種別コード',
-	Dummy decimal(1) NOT NULL COMMENT 'ダミー項目',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ComponentCode, TypeCode)
-) COMMENT = '構成工事種別関連マスタ';
+create index ComponentLinkMaster_Index2
+  on componentlinkmaster(ItemCode);
 
+-- 構成マスタ
+drop index ComponentMaster_Index1 on componentmaster;
 
--- 工事基本情報
-CREATE TABLE ConstructionBaseInfo
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	TyingFlg decimal(1) NOT NULL COMMENT '紐付データフラグ',
-	JoinFlg decimal(1) NOT NULL COMMENT '結合契約工事フラグ',
-	ConstructionYear smallint unsigned NOT NULL COMMENT '工事年度',
-	ConstructionPeriod smallint unsigned NOT NULL COMMENT '工事期数',
-	RequestedDate date COMMENT '依頼受け日',
-	EstimatesSubmitDeadline date COMMENT '見積提出期限',
-	EstimatesSubmittedDate date COMMENT '見積提出日',
-	ProvisionalOrderDate date COMMENT '仮受注日',
-	OrderDate date COMMENT '受注日',
-	OrderStartingDate date COMMENT '開始予定日',
-	OrderCompletionDate date COMMENT '完了予定日',
-	PreparationStartDate date COMMENT '施工準備開始日',
-	ConstructionStartingDate date COMMENT '施工開始日',
-	ConstructionCompletionDate date COMMENT '施工完了日',
-	NonOrderDate date COMMENT '非受注日',
-	OrdersDecisionPrice decimal(12,0) NOT NULL COMMENT '税抜受注決定金額',
-	OrdersDecisionPriceInTax decimal(12,0) NOT NULL COMMENT '税込受注決定金額',
-	SalesPersonCode decimal(8,0) COMMENT '営業担当者名',
-	ConstructionPersonCode decimal(8,0) NOT NULL COMMENT '工事担当者',
-	ConstrSubPersonCode decimal(8,0) NOT NULL COMMENT '工事副担当者',
-	ConstructionInstructor decimal(8,0) NOT NULL COMMENT '工事指導員',
-	TransferConstruction decimal(8,0) NOT NULL COMMENT '工事移管先コード',
-	TransferConstructionDate date COMMENT '工事移管日',
-	OrderersDivision decimal(5) NOT NULL COMMENT '発注者区分',
-	OrderersCode decimal(5,0) unsigned NOT NULL COMMENT '発注者コード',
-	EstimatesExpirationDate date COMMENT '見積有効期限',
-	ConstructionPeriodStart date COMMENT '契約工期開始日',
-	ConstructionPeriodEnd date COMMENT '契約工期完了',
-	ConstructionPeriodStart2 date COMMENT '契約工期開始（延長時）',
-	ConstructionPeriodEnd2 date COMMENT '契約工期完了（延長時）',
-	StartDate date COMMENT '工事開始日',
-	EndDate date COMMENT '工事終了日',
-	PurchaseOrderMailingDate date COMMENT '注文書郵送日',
-	PurchaseOrderReturnDate date COMMENT '注文書返送日',
-	PurchaseOrderReturnCheckDate date COMMENT '注文書返送確認日',
-	ConsumptionTaxFlg decimal(1) NOT NULL COMMENT '消費税フラグ',
-	PrimeContractorFlg decimal(1) NOT NULL COMMENT '元請フラグ',
-	SalesCostFlg decimal(1) NOT NULL COMMENT '営業経費発生フラグ',
-	ConstructionStatusFlg decimal(2,0) NOT NULL COMMENT '工事状態フラグ',
-	ConstructionType decimal(5) NOT NULL COMMENT '工事種別コード',
-	EstimateType decimal(1) NOT NULL COMMENT '見積種別',
-	BillingStartDate date NOT NULL COMMENT '請求準備開始日',
-	BillingDate date NOT NULL COMMENT '請求日',
-	BillingSplitFlg decimal(1) NOT NULL COMMENT '請求回数フラグ',
-	BillingSendDate date COMMENT '請求書郵送/手渡し日',
-	LedgerComplateDate date NOT NULL COMMENT '工事詳細台帳入力完了日付',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode)
-) COMMENT = '工事基本情報';
+drop table if exists componentmaster cascade;
 
+create table componentmaster (
+  ComponentCode decimal(5,0) unsigned not null comment '構成キー'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , ComponentName varchar(120) not null comment '構成名称'
+  , SubItemsFlg decimal(1,0) comment '下位項目フラグ'
+  , DirectInputFlg decimal(1,0) comment '直接入力フラグ'
+  , MyExpensesFlg decimal(1,0) comment '自社経費フラグ'
+  , DeleteFlg decimal(1,0) not null comment '削除フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint componentmaster_PKC primary key (ComponentCode)
+) comment '構成マスタ' ;
 
--- 工事基本情報明細
-CREATE TABLE ConstructionBaseInfoDetail
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	DetailNo decimal(2) NOT NULL COMMENT '明細番号',
-	DetailString varchar(120) COMMENT '明細内容',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, DetailNo)
-) COMMENT = '工事基本情報明細';
+create index ComponentMaster_Index1
+  on componentmaster(DisplayOrder);
 
+-- 構成工事種別関連マスタ
+drop index ComponentToTypeMaster_Index1 on componenttotypemaster;
+drop index ComponentToTypeMaster_Index2 on componenttotypemaster;
 
--- 工事施工予算データ
-CREATE TABLE ConstructionBudget
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	CreatorCode decimal(8,0) NOT NULL COMMENT '作成者コード',
-	CreatorName varchar(60) COMMENT '作成者名',
-	CreatorCosts decimal(11,0) NOT NULL COMMENT '作成者給与',
-	AssistantCode decimal(8,0) NOT NULL COMMENT '副担当者コード',
-	AssistantName varchar(60) COMMENT '副担当者名',
-	AssistantCosts decimal(11,0) NOT NULL COMMENT '副担当者給与',
-	InstructorCode decimal(8,0) NOT NULL COMMENT '工事指導員コード',
-	InstructorName varchar(60) COMMENT '工事指導員名',
-	InstructorCosts decimal(11,0) NOT NULL COMMENT '工事指導員給与',
-	CreateDate date NOT NULL COMMENT '作成日',
-	ConstructionTimes decimal(5,2) NOT NULL COMMENT '工期（単位・月）',
-	ConstructionStart date NOT NULL COMMENT '契約工期開始',
-	ConstructionEnd date NOT NULL COMMENT '契約工期完了',
-	InstructorTimes decimal(5,2) NOT NULL COMMENT '指導員稼働月数',
-	SalaryFlg decimal(1) NOT NULL COMMENT '給与振分区分',
-	SalaryDays decimal(4) NOT NULL COMMENT '振分日数',
-	A_SalaryFlg decimal(1) NOT NULL COMMENT '副担当者給与振分区分',
-	A_SalaryDays decimal(4) NOT NULL COMMENT '副担当者振分日数',
-	I_SalaryFlg decimal(1) NOT NULL COMMENT '指導員給与振分区分',
-	I_SalaryDays decimal(4) NOT NULL COMMENT '指導員振分日数',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode)
-) COMMENT = '工事施工予算データ';
+drop table if exists componenttotypemaster cascade;
 
+create table componenttotypemaster (
+  ComponentCode decimal(5,0) unsigned not null comment '構成キー'
+  , TypeCode decimal(5,0) unsigned not null comment '工事種別コード'
+  , Dummy decimal(1,0) not null comment 'ダミー項目'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint componenttotypemaster_PKC primary key (ComponentCode,TypeCode)
+) comment '構成工事種別関連マスタ' ;
 
--- 工事施工予算データ明細
-CREATE TABLE ConstructionBudgetDetail
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	GroupCount decimal(2,0) unsigned NOT NULL COMMENT 'グループ番号',
-	LineCount decimal(3) unsigned NOT NULL COMMENT '行番号',
-	ComponentCode decimal(5,0) unsigned NOT NULL COMMENT '構成キー',
-	ItemCode decimal(5,0) unsigned NOT NULL COMMENT '工種キー',
-	FirstString varchar(120) COMMENT '項目名称',
-	SecondString varchar(120) COMMENT '工事内容',
-	CompanyType decimal(1) NOT NULL COMMENT '協力会社コードタイプ',
-	CompanyCode decimal(8,0) NOT NULL COMMENT '協力会社コード',
-	CompanyName varchar(120) COMMENT '協力会社名称',
-	EstimatePrice decimal(12,0) NOT NULL COMMENT '積算時見積金額',
-	NegotiationPrice decimal(12,0) NOT NULL COMMENT '積算時交渉金額',
-	OrderDesiredAmount decimal(12,0) NOT NULL COMMENT '発注希望金額',
-	ExecutionAmount decimal(12,0) NOT NULL COMMENT '実行金額',
-	AmountConfigRate decimal(5,2) NOT NULL COMMENT '金額構成率',
-	NegotiateFlg decimal(1) NOT NULL COMMENT '協力業者交渉フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, GroupCount, LineCount)
-) COMMENT = '工事施工予算データ明細';
+create index ComponentToTypeMaster_Index1
+  on componenttotypemaster(ComponentCode);
 
+create index ComponentToTypeMaster_Index2
+  on componenttotypemaster(TypeCode);
 
--- 工種マスタ
-CREATE TABLE ConstructionItemMaster
-(
-	ItemCode decimal(5,0) unsigned NOT NULL COMMENT '工種キー',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	ItemName varchar(120) DEFAULT '' NOT NULL COMMENT '工種名称',
-	SubItemsFlg decimal(1) COMMENT '下位項目フラグ',
-	MyExpensesFlg decimal(1) NOT NULL COMMENT '自社経費フラグ',
-	DeleteFlg decimal(1) NOT NULL COMMENT '削除フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ItemCode)
-) COMMENT = '工種マスタ';
+-- 工事基本情報
+drop index BaseInfo_Index1 on constructionbaseinfo;
+drop index BaseInfo_Index2 on constructionbaseinfo;
+drop index BaseInfo_Index3 on constructionbaseinfo;
+drop index BaseInfo_Index4 on constructionbaseinfo;
+drop index BaseInfo_Index5 on constructionbaseinfo;
+drop index BaseInfo_Index6 on constructionbaseinfo;
 
+drop table if exists constructionbaseinfo cascade;
 
--- 工事詳細台帳データ
-CREATE TABLE ConstructionLedger
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	ConstructionPeriod decimal(4) unsigned NOT NULL COMMENT '事業期',
-	CreatorCode decimal(8,0) COMMENT '作成者コード',
-	CreatorName varchar(60) COMMENT '作成者名',
-	CreateDate date NOT NULL COMMENT '作成日',
-	ConstructionTimes decimal(5,2) NOT NULL COMMENT '工期（単位・月）',
-	ConstructionStart date NOT NULL COMMENT '契約工期開始',
-	ConstructionEnd date NOT NULL COMMENT '契約工期完了',
-	OrdersDecisionPrice decimal(14,0) NOT NULL COMMENT '税抜受注決定金額',
-	CompanyExpenses decimal(10,0) NOT NULL COMMENT '会社経費合計',
-	DepartmentExpenses decimal(10,0) NOT NULL COMMENT '部署経費合計',
-	SalesExpenses decimal(10,0) NOT NULL COMMENT '営業経費合計',
-	TotalPayment decimal(10,0) NOT NULL COMMENT '総支払額',
-	GrossProfit decimal(10,0) NOT NULL COMMENT '粗利',
-	Allowance decimal(10,0) NOT NULL COMMENT '給与',
-	NetProfit decimal(10,0) NOT NULL COMMENT '純利益',
-	ComplateFlg decimal(1) NOT NULL COMMENT '入力完了フラグ',
-	IntegrationFlg decimal(1) NOT NULL COMMENT '受注金額積算フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode)
-) COMMENT = '工事詳細台帳データ';
+create table constructionbaseinfo (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , TyingFlg decimal(1,0) not null comment '紐付データフラグ'
+  , JoinFlg decimal(1,0) not null comment '結合契約工事フラグ'
+  , ConstructionYear smallint(5) unsigned not null comment '工事年度'
+  , ConstructionPeriod smallint(5) unsigned not null comment '工事期数'
+  , RequestedDate date comment '依頼受け日'
+  , EstimatesSubmitDeadline date comment '見積提出期限'
+  , EstimatesSubmittedDate date comment '見積提出日'
+  , ProvisionalOrderDate date comment '仮受注日'
+  , OrderDate date comment '受注日'
+  , OrderStartingDate date comment '開始予定日'
+  , OrderCompletionDate date comment '完了予定日'
+  , PreparationStartDate date comment '施工準備開始日'
+  , ConstructionStartingDate date comment '施工開始日'
+  , ConstructionCompletionDate date comment '施工完了日'
+  , NonOrderDate date comment '非受注日'
+  , OrdersDecisionPrice decimal(12,0) not null comment '税抜受注決定金額'
+  , OrdersDecisionPriceInTax decimal(12,0) not null comment '税込受注決定金額'
+  , SalesPersonCode decimal(8,0) comment '営業担当者名'
+  , ConstructionPersonCode decimal(8,0) not null comment '工事担当者'
+  , ConstrSubPersonCode decimal(8,0) not null comment '工事副担当者'
+  , ConstructionInstructor decimal(8,0) not null comment '工事指導員'
+  , TransferConstruction decimal(8,0) not null comment '工事移管先コード'
+  , TransferConstructionDate date comment '工事移管日'
+  , OrderersDivision decimal(5,0) not null comment '発注者区分'
+  , OrderersCode decimal(5,0) unsigned not null comment '発注者コード'
+  , EstimatesExpirationDate date comment '見積有効期限'
+  , ConstructionPeriodStart date comment '契約工期開始日'
+  , ConstructionPeriodEnd date comment '契約工期完了'
+  , ConstructionPeriodStart2 date comment '契約工期開始（延長時）'
+  , ConstructionPeriodEnd2 date comment '契約工期完了（延長時）'
+  , StartDate date comment '工事開始日'
+  , EndDate date comment '工事終了日'
+  , PurchaseOrderMailingDate date comment '注文書郵送日'
+  , PurchaseOrderReturnDate date comment '注文書返送日'
+  , PurchaseOrderReturnCheckDate date comment '注文書返送確認日'
+  , ConsumptionTaxFlg decimal(1,0) not null comment '消費税フラグ'
+  , PrimeContractorFlg decimal(1,0) not null comment '元請フラグ'
+  , SalesCostFlg decimal(1,0) not null comment '営業経費発生フラグ'
+  , ConstructionStatusFlg decimal(2,0) not null comment '工事状態フラグ'
+  , ConstructionType decimal(5,0) not null comment '工事種別コード'
+  , EstimateType decimal(1,0) not null comment '見積種別'
+  , BillingStartDate date not null comment '請求準備開始日'
+  , BillingDate date not null comment '請求日'
+  , BillingSplitFlg decimal(1,0) not null comment '請求回数フラグ'
+  , BillingSendDate date comment '請求書郵送/手渡し日'
+  , LedgerComplateDate date not null comment '工事詳細台帳入力完了日付'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint constructionbaseinfo_PKC primary key (ConstructionCode)
+) comment '工事基本情報' ;
 
+create index BaseInfo_Index1
+  on constructionbaseinfo(ConstructionStatusFlg);
 
--- 工事詳細台帳明細データ
-CREATE TABLE ConstructionLedgerDetail
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	GroupCount decimal(2,0) unsigned NOT NULL COMMENT 'グループ番号',
-	LineCount decimal(3) unsigned NOT NULL COMMENT '行番号',
-	ComponentCode decimal(5,0) unsigned NOT NULL COMMENT '構成キー',
-	ItemCode decimal(5,0) unsigned NOT NULL COMMENT '工種キー',
-	FirstString varchar(120) COMMENT '項目名称',
-	SecondString varchar(120) COMMENT '工事内容',
-	CompanyType decimal(1) NOT NULL COMMENT '協力会社コードタイプ',
-	CompanyCode decimal(8,0) NOT NULL COMMENT '協力会社コード',
-	CompanyName varchar(120) COMMENT '協力会社名称',
-	EstimatePrice decimal(12,0) NOT NULL COMMENT '予算（見積）金額',
-	ExecutionAmount decimal(12,0) NOT NULL COMMENT '実行金額',
-	AmountConfigRate decimal(5,2) NOT NULL COMMENT '金額構成率',
-	PaymentBurden decimal(12,0) NOT NULL COMMENT '支払補填額',
-	FixDataFlg decimal(1) NOT NULL COMMENT '固定データフラグ',
-	IndependentFlg decimal(1) NOT NULL COMMENT '独立データフラグ',
-	FluctuationFlg decimal(1) NOT NULL COMMENT '増減データフラグ',
-	SalaryFlg decimal(1) NOT NULL COMMENT '給与振分区分',
-	SalaryDays decimal(4) NOT NULL COMMENT '給与振分日数',
-	OperatingFlg decimal(1) NOT NULL COMMENT '担当中フラグ',
-	SourceCode decimal(10) unsigned NOT NULL COMMENT '元工事番号',
-	JoinTitleFlg decimal(1) NOT NULL COMMENT '工事名称タイトル',
-	SalaryOnRegist decimal(12,0) NOT NULL COMMENT '登録時月額給与',
-	PurchaseOrderFlg decimal(2) NOT NULL COMMENT '注文書発行フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, GroupCount, LineCount)
-) COMMENT = '工事詳細台帳明細データ';
+create index BaseInfo_Index2
+  on constructionbaseinfo(EstimateType);
 
+create index BaseInfo_Index3
+  on constructionbaseinfo(SalesPersonCode);
 
--- 工事詳細台帳実行データ
-CREATE TABLE ConstructionLedgerExcute
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	GroupCount decimal(2,0) unsigned NOT NULL COMMENT 'グループ番号',
-	LineCount decimal(3) unsigned NOT NULL COMMENT '行番号',
-	ColumnCount decimal(3) NOT NULL COMMENT '列番号',
-	PaymentAmount decimal(12,0) NOT NULL COMMENT '支払金額',
-	TargetMonth date NOT NULL COMMENT '対象年月',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, GroupCount, LineCount, ColumnCount)
-) COMMENT = '工事詳細台帳実行データ';
+create index BaseInfo_Index4
+  on constructionbaseinfo(ConstructionPersonCode);
 
+create index BaseInfo_Index5
+  on constructionbaseinfo(ConstructionInstructor);
 
--- 工事リンク情報
-CREATE TABLE ConstructionLink
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	FluctuationCode decimal(10,0) NOT NULL COMMENT '子工事番号',
-	LinkType decimal(1) NOT NULL COMMENT 'リンク種別',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, FluctuationCode)
-) COMMENT = '工事リンク情報';
+create index BaseInfo_Index6
+  on constructionbaseinfo(ConstructionPeriod);
 
+-- 工事基本情報明細
+drop index BaseInfoDetail_Idx1 on constructionbaseinfodetail;
+drop index BaseInfoDetail_Idx2 on constructionbaseinfodetail;
 
--- 案件進捗日付データ
-CREATE TABLE ConstructionProgressDate
-(
-	ConstructionCode decimal(10,0) NOT NULL COMMENT '工事番号',
-	ConstructionStatusFlg decimal(2,0) NOT NULL COMMENT '設定工事状態',
-	PreviousStatusFlg decimal(2,0) COMMENT '変更前状態',
-	ChangeDate datetime NOT NULL COMMENT '設定日付',
-	ChangePersonCode decimal(8,0) NOT NULL COMMENT '設定担当者',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, ConstructionStatusFlg)
-) COMMENT = '案件進捗日付データ';
+drop table if exists constructionbaseinfodetail cascade;
 
+create table constructionbaseinfodetail (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , DetailNo decimal(2,0) not null comment '明細番号'
+  , DetailString varchar(120) comment '明細内容'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint constructionbaseinfodetail_PKC primary key (ConstructionCode,DetailNo)
+) comment '工事基本情報明細' ;
 
--- 作業マスタ
-CREATE TABLE ConstructionSpecMaster
-(
-	ItemCode decimal(5,0) unsigned NOT NULL COMMENT '工種キー',
-	SpecCode decimal(5,0) unsigned NOT NULL COMMENT '作業キー',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	ItemName varchar(120) DEFAULT '' COMMENT '作業名称',
-	SpecName varchar(120) COMMENT '作業名称',
-	UnitName varchar(30) COMMENT '単位名称',
-	UnitPrice decimal(9,2) NOT NULL COMMENT '単価',
-	DeleteFlg decimal(1) NOT NULL COMMENT '削除フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ItemCode, SpecCode)
-) COMMENT = '作業マスタ';
+create index BaseInfoDetail_Idx1
+  on constructionbaseinfodetail(ConstructionCode);
 
+create index BaseInfoDetail_Idx2
+  on constructionbaseinfodetail(DetailNo);
 
--- 作業単価マスタ
-CREATE TABLE ConstructionSpecUnitPrice
-(
-	ComponentCode decimal(5,0) unsigned NOT NULL COMMENT '構成キー',
-	ItemCode decimal(5,0) unsigned NOT NULL COMMENT '工種キー',
-	SpecCode decimal(5,0) unsigned NOT NULL COMMENT '作業キー',
-	ConstructionTypeCode mediumint unsigned NOT NULL COMMENT '工事種別コード',
-	UnitPrice decimal(9,2) NOT NULL COMMENT '単価',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ComponentCode, ItemCode, SpecCode, ConstructionTypeCode)
-) COMMENT = '作業単価マスタ';
+-- 工事施工予算データ
+drop table if exists constructionbudget cascade;
 
+create table constructionbudget (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , CreatorCode decimal(8,0) not null comment '作成者コード'
+  , CreatorName varchar(60) comment '作成者名'
+  , CreatorCosts decimal(11,0) not null comment '作成者給与'
+  , AssistantCode decimal(8,0) not null comment '副担当者コード'
+  , AssistantName varchar(60) comment '副担当者名'
+  , AssistantCosts decimal(11,0) not null comment '副担当者給与'
+  , InstructorCode decimal(8,0) not null comment '工事指導員コード'
+  , InstructorName varchar(60) comment '工事指導員名'
+  , InstructorCosts decimal(11,0) not null comment '工事指導員給与'
+  , CreateDate date not null comment '作成日'
+  , ConstructionTimes decimal(5,2) not null comment '工期（単位・月）'
+  , ConstructionStart date not null comment '契約工期開始'
+  , ConstructionEnd date not null comment '契約工期完了'
+  , InstructorTimes decimal(5,2) not null comment '指導員稼働月数'
+  , SalaryFlg decimal(1,0) not null comment '給与振分区分'
+  , SalaryDays decimal(4,0) not null comment '振分日数'
+  , A_SalaryFlg decimal(1,0) not null comment '副担当者給与振分区分'
+  , A_SalaryDays decimal(4,0) not null comment '副担当者振分日数'
+  , I_SalaryFlg decimal(1,0) not null comment '指導員給与振分区分'
+  , I_SalaryDays decimal(4,0) not null comment '指導員振分日数'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint constructionbudget_PKC primary key (ConstructionCode)
+) comment '工事施工予算データ' ;
 
--- 工事種別マスタ
-CREATE TABLE ConstructionTypeMaster
-(
-	TypeCode decimal(5,0) unsigned NOT NULL COMMENT '工事種別コード',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	NameString varchar(100) DEFAULT '' NOT NULL COMMENT '名称',
-	PublicFlg decimal(1) NOT NULL COMMENT '工事種別フラグ',
-	SecRank decimal(1) NOT NULL COMMENT '保護区分ランク',
-	ExpensesLink decimal(1) NOT NULL COMMENT '経費使用区分',
-	DeleteFlg decimal(1) NOT NULL COMMENT '削除フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (TypeCode)
-) COMMENT = '工事種別マスタ';
+-- 工事施工予算データ明細
+drop table if exists constructionbudgetdetail cascade;
 
+create table constructionbudgetdetail (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , GroupCount decimal(2,0) unsigned not null comment 'グループ番号'
+  , LineCount decimal(3,0) unsigned not null comment '行番号'
+  , ComponentCode decimal(5,0) unsigned not null comment '構成キー'
+  , ItemCode decimal(5,0) unsigned not null comment '工種キー'
+  , FirstString varchar(120) comment '項目名称'
+  , SecondString varchar(120) comment '工事内容'
+  , CompanyType decimal(1,0) not null comment '協力会社コードタイプ'
+  , CompanyCode decimal(8,0) not null comment '協力会社コード'
+  , CompanyName varchar(120) comment '協力会社名称'
+  , EstimatePrice decimal(12,0) not null comment '積算時見積金額'
+  , NegotiationPrice decimal(12,0) not null comment '積算時交渉金額'
+  , OrderDesiredAmount decimal(12,0) not null comment '発注希望金額'
+  , ExecutionAmount decimal(12,0) not null comment '実行金額'
+  , AmountConfigRate decimal(5,2) not null comment '金額構成率'
+  , NegotiateFlg decimal(1,0) not null comment '協力業者交渉フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint constructionbudgetdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
+) comment '工事施工予算データ明細' ;
 
--- 担当者毎経費データ
-CREATE TABLE CostDataOfPerson
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '担当者コード',
-	ActionDate date NOT NULL COMMENT '対象日付',
-	DataType decimal(1) NOT NULL COMMENT 'データ区分',
-	DataAddCount decimal(5) unsigned NOT NULL COMMENT 'データ追加番号',
-	TargetMonth varchar(7) NOT NULL COMMENT '対象年月',
-	ConstructionCode decimal(10,0) unsigned COMMENT '工事コード',
-	SuppliersCode decimal(5) unsigned NOT NULL COMMENT '支払先コード',
-	SuppliersName varchar(120) COMMENT '支払先名称',
-	PaymentContent varchar(60) COMMENT '支払内容',
-	PaymentType decimal(1) NOT NULL COMMENT '支払方法フラグ',
-	EntryPrice decimal(12,0) NOT NULL COMMENT '金額（税抜）',
-	EntryPriceInTax decimal(12,0) NOT NULL COMMENT '金額（税込）',
-	SlipNumber varchar(12) COMMENT '伝票番号',
-	ComplateFlg decimal(1) NOT NULL COMMENT '引込済みフラグ',
-	ApprovalFlg decimal(1) NOT NULL COMMENT '承認フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, ActionDate, DataType, DataAddCount)
-) COMMENT = '担当者毎経費データ';
+-- 工種マスタ
+drop table if exists constructionitemmaster cascade;
 
+create table constructionitemmaster (
+  ItemCode decimal(5,0) unsigned not null comment '工種キー'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , ItemName varchar(120) not null comment '工種名称'
+  , SubItemsFlg decimal(1,0) comment '下位項目フラグ'
+  , MyExpensesFlg decimal(1,0) not null comment '自社経費フラグ'
+  , DeleteFlg decimal(1,0) not null comment '削除フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint constructionitemmaster_PKC primary key (ItemCode)
+) comment '工種マスタ' ;
 
--- 発注者登録申請データ
-CREATE TABLE CostomerRegist
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '申請者番号',
-	CreateDate date NOT NULL COMMENT '作成日',
-	SeqNo decimal(2) NOT NULL COMMENT 'キー連番',
-	DataMode decimal(1) NOT NULL COMMENT 'データ区分',
-	SourceCotegory decimal(5) unsigned NOT NULL COMMENT '発注者区分',
-	SourceCode decimal(5) unsigned NOT NULL COMMENT '発注者コード',
-	PetitionPeriod decimal(4) unsigned NOT NULL COMMENT '事業期',
-	OrderFlg decimal(1) NOT NULL COMMENT '法人団体・個人フラグ',
-	CorporateStatusName varchar(100) COMMENT '法人格名称',
-	CorporateStatusPoint decimal(1) COMMENT '法人格名称位置',
-	OrderersName1 varchar(60) DEFAULT '' NOT NULL COMMENT '発注者名1',
-	OrderersName2 varchar(60) COMMENT '発注者名２',
-	DepartmentName varchar(60) COMMENT '部署名',
-	ChargePersonName varchar(60) COMMENT '担当者名',
-	ZipCode varchar(8) COMMENT '郵便番号',
-	Address1 varchar(60) COMMENT '住所１',
-	Address2 varchar(60) DEFAULT '' COMMENT '住所2',
-	Address3 varchar(60) COMMENT '住所3',
-	PhoneNumber varchar(13) DEFAULT '' COMMENT '電話番号',
-	FaxNumber varchar(13) DEFAULT '' COMMENT 'FAX番号',
-	MailAddress varchar(257) COMMENT 'メールアドレス',
-	Note varchar(300) DEFAULT '' COMMENT '備考',
-	OrderCotegory decimal(5,0) unsigned NOT NULL COMMENT '発注者区分',
-	OrderDate date NOT NULL COMMENT '申請日',
-	OrderNo decimal(2) unsigned NOT NULL COMMENT '申請受付番号',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, CreateDate, SeqNo)
-) COMMENT = '発注者登録申請データ';
+-- 工事詳細台帳データ
+drop table if exists constructionledger cascade;
 
+create table constructionledger (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , ConstructionPeriod decimal(4,0) unsigned not null comment '事業期'
+  , CreatorCode decimal(8,0) comment '作成者コード'
+  , CreatorName varchar(60) comment '作成者名'
+  , CreateDate date not null comment '作成日'
+  , ConstructionTimes decimal(5,2) not null comment '工期（単位・月）'
+  , ConstructionStart date not null comment '契約工期開始'
+  , ConstructionEnd date not null comment '契約工期完了'
+  , OrdersDecisionPrice decimal(14,0) not null comment '税抜受注決定金額'
+  , CompanyExpenses decimal(10,0) not null comment '会社経費合計'
+  , DepartmentExpenses decimal(10,0) not null comment '部署経費合計'
+  , SalesExpenses decimal(10,0) not null comment '営業経費合計'
+  , TotalPayment decimal(10,0) not null comment '総支払額'
+  , GrossProfit decimal(10,0) not null comment '粗利'
+  , Allowance decimal(10,0) not null comment '給与'
+  , NetProfit decimal(10,0) not null comment '純利益'
+  , ComplateFlg decimal(1,0) not null comment '入力完了フラグ'
+  , IntegrationFlg decimal(1,0) not null comment '受注金額積算フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint constructionledger_PKC primary key (ConstructionCode)
+) comment '工事詳細台帳データ' ;
 
--- 日報データ
-CREATE TABLE DailyDataConstruction
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '担当者コード',
-	DailyDataDate date NOT NULL COMMENT '日報作成日',
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	Weather varchar(60) COMMENT '天気',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, DailyDataDate, ConstructionCode)
-) COMMENT = '日報データ';
+-- 工事詳細台帳明細データ
+drop index LedgerDetail_Index01 on constructionledgerdetail;
+drop index LedgerDetail_Index02 on constructionledgerdetail;
+drop index LedgerDetail_Index03 on constructionledgerdetail;
 
+drop table if exists constructionledgerdetail cascade;
 
--- 日報データ (明細)
-CREATE TABLE DailyDataDetail
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '担当者コード',
-	DailyDataDate date NOT NULL COMMENT '日報作成日',
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	SeqNo decimal(3) unsigned NOT NULL COMMENT '明細行番号',
-	JobCategoryCode decimal(5,0) NOT NULL COMMENT '職種キー',
-	CompanyCode decimal(8,0) NOT NULL COMMENT '協力会社コード',
-	TodayHeadCount decimal(4,1) NOT NULL COMMENT '当日人員数',
-	TotalHeadCount decimal(5,1) NOT NULL COMMENT '累計人員数',
-	TodayWork varchar(100) COMMENT '当日作業内容',
-	NextdayWork varchar(100) COMMENT '翌日作業内容',
-	NextdayHeadCount decimal(4,1) NOT NULL COMMENT '翌日人員数',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, DailyDataDate, ConstructionCode, SeqNo)
-) COMMENT = '日報データ (明細)';
+create table constructionledgerdetail (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , GroupCount decimal(2,0) unsigned not null comment 'グループ番号'
+  , LineCount decimal(3,0) unsigned not null comment '行番号'
+  , ComponentCode decimal(5,0) unsigned not null comment '構成キー'
+  , ItemCode decimal(5,0) unsigned not null comment '工種キー'
+  , FirstString varchar(120) comment '項目名称'
+  , SecondString varchar(120) comment '工事内容'
+  , CompanyType decimal(1,0) not null comment '協力会社コードタイプ'
+  , CompanyCode decimal(8,0) not null comment '協力会社コード'
+  , CompanyName varchar(120) comment '協力会社名称'
+  , EstimatePrice decimal(12,0) not null comment '予算（見積）金額'
+  , ExecutionAmount decimal(12,0) not null comment '実行金額'
+  , AmountConfigRate decimal(5,2) not null comment '金額構成率'
+  , PaymentBurden decimal(12,0) not null comment '支払補填額'
+  , FixDataFlg decimal(1,0) not null comment '固定データフラグ'
+  , IndependentFlg decimal(1,0) not null comment '独立データフラグ'
+  , FluctuationFlg decimal(1,0) not null comment '増減データフラグ'
+  , SalaryFlg decimal(1,0) not null comment '給与振分区分'
+  , SalaryDays decimal(4,0) not null comment '給与振分日数'
+  , OperatingFlg decimal(1,0) not null comment '担当中フラグ'
+  , SourceCode decimal(10,0) unsigned not null comment '元工事番号'
+  , JoinTitleFlg decimal(1,0) not null comment '工事名称タイトル'
+  , SalaryOnRegist decimal(12,0) not null comment '登録時月額給与'
+  , PurchaseOrderFlg decimal(2,0) not null comment '注文書発行フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint constructionledgerdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
+) comment '工事詳細台帳明細データ' ;
 
+create index LedgerDetail_Index01
+  on constructionledgerdetail(ConstructionCode);
 
--- 日報データ (現場巡回)
-CREATE TABLE DailyDataField
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '作成者コード',
-	DailyDataDate date NOT NULL COMMENT '日報作成日',
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	SeqNo decimal(3) unsigned NOT NULL COMMENT '明細行番号',
-	PatrolTime datetime NOT NULL COMMENT '巡回時間',
-	ContentsText varchar(200) COMMENT '内容',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, DailyDataDate, ConstructionCode, SeqNo)
-) COMMENT = '日報データ (現場巡回)';
+create index LedgerDetail_Index02
+  on constructionledgerdetail(GroupCount);
 
+create index LedgerDetail_Index03
+  on constructionledgerdetail(SourceCode);
 
--- 日報データ (資材)
-CREATE TABLE DailyDataMaterials
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '作成者コード',
-	DailyDataDate date NOT NULL COMMENT '日報作成日',
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	SeqNo decimal(3) unsigned NOT NULL COMMENT '明細行番号',
-	Materials varchar(100) COMMENT '資材名',
-	Quantity varchar(100) COMMENT '数量',
-	Production varchar(100) COMMENT '制作会社',
-	Delivery varchar(100) COMMENT '納入業者',
-	QualityControl varchar(100) COMMENT '品質管理事項',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, DailyDataDate, ConstructionCode, SeqNo)
-) COMMENT = '日報データ (資材)';
+-- 工事詳細台帳実行データ
+drop index LedgerExcute_Index1 on constructionledgerexcute;
 
+drop table if exists constructionledgerexcute cascade;
 
--- 日報データ (協力業者指示)
-CREATE TABLE DailyDataSubcontractors
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '作成者コード',
-	DailyDataDate date NOT NULL COMMENT '日報作成日',
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	SeqNo decimal(3) unsigned NOT NULL COMMENT '明細行番号',
-	Attendee varchar(100) COMMENT '出席者',
-	ContentsText varchar(200) COMMENT '内容',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, DailyDataDate, ConstructionCode, SeqNo)
-) COMMENT = '日報データ (協力業者指示)';
+create table constructionledgerexcute (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , GroupCount decimal(2,0) unsigned not null comment 'グループ番号'
+  , LineCount decimal(3,0) unsigned not null comment '行番号'
+  , ColumnCount decimal(3,0) not null comment '列番号'
+  , PaymentAmount decimal(12,0) not null comment '支払金額'
+  , TargetMonth date not null comment '対象年月'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint constructionledgerexcute_PKC primary key (ConstructionCode,GroupCount,LineCount,ColumnCount)
+) comment '工事詳細台帳実行データ' ;
 
+create index LedgerExcute_Index1
+  on constructionledgerexcute(ConstructionCode,TargetMonth,GroupCount,LineCount);
 
--- 日報データ (車両)
-CREATE TABLE DailyDataVehicles
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '作成者コード',
-	DailyDataDate date NOT NULL COMMENT '日報作成日',
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	SeqNo decimal(3) unsigned NOT NULL COMMENT '明細行番号',
-	Model varchar(100) COMMENT '機種',
-	Performance varchar(100) COMMENT '性能',
-	Owner varchar(100) COMMENT '所有会社',
-	Driver varchar(100) COMMENT '当日運転者',
-	StartWorkingTime datetime NOT NULL COMMENT '作業時間開始',
-	EndWorkingTime datetime NOT NULL COMMENT '作業時間終了',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, DailyDataDate, ConstructionCode, SeqNo)
-) COMMENT = '日報データ (車両)';
+-- 工事リンク情報
+drop index ConstructionLink_Index1 on constructionlink;
+drop index ConstructionLink_Index2 on constructionlink;
+drop index ConstructionLink_Index3 on constructionlink;
 
+drop table if exists constructionlink cascade;
 
--- 日マスタ
-CREATE TABLE DayMaster
-(
-	days smallint NOT NULL COMMENT '日'
-) COMMENT = '日マスタ';
+create table constructionlink (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , FluctuationCode decimal(10,0) not null comment '子工事番号'
+  , LinkType decimal(1,0) not null comment 'リンク種別'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint constructionlink_PKC primary key (ConstructionCode,FluctuationCode)
+) comment '工事リンク情報' ;
 
+create index ConstructionLink_Index1
+  on constructionlink(ConstructionCode);
 
--- 部署経費率マスタ
-CREATE TABLE DepartmentExpensesMaster
-(
-	DepartmentCode decimal(5,0) unsigned NOT NULL COMMENT '部署コード',
-	ExpensesPeriod smallint NOT NULL COMMENT '事業期',
-	NameCode decimal(5,0) unsigned NOT NULL COMMENT '経費名称コード',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	ExpensesRaito decimal(4,2) NOT NULL COMMENT '経費率',
-	DeleteFlg decimal(1) NOT NULL COMMENT '削除フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (DepartmentCode, ExpensesPeriod, NameCode)
-) COMMENT = '部署経費率マスタ';
+create index ConstructionLink_Index2
+  on constructionlink(FluctuationCode);
 
+create index ConstructionLink_Index3
+  on constructionlink(LinkType);
 
--- 部署マスタ
-CREATE TABLE DepartmentMaster
-(
-	DepartmentCode decimal(5,0) unsigned NOT NULL COMMENT '部署コード',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	DepartmentString varchar(100) DEFAULT '' NOT NULL COMMENT '部署名',
-	ActionScheduleFlg decimal(1) NOT NULL COMMENT '行動予定表示フラグ',
-	StaffAssignFlg decimal(1) NOT NULL COMMENT '人員配置表示フラグ',
-	DeleteFlg decimal(1) NOT NULL COMMENT '削除フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (DepartmentCode)
-) COMMENT = '部署マスタ';
+-- 工事資材情報
+drop table if exists constructionmaterialinfo cascade;
 
+create table constructionmaterialinfo (
+  CONSTRUCTIONCODE int(10) unsigned default 0 not null comment '工事番号'
+  , MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '資材品目コード'
+  , RENTCOUNT smallint(5) unsigned comment '貸出数'
+  , REPAYCOUNT smallint(5) unsigned comment '返却数'
+  , COMPLETEFLG tinyint(3) unsigned comment '完了フラグ'
+  , ENTRYDATE datetime comment '登録日付'
+  , UPDATEDATE datetime comment '更新日付'
+  , constraint constructionmaterialinfo_PKC primary key (CONSTRUCTIONCODE,MATERIALITEMCODE)
+) comment '工事資材情報' ;
 
--- 区分マスタ
-CREATE TABLE DivisionMaster
-(
-	DivisionCode decimal(5,0) unsigned NOT NULL COMMENT '区分コード',
-	NameCode decimal(5,0) unsigned NOT NULL COMMENT '名称コード',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	NameString varchar(100) DEFAULT '' NOT NULL COMMENT '名称',
-	DeleteFlg decimal(1) NOT NULL COMMENT '削除フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (DivisionCode, NameCode)
-) COMMENT = '区分マスタ';
+-- 案件進捗日付データ
+drop table if exists constructionprogressdate cascade;
 
+create table constructionprogressdate (
+  ConstructionCode decimal(10,0) not null comment '工事番号'
+  , ConstructionStatusFlg decimal(2,0) not null comment '設定工事状態'
+  , PreviousStatusFlg decimal(2,0) comment '変更前状態'
+  , ChangeDate datetime not null comment '設定日付'
+  , ChangePersonCode decimal(8,0) not null comment '設定担当者'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint constructionprogressdate_PKC primary key (ConstructionCode,ConstructionStatusFlg)
+) comment '案件進捗日付データ' ;
 
--- 積算予算書データ
-CREATE TABLE EstimateBudget
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	ConstructionTime decimal(5,2) unsigned NOT NULL COMMENT '工期',
-	IntegratedCode decimal(8) NOT NULL COMMENT '積算者',
-	DataCreateDate datetime NOT NULL COMMENT 'データ引込日',
-	RetValue1 decimal(12,0) NOT NULL COMMENT '予定価格',
-	RetValue2 decimal(12,0) NOT NULL COMMENT '直接工事費',
-	RetValue3 decimal(12,0) NOT NULL COMMENT '積み上げ共通仮設費',
-	RetValue4 decimal(12,0) NOT NULL COMMENT '積み上げ現場管理費',
-	RetPercent decimal(5,2) NOT NULL COMMENT '一般管理費率',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode)
-) COMMENT = '積算予算書データ';
+-- 作業マスタ
+drop index ConstructionSpecMaster_Index1 on constructionspecmaster;
 
+drop table if exists constructionspecmaster cascade;
 
--- 積算予算内訳データ明細
-CREATE TABLE EstimateBudgetDetail
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	GroupCount decimal(2,0) unsigned NOT NULL COMMENT 'グループ番号',
-	LineCount decimal(3) unsigned NOT NULL COMMENT '行番号',
-	ComponentCode decimal(5,0) unsigned NOT NULL COMMENT '構成キー',
-	ItemCode decimal(5,0) unsigned COMMENT '工種キー',
-	CompanyCode decimal(8,0) NOT NULL COMMENT '協力会社コード',
-	FirstString varchar(120) COMMENT '大項目名称',
-	SecondString varchar(120) COMMENT '工種名称・協力会社名',
-	Content varchar(120) COMMENT '内容',
-	EstimatePrice decimal(12,0) NOT NULL COMMENT '見積時金額',
-	NegotiationPrice decimal(12,0) NOT NULL COMMENT '交渉時金額',
-	Notes varchar(120) COMMENT '注意事項',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, GroupCount, LineCount)
-) COMMENT = '積算予算内訳データ明細';
+create table constructionspecmaster (
+  ItemCode decimal(5,0) unsigned not null comment '工種キー'
+  , SpecCode decimal(5,0) unsigned not null comment '作業キー'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , ItemName varchar(120) comment '作業名称'
+  , SpecName varchar(120) comment '作業名称'
+  , UnitName varchar(30) comment '単位名称'
+  , UnitPrice decimal(9,2) not null comment '単価'
+  , DeleteFlg decimal(1,0) not null comment '削除フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint constructionspecmaster_PKC primary key (ItemCode,SpecCode)
+) comment '作業マスタ' ;
 
+create index ConstructionSpecMaster_Index1
+  on constructionspecmaster(DisplayOrder);
 
--- 積算見積データ
-CREATE TABLE EstimateData
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	LineCount decimal(3) unsigned NOT NULL COMMENT '行番号',
-	ComponentCode decimal(5,0) unsigned NOT NULL COMMENT '構成キー',
-	FixedItemCode varchar(1) COMMENT '固定項目キー',
-	ItemName varchar(120) COMMENT '作業名称',
-	SpecName varchar(120) COMMENT '作業／品質・形状・寸法',
-	PriceValue decimal(14,0) NOT NULL COMMENT '金額',
-	note varchar(60) COMMENT '備考',
-	MyExpensesFlg decimal(1) NOT NULL COMMENT '自社経費フラグ',
-	InputFlg decimal(1) NOT NULL COMMENT '入力フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, LineCount)
-) COMMENT = '積算見積データ';
+-- 作業単価マスタ
+drop table if exists constructionspecunitprice cascade;
 
+create table constructionspecunitprice (
+  ComponentCode decimal(5,0) unsigned not null comment '構成キー'
+  , ItemCode decimal(5,0) unsigned not null comment '工種キー'
+  , SpecCode decimal(5,0) unsigned not null comment '作業キー'
+  , ConstructionTypeCode mediumint(8) unsigned not null comment '工事種別コード'
+  , UnitPrice decimal(9,2) not null comment '単価'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint constructionspecunitprice_PKC primary key (ComponentCode,ItemCode,SpecCode,ConstructionTypeCode)
+) comment '作業単価マスタ' ;
 
--- 積算見積ページデータ
-CREATE TABLE EstimateDataBody
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	PageCount decimal(4) unsigned NOT NULL COMMENT 'ページ番号',
-	Category decimal(1) NOT NULL COMMENT 'ページ区分',
-	UnionComponentCode decimal(5) unsigned NOT NULL COMMENT '所属構成キー',
-	ComponentCode decimal(5,0) unsigned NOT NULL COMMENT '構成キー',
-	ItemCode decimal(5,0) unsigned NOT NULL COMMENT '工種キー',
-	SelectComponent decimal(5) unsigned NOT NULL COMMENT '選択構成キー',
-	PageTitle varchar(120) NOT NULL COMMENT 'ページ表示名',
-	DetailLineCount decimal(3) unsigned NOT NULL COMMENT '明細行番号',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, PageCount)
-) COMMENT = '積算見積ページデータ';
+-- 工事種別マスタ
+drop table if exists constructiontypemaster cascade;
 
+create table constructiontypemaster (
+  TypeCode decimal(5,0) unsigned not null comment '工事種別コード'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , NameString varchar(100) not null comment '名称'
+  , PublicFlg decimal(1,0) not null comment '工事種別フラグ'
+  , SecRank decimal(1,0) not null comment '保護区分ランク'
+  , ExpensesLink decimal(1,0) not null comment '経費使用区分'
+  , DeleteFlg decimal(1,0) not null comment '削除フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint constructiontypemaster_PKC primary key (TypeCode)
+) comment '工事種別マスタ' ;
 
--- 積算見積データ明細
-CREATE TABLE EstimateDataDetail
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	PageCount decimal(4) unsigned NOT NULL COMMENT 'ページ番号',
-	LineCount decimal(3) unsigned NOT NULL COMMENT '行番号',
-	DataType decimal(1) NOT NULL COMMENT 'データ種別',
-	ComponentCode decimal(5,0) unsigned NOT NULL COMMENT '構成キー',
-	ItemCode decimal(5,0) unsigned NOT NULL COMMENT '工種キー',
-	SpecCode decimal(5,0) unsigned NOT NULL COMMENT '作業キー',
-	ItemName varchar(120) COMMENT '作業名称',
-	SpecName varchar(120) COMMENT '作業／品質・形状・寸法',
-	Unitcount decimal(8,2) NOT NULL COMMENT '数量',
-	UnitName varchar(30) COMMENT '単位名称',
-	UnitPrice decimal(9,2) NOT NULL COMMENT '単価',
-	LineTotal decimal(12,0) NOT NULL COMMENT '金額',
-	note varchar(60) COMMENT '備考',
-	CompanyCode decimal(8,0) NOT NULL COMMENT '協力会社コード',
-	MyExpensesFlg decimal(1) NOT NULL COMMENT '自社経費フラグ',
-	InputFlg decimal(1) COMMENT '入力フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, PageCount, LineCount)
-) COMMENT = '積算見積データ明細';
+-- 担当者毎経費データ
+drop index CostDataOfPerson_Index1 on costdataofperson;
+drop index CostDataOfPerson_Index2 on costdataofperson;
 
+drop table if exists costdataofperson cascade;
 
--- 会社休日マスタ
-CREATE TABLE HolidayCalenderMaster
-(
-	Holiday date NOT NULL COMMENT '休日',
-	BusinessYear smallint unsigned NOT NULL COMMENT '営業年度',
-	TargetMonth tinyint unsigned NOT NULL COMMENT '該当月',
-	TargetDay tinyint unsigned NOT NULL COMMENT '該当日',
-	PRIMARY KEY (Holiday)
-) COMMENT = '会社休日マスタ';
+create table costdataofperson (
+  PersonCode decimal(8,0) unsigned not null comment '担当者コード'
+  , ActionDate date not null comment '対象日付'
+  , DataType decimal(1,0) not null comment 'データ区分'
+  , DataAddCount decimal(5,0) unsigned not null comment 'データ追加番号'
+  , TargetMonth varchar(7) not null comment '対象年月'
+  , ConstructionCode decimal(10,0) unsigned comment '工事コード'
+  , SuppliersCode decimal(5,0) unsigned not null comment '支払先コード'
+  , SuppliersName varchar(120) comment '支払先名称'
+  , PaymentContent varchar(60) comment '支払内容'
+  , PaymentType decimal(1,0) not null comment '支払方法フラグ'
+  , EntryPrice decimal(12,0) not null comment '金額（税抜）'
+  , EntryPriceInTax decimal(12,0) not null comment '金額（税込）'
+  , SlipNumber varchar(12) comment '伝票番号'
+  , ComplateFlg decimal(1,0) not null comment '引込済みフラグ'
+  , ApprovalFlg decimal(1,0) not null comment '承認フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint costdataofperson_PKC primary key (PersonCode,ActionDate,DataType,DataAddCount)
+) comment '担当者毎経費データ' ;
 
+create index CostDataOfPerson_Index1
+  on costdataofperson(TargetMonth);
 
--- 入力時検索履歴
-CREATE TABLE InputSearchLogData
-(
-	ConstructionCode decimal(10,0) NOT NULL COMMENT '工事コード',
-	UsedProcessNo decimal(4,0) NOT NULL COMMENT '使用機能番号',
-	DisplayOrder decimal(4) unsigned NOT NULL COMMENT '表示順',
-	DataType decimal(1) NOT NULL COMMENT 'データ種別',
-	InputCode decimal(10) COMMENT '入力コード',
-	PRIMARY KEY (ConstructionCode, UsedProcessNo, DisplayOrder)
-) COMMENT = '入力時検索履歴';
+create index CostDataOfPerson_Index2
+  on costdataofperson(ConstructionCode);
 
+-- 発注者登録申請データ
+drop index CostomerRegist_Index1 on costomerregist;
 
--- 掲示板メッセージ
-CREATE TABLE MessageBoardData
-(
-	RecordNumber decimal(6) unsigned NOT NULL COMMENT 'レコード番号',
-	BranchNumber decimal(3) unsigned NOT NULL COMMENT 'レコード枝番',
-	FromCode decimal(8) unsigned NOT NULL COMMENT '書込み者コード',
-	FromName varchar(60) NOT NULL COMMENT '書込み者',
-	MessageTitile varchar(100) COMMENT '伝言タイトル',
-	MessageContent varchar(1333) NOT NULL COMMENT '伝言内容',
-	LinkType decimal(2) NOT NULL COMMENT 'リンク動作タイプ',
-	LinkMessage varchar(200) COMMENT 'リンク文字列',
-	LinkCode varchar(30) COMMENT 'リンクキー',
-	WritingDate datetime NOT NULL COMMENT '書込み日時',
-	PersonCode decimal(8,0) NOT NULL COMMENT '書込み担当者コード',
-	ShareFlag decimal(2) NOT NULL COMMENT '管理者対象フラグ',
-	MessageColor varchar(8) COMMENT '文字色',
-	BackColor varchar(8) COMMENT 'バックカラー',
-	MessageFlag decimal(1) NOT NULL COMMENT 'メッセージフラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (RecordNumber, BranchNumber)
-) COMMENT = '掲示板メッセージ';
+drop table if exists costomerregist cascade;
 
+create table costomerregist (
+  PersonCode decimal(8,0) unsigned not null comment '申請者番号'
+  , CreateDate date not null comment '作成日'
+  , SeqNo decimal(2,0) not null comment 'キー連番'
+  , DataMode decimal(1,0) not null comment 'データ区分'
+  , SourceCotegory decimal(5,0) unsigned not null comment '発注者区分'
+  , SourceCode decimal(5,0) unsigned not null comment '発注者コード'
+  , PetitionPeriod decimal(4,0) unsigned not null comment '事業期'
+  , OrderFlg decimal(1,0) not null comment '法人団体・個人フラグ'
+  , CorporateStatusName varchar(100) comment '法人格名称'
+  , CorporateStatusPoint decimal(1,0) comment '法人格名称位置'
+  , OrderersName1 varchar(60) not null comment '発注者名1'
+  , OrderersName2 varchar(60) comment '発注者名２'
+  , DepartmentName varchar(60) comment '部署名'
+  , ChargePersonName varchar(60) comment '担当者名'
+  , ZipCode varchar(8) comment '郵便番号'
+  , Address1 varchar(60) comment '住所１'
+  , Address2 varchar(60) comment '住所2'
+  , Address3 varchar(60) comment '住所3'
+  , PhoneNumber varchar(13) comment '電話番号'
+  , FaxNumber varchar(13) comment 'FAX番号'
+  , MailAddress varchar(257) comment 'メールアドレス'
+  , Note varchar(300) comment '備考'
+  , OrderCotegory decimal(5,0) unsigned not null comment '発注者区分'
+  , OrderDate date not null comment '申請日'
+  , OrderNo decimal(2,0) unsigned not null comment '申請受付番号'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint costomerregist_PKC primary key (PersonCode,CreateDate,SeqNo)
+) comment '発注者登録申請データ' ;
 
--- 掲示板対象者テーブル
-CREATE TABLE MessageBoardTerget
-(
-	RecordNumber decimal(6) unsigned NOT NULL COMMENT 'レコード番号',
-	BranchNumber decimal(3) unsigned NOT NULL COMMENT 'レコード枝番',
-	SeqNum decimal(3) unsigned NOT NULL COMMENT '順番',
-	ToCode decimal(8) NOT NULL COMMENT '対象者コード',
-	ToName varchar(60) NOT NULL COMMENT '対象者',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (RecordNumber, BranchNumber, SeqNum)
-) COMMENT = '掲示板対象者テーブル';
+create index CostomerRegist_Index1
+  on costomerregist(PetitionPeriod);
 
+-- 日報データ
+drop index DailyDataConstruction_Index1 on dailydataconstruction;
+drop index DailyDataConstruction_Index2 on dailydataconstruction;
+drop index DailyDataConstruction_Index3 on dailydataconstruction;
 
--- 掲示板メッセージ閲覧履歴
-CREATE TABLE MessageBrowsingHistory
-(
-	RecordNumber decimal(6) unsigned NOT NULL COMMENT 'レコード番号',
-	BranchNumber decimal(3) unsigned NOT NULL COMMENT 'レコード枝番',
-	SeqNum decimal(3) unsigned NOT NULL COMMENT '順番',
-	BrowsingCode decimal(8) NOT NULL COMMENT '閲覧者コード',
-	BrowsingDate datetime NOT NULL COMMENT '閲覧日付',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (RecordNumber, BranchNumber, SeqNum)
-) COMMENT = '掲示板メッセージ閲覧履歴';
+drop table if exists dailydataconstruction cascade;
 
+create table dailydataconstruction (
+  PersonCode decimal(8,0) unsigned not null comment '担当者コード'
+  , DailyDataDate date not null comment '日報作成日'
+  , ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , Weather varchar(60) comment '天気'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint dailydataconstruction_PKC primary key (PersonCode,DailyDataDate,ConstructionCode)
+) comment '日報データ' ;
 
--- 月マスタ
-CREATE TABLE MonthMaster
-(
-	month smallint NOT NULL COMMENT '月'
-) COMMENT = '月マスタ';
+create index DailyDataConstruction_Index1
+  on dailydataconstruction(PersonCode);
 
+create index DailyDataConstruction_Index2
+  on dailydataconstruction(DailyDataDate);
 
--- 発注者マスタ
-CREATE TABLE OrderersMaster
-(
-	OrderCotegory decimal(5,0) unsigned NOT NULL COMMENT '発注者区分',
-	OrderersCode decimal(5,0) unsigned NOT NULL COMMENT '発注者コード',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	OrderFlg decimal(1) NOT NULL COMMENT '法人団体・個人フラグ',
-	CorporateStatusName varchar(100) COMMENT '法人格名称',
-	CorporateStatusPoint decimal(1) COMMENT '法人格名称位置',
-	OrderersName1 varchar(60) DEFAULT '' NOT NULL COMMENT '発注者名1',
-	OrderersName2 varchar(60) COMMENT '発注者名２',
-	DepartmentName varchar(60) COMMENT '部署名',
-	ChargePersonName varchar(60) COMMENT '担当者名',
-	ZipCode varchar(8) COMMENT '郵便番号',
-	Address1 varchar(60) COMMENT '住所１',
-	Address2 varchar(60) DEFAULT '' COMMENT '住所2',
-	Address3 varchar(60) COMMENT '住所3',
-	PhoneNumber varchar(13) DEFAULT '' COMMENT '電話番号',
-	FaxNumber varchar(13) DEFAULT '' COMMENT 'FAX番号',
-	MailAddress varchar(257) COMMENT 'メールアドレス',
-	Note varchar(300) DEFAULT '' COMMENT '備考',
-	DeleteFlg decimal(1) NOT NULL COMMENT '削除フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (OrderCotegory, OrderersCode)
-) COMMENT = '発注者マスタ';
+create index DailyDataConstruction_Index3
+  on dailydataconstruction(ConstructionCode);
 
+-- 日報データ (明細)
+drop index DailyDataDetail_Index on dailydatadetail;
 
--- 受注金額データ
-CREATE TABLE OrdersPriceData
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	ChangeNo decimal(3) unsigned NOT NULL COMMENT '変更番号',
-	ChangeDate date NOT NULL COMMENT '変更日',
-	ChangePersonCode decimal(8) unsigned NOT NULL COMMENT '変更者コード',
-	ChangePersonName varchar(60) COMMENT '変更者名',
-	BeforeValue decimal(14,0) NOT NULL COMMENT '変更前税抜受注金額',
-	BeforeValueInTax decimal(14,0) NOT NULL COMMENT '変更前税込受注金額',
-	AfterValue decimal(14,0) NOT NULL COMMENT '変更後税抜受注金額',
-	AfterValueInTax decimal(14,0) NOT NULL COMMENT '変更後税込受注金額',
-	ChangeComment varchar(200) COMMENT '変更理由',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, ChangeNo)
-) COMMENT = '受注金額データ';
+drop table if exists dailydatadetail cascade;
 
+create table dailydatadetail (
+  PersonCode decimal(8,0) unsigned not null comment '担当者コード'
+  , DailyDataDate date not null comment '日報作成日'
+  , ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , SeqNo decimal(3,0) unsigned not null comment '明細行番号'
+  , JobCategoryCode decimal(5,0) not null comment '職種キー'
+  , CompanyCode decimal(8,0) not null comment '協力会社コード'
+  , TodayHeadCount decimal(4,1) not null comment '当日人員数'
+  , TotalHeadCount decimal(5,1) not null comment '累計人員数'
+  , TodayWork varchar(100) comment '当日作業内容'
+  , NextdayWork varchar(100) comment '翌日作業内容'
+  , NextdayHeadCount decimal(4,1) not null comment '翌日人員数'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint dailydatadetail_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
+) comment '日報データ (明細)' ;
 
--- 担当者承認データ
-CREATE TABLE PersonApproval
-(
-	PersonCode decimal(8) unsigned NOT NULL COMMENT '担当者コード',
-	ApprovalCode decimal(3,0) unsigned NOT NULL COMMENT '承認機能番号',
-	OrderDate date NOT NULL COMMENT '受付日',
-	OrderNo decimal(2,0) unsigned NOT NULL COMMENT '受付番号',
-	SeqNo decimal(2) NOT NULL COMMENT '枝番',
-	PersonCodeApproval decimal(8) unsigned NOT NULL COMMENT '申請・承認者コード',
-	PetitionApprovalDate datetime NOT NULL COMMENT '申請・承認日付',
-	ApprovalLimitDates datetime NOT NULL COMMENT '承認希望日',
-	ApprovalStatus decimal(1) NOT NULL COMMENT '承認状態',
-	InputComment varchar(300) COMMENT 'コメント',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, ApprovalCode, OrderDate, OrderNo, SeqNo)
-) COMMENT = '担当者承認データ';
+create index DailyDataDetail_Index
+  on dailydatadetail(PersonCode,DailyDataDate,ConstructionCode);
 
+-- 日報データ (現場巡回)
+drop index DailyDataField_Index on dailydatafield;
 
--- 担当者承認コメントデータ
-CREATE TABLE PersonApprovalComment
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '担当者コード',
-	ApprovalCode decimal(3,0) unsigned NOT NULL COMMENT '承認機能番号',
-	OrderDate date NOT NULL COMMENT '受付日',
-	OrderNo decimal(2,0) unsigned NOT NULL COMMENT '受付番号',
-	CommentNo decimal(2) NOT NULL COMMENT 'コメント番号',
-	ParentNo decimal(2) NOT NULL COMMENT '親コメント番号',
-	ApproValComment varchar(300) COMMENT '指示・連絡コメント',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, ApprovalCode, OrderDate, OrderNo, CommentNo)
-) COMMENT = '担当者承認コメントデータ';
+drop table if exists dailydatafield cascade;
 
+create table dailydatafield (
+  PersonCode decimal(8,0) unsigned not null comment '作成者コード'
+  , DailyDataDate date not null comment '日報作成日'
+  , ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , SeqNo decimal(3,0) unsigned not null comment '明細行番号'
+  , PatrolTime datetime not null comment '巡回時間'
+  , ContentsText varchar(200) comment '内容'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint dailydatafield_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
+) comment '日報データ (現場巡回)' ;
 
--- 担当者対象部署マスタ
-CREATE TABLE PersonDepartmentMaster
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '担当者コード',
-	DepartmentCode decimal(5,0) unsigned NOT NULL COMMENT '部署コード',
-	AffiliationFlg decimal(1) NOT NULL COMMENT '所属フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, DepartmentCode)
-) COMMENT = '担当者対象部署マスタ';
+create index DailyDataField_Index
+  on dailydatafield(PersonCode,DailyDataDate,ConstructionCode);
 
+-- 日報データ (資材)
+drop index DailyDataMaterials_Index on dailydatamaterials;
 
--- 担当者マスタ
-CREATE TABLE PersonInChargeMaster
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '担当者コード',
-	DisplayOrder decimal(8) unsigned NOT NULL COMMENT '表示順',
-	PersonName varchar(60) DEFAULT '' NOT NULL COMMENT '担当者名',
-	StartDate date NOT NULL COMMENT '使用開始年月日',
-	EndDate date COMMENT '使用終了年月日',
-	PassWord varchar(16) COMMENT 'パスワード',
-	SecurityManagement decimal(1) NOT NULL COMMENT '機密区分',
-	SecCode decimal(2,0) unsigned NOT NULL COMMENT '保護区分番号',
-	MsgBackColor varchar(8) COMMENT 'メッセージ背景色',
-	DisplayString varchar(20) COMMENT '表示・印刷名称',
-	DepartmentCode decimal(5,0) unsigned COMMENT '部署コード',
-	MonthlySalary decimal(11,0) NOT NULL COMMENT '月給金額',
-	YearSalary decimal(12,0) NOT NULL COMMENT '年俸金額',
-	Qualification varchar(120) COMMENT '資格入力欄',
-	SealPrintName varchar(5) COMMENT '印鑑表示名',
-	EmployeeClassFlg decimal(1) NOT NULL COMMENT '社員区分',
-	LedgerFlg decimal(1) NOT NULL COMMENT '台帳計算対象フラグ',
-	DeleteFlg decimal(1) NOT NULL COMMENT '削除フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode)
-) COMMENT = '担当者マスタ';
+drop table if exists dailydatamaterials cascade;
 
+create table dailydatamaterials (
+  PersonCode decimal(8,0) unsigned not null comment '作成者コード'
+  , DailyDataDate date not null comment '日報作成日'
+  , ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , SeqNo decimal(3,0) unsigned not null comment '明細行番号'
+  , Materials varchar(100) comment '資材名'
+  , Quantity varchar(100) comment '数量'
+  , Production varchar(100) comment '制作会社'
+  , Delivery varchar(100) comment '納入業者'
+  , QualityControl varchar(100) comment '品質管理事項'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint dailydatamaterials_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
+) comment '日報データ (資材)' ;
 
--- 担当者給与マスタ
-CREATE TABLE PersonSalaryMaster
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '担当者コード',
-	StartDate date NOT NULL COMMENT '使用開始年月日',
-	MonthlySalary decimal(11,0) NOT NULL COMMENT '月給金額',
-	YearSalary decimal(12,0) NOT NULL COMMENT '年俸金額',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, StartDate)
-) COMMENT = '担当者給与マスタ';
+create index DailyDataMaterials_Index
+  on dailydatamaterials(PersonCode,DailyDataDate,ConstructionCode);
 
+-- 日報データ (協力業者指示)
+drop index DailyDataSubcontractors_Index on dailydatasubcontractors;
 
--- 発注者打ち合わせ議事録データ
-CREATE TABLE ProceedingsData
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	ProceedingsDataDate date NOT NULL COMMENT '議事録作成日',
-	StartMeetingTime decimal(4) unsigned NOT NULL COMMENT '会議時間開始',
-	EndMeetingTime decimal(4) unsigned NOT NULL COMMENT '会議時間終了',
-	CreatorCode decimal(8,0) NOT NULL COMMENT '作成者コード',
-	PalceFlag decimal(1) NOT NULL COMMENT '現地フラグ',
-	MeetingPalce varchar(120) COMMENT '打合せ場所',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, ProceedingsDataDate, StartMeetingTime)
-) COMMENT = '発注者打ち合わせ議事録データ';
+drop table if exists dailydatasubcontractors cascade;
 
+create table dailydatasubcontractors (
+  PersonCode decimal(8,0) unsigned not null comment '作成者コード'
+  , DailyDataDate date not null comment '日報作成日'
+  , ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , SeqNo decimal(3,0) unsigned not null comment '明細行番号'
+  , Attendee varchar(100) comment '出席者'
+  , ContentsText varchar(200) comment '内容'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint dailydatasubcontractors_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
+) comment '日報データ (協力業者指示)' ;
 
--- 発注者打ち合わせ議事録データ（出席者）
-CREATE TABLE ProceedingsDataAttend
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	ProceedingsDataDate date NOT NULL COMMENT '議事録作成日',
-	StartMeetingTime decimal(4) unsigned NOT NULL COMMENT '会議時間開始',
-	SeqNo decimal(3) unsigned NOT NULL COMMENT '明細行番号',
-	Department varchar(20) COMMENT '出席者所属',
-	AttendName varchar(10) COMMENT '出席者氏名',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, ProceedingsDataDate, StartMeetingTime, SeqNo)
-) COMMENT = '発注者打ち合わせ議事録データ（出席者）';
+create index DailyDataSubcontractors_Index
+  on dailydatasubcontractors(PersonCode,DailyDataDate,ConstructionCode);
 
+-- 日報データ (車両)
+drop index DailyDataVehicles_Index on dailydatavehicles;
 
--- 発注者打ち合わせ議事録データ（明細）
-CREATE TABLE ProceedingsDataDetail
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	ProceedingsDataDate date NOT NULL COMMENT '議事録作成日',
-	StartMeetingTime decimal(4) unsigned NOT NULL COMMENT '会議時間開始',
-	SeqNo decimal(3) unsigned NOT NULL COMMENT '明細行番号',
-	TitleNo varchar(5) COMMENT '議題番号',
-	Title varchar(20) COMMENT '議題',
-	ContentsText varchar(50) COMMENT '内容',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, ProceedingsDataDate, StartMeetingTime, SeqNo)
-) COMMENT = '発注者打ち合わせ議事録データ（明細）';
+drop table if exists dailydatavehicles cascade;
 
+create table dailydatavehicles (
+  PersonCode decimal(8,0) unsigned not null comment '作成者コード'
+  , DailyDataDate date not null comment '日報作成日'
+  , ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , SeqNo decimal(3,0) unsigned not null comment '明細行番号'
+  , Model varchar(100) comment '機種'
+  , Performance varchar(100) comment '性能'
+  , Owner varchar(100) comment '所有会社'
+  , Driver varchar(100) comment '当日運転者'
+  , StartWorkingTime datetime not null comment '作業時間開始'
+  , EndWorkingTime datetime not null comment '作業時間終了'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint dailydatavehicles_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
+) comment '日報データ (車両)' ;
 
--- 承認データ
-CREATE TABLE ProcessApproval
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	ApprovalCode decimal(3,0) unsigned NOT NULL COMMENT '承認機能番号',
-	OrderNo decimal(2,0) unsigned NOT NULL COMMENT '受付番号',
-	SeqNo decimal(2) NOT NULL COMMENT '枝番',
-	PersonCode decimal(8) unsigned NOT NULL COMMENT '申請・承認者コード',
-	PetitionApprovalDate datetime NOT NULL COMMENT '申請・承認日付',
-	ApprovalLimitDates datetime NOT NULL COMMENT '承認希望日',
-	ApprovalStatus decimal(1) NOT NULL COMMENT '承認状態',
-	InputComment varchar(300) COMMENT 'コメント',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, ApprovalCode, OrderNo, SeqNo)
-) COMMENT = '承認データ';
+create index DailyDataVehicles_Index
+  on dailydatavehicles(PersonCode,DailyDataDate,ConstructionCode);
 
+-- 日マスタ
+drop index day_Index1 on daymaster;
 
--- 承認コメントデータ
-CREATE TABLE ProcessApprovalComment
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	ApprovalCode decimal(3,0) unsigned NOT NULL COMMENT '承認機能番号',
-	OrderNo decimal(2,0) unsigned NOT NULL COMMENT '受付番号',
-	CommentNo decimal(2) NOT NULL COMMENT 'コメント番号',
-	ParentNo decimal(2) NOT NULL COMMENT '親コメント番号',
-	ApproValComment varchar(300) COMMENT '指示・連絡コメント',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, ApprovalCode, OrderNo, CommentNo)
-) COMMENT = '承認コメントデータ';
+drop table if exists daymaster cascade;
 
+create table daymaster (
+  days smallint(6) not null comment '日'
+) comment '日マスタ' ;
 
--- 承認明細データ
-CREATE TABLE ProcessApprovalDetail
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	ApprovalCode decimal(3,0) unsigned NOT NULL COMMENT '承認機能番号',
-	OrderNo decimal(2,0) unsigned NOT NULL COMMENT '受付番号',
-	SerialNo decimal(2) unsigned NOT NULL COMMENT '枝番',
-	LinkCode decimal(10) NOT NULL COMMENT 'リンク情報',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, ApprovalCode, OrderNo, SerialNo)
-) COMMENT = '承認明細データ';
+create index day_Index1
+  on daymaster(days);
 
-
--- 起動対象マスタ
-CREATE TABLE ProcessExcuteMaster
-(
-	SecCode decimal(2,0) unsigned NOT NULL COMMENT '保護区分番号',
-	ExecCode decimal(4,0) unsigned NOT NULL COMMENT '起動処理番号',
-	EditFlg decimal(1) NOT NULL COMMENT '編集フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (SecCode, ExecCode)
-) COMMENT = '起動対象マスタ';
-
-
--- 注文書データ
-CREATE TABLE PurchaseOrder
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	SeqNo decimal(3) unsigned NOT NULL COMMENT '注文書枝番',
-	CompanyCode decimal(8,0) NOT NULL COMMENT '協力会社コード',
-	CreateDate date COMMENT '作成日付',
-	OrderPrice decimal(12,0) NOT NULL COMMENT '発注金額',
-	LastRowStringDate date NOT NULL COMMENT '最終行表示日付',
-	OrderSheetType decimal(1) NOT NULL COMMENT '簡易・本式フラグ',
-	PaymentTerms decimal(1) NOT NULL COMMENT '支払い条件',
-	CashRatio decimal(4,1) NOT NULL COMMENT '現金割合（％）',
-	BillPeriod decimal(4) NOT NULL COMMENT '手形期間',
-	PrePayments decimal(1) NOT NULL COMMENT '前金払',
-	PrePaymentsDays decimal(3,0) NOT NULL COMMENT '前金払日数',
-	PrePaymentsPrice decimal(12,0) NOT NULL COMMENT '前金払金額',
-	PartialPayment decimal(1) NOT NULL COMMENT '部分払',
-	PartialPaymentMounth decimal(2) unsigned NOT NULL COMMENT '部分払締切月',
-	PartialPaymentDay1 decimal(2) unsigned NOT NULL COMMENT '部分払締切日',
-	PartialPaymentDay2 decimal(2) unsigned NOT NULL COMMENT '部分払支払日',
-	PartialPaymentPrice decimal(12,0) NOT NULL COMMENT '部分払金額',
-	CompletionPayment decimal(1) NOT NULL COMMENT '引渡し時の支払',
-	CompletionPaymentDays decimal(3) unsigned NOT NULL COMMENT '引渡し時の支払日数',
-	CompletionPaymentPrice decimal(12,0) NOT NULL COMMENT '引渡し時の支払金額',
-	LeadEngineerCode decimal(8,0) COMMENT '主任技術者コード',
-	LeadEngineerName varchar(60) COMMENT 'LeadEngineerName',
-	SafetyOfficerCode decimal(8) COMMENT '安全管理者コード',
-	SafetyOfficerName varchar(60) COMMENT '安全管理者名',
-	WorkersCount decimal(3) unsigned COMMENT '作業員数',
-	PrintoutDate date NOT NULL COMMENT '印刷年月日',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, SeqNo)
-) COMMENT = '注文書データ';
-
-
--- 注文書明細データ
-CREATE TABLE PurchaseOrderDetail
-(
-	ConstructionCode decimal(10,0) unsigned NOT NULL COMMENT '工事コード',
-	SeqNo decimal(3) unsigned NOT NULL COMMENT '注文書枝番',
-	GroupCount decimal(1) NOT NULL COMMENT 'グループ番号',
-	LineCount decimal(3) unsigned NOT NULL COMMENT '行番号',
-	ComponentCode decimal(5,0) unsigned NOT NULL COMMENT '構成キー',
-	ItemCode decimal(5,0) unsigned NOT NULL COMMENT '工種キー',
-	FirstString varchar(120) COMMENT '工種・品名',
-	SecondString varchar(120) COMMENT '内容内訳',
-	UnitCount decimal(8,2) NOT NULL COMMENT '数量',
-	UnitName varchar(30) COMMENT '単位',
-	UnitPrice decimal(10,0) NOT NULL COMMENT '単価',
-	OrdersLinePrice decimal(12,0) COMMENT '金額',
-	SourceCode decimal(10) unsigned NOT NULL COMMENT '予算作成時工事番号',
-	SourceLineCnt decimal(3) unsigned NOT NULL COMMENT '注文書作成時台帳行番号',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionCode, SeqNo, GroupCount, LineCount)
-) COMMENT = '注文書明細データ';
-
-
--- 売上グラフデータ
-CREATE TABLE SalesGraphData
-(
-	GraphDataCode decimal(8) NOT NULL COMMENT 'グラフデータコード',
-	ConstructionPeriod decimal(4) unsigned NOT NULL COMMENT '事業期',
-	SalesDataDays date NOT NULL COMMENT '売上年月',
-	DisplayOrder decimal(8) unsigned NOT NULL COMMENT '表示順',
-	DataName varchar(100) NOT NULL COMMENT 'データ表示名称',
-	SalesAmount decimal(10,0) NOT NULL COMMENT '売上データ',
-	AdministrativeExpense decimal(10,0) NOT NULL COMMENT '販管・部署経費',
-	GrossProfit decimal(10,0) NOT NULL COMMENT '粗利益',
-	NetIncome decimal(10,0) NOT NULL COMMENT '純利益(損益)',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (GraphDataCode, ConstructionPeriod, SalesDataDays)
-) COMMENT = '売上グラフデータ';
-
-
--- 保護区分マスタ
-CREATE TABLE SecurityMaster
-(
-	SecCode decimal(2,0) unsigned NOT NULL COMMENT '保護区分番号',
-	DisplayOrder decimal(2) NOT NULL COMMENT '表示順',
-	SecName varchar(60) NOT NULL COMMENT '保護区分名称',
-	SecRank decimal(1) NOT NULL COMMENT '保護区分ランク',
-	SecRange decimal(1) NOT NULL COMMENT '保護区分範囲',
-	GeneralAffairs decimal(1) NOT NULL COMMENT '総務業務フラグ',
-	SelectBackColor varchar(8) NOT NULL COMMENT '選択背景色',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (SecCode)
-) COMMENT = '保護区分マスタ';
-
-
--- 協力業者施工工種登録申請データ
-CREATE TABLE SubConstrJobItemRegist
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '申請者番号',
-	CreateDate date NOT NULL COMMENT '作成日',
-	SeqNo decimal(2) unsigned NOT NULL COMMENT '申請連番',
-	DisplayOrder decimal(8) unsigned NOT NULL COMMENT '表示順',
-	ItemCode decimal(5,0) unsigned NOT NULL COMMENT '工種キー',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, CreateDate, SeqNo, DisplayOrder)
-) COMMENT = '協力業者施工工種登録申請データ';
-
-
--- 協力業者職種リンク登録申請データ
-CREATE TABLE SubConstrJobLinkRegist
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '申請者番号',
-	CreateDate date NOT NULL COMMENT '作成日',
-	SeqNo decimal(2) unsigned NOT NULL COMMENT '申請連番',
-	DisplayOrder decimal(8) unsigned NOT NULL COMMENT '表示順',
-	JobCategoryCode decimal(5,0) NOT NULL COMMENT '職種キー',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, CreateDate, SeqNo, DisplayOrder)
-) COMMENT = '協力業者職種リンク登録申請データ';
-
-
--- 協力業者登録申請データ
-CREATE TABLE SubConstrRegist
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '申請者番号',
-	CreateDate date NOT NULL COMMENT '作成日',
-	SeqNo decimal(2) unsigned NOT NULL COMMENT '申請連番',
-	DataMode decimal(1) COMMENT 'データ区分',
-	SourceCode decimal(8,0) NOT NULL COMMENT '協力会社コード',
-	PetitionPeriod decimal(4) unsigned NOT NULL COMMENT '申請年度',
-	CorporateStatusName varchar(40) DEFAULT '' COMMENT '法人格名称',
-	CorporateStatusPoint decimal(1) NOT NULL COMMENT '法人格名称位置',
-	CompanyName varchar(100) DEFAULT '' NOT NULL COMMENT '協力会社名',
-	CEOPositionName varchar(60) DEFAULT '' COMMENT '代表者役職名',
-	CEOName varchar(60) DEFAULT '' COMMENT '代表者氏名',
-	ContactPersonName varchar(60) COMMENT '担当者氏名',
-	ZipCode varchar(8) COMMENT '郵便番号',
-	Address1 varchar(60) COMMENT '住所１',
-	Address2 varchar(60) DEFAULT '' COMMENT '住所2',
-	Address3 varchar(60) COMMENT '住所3',
-	CellPhoneNumber varchar(13) COMMENT '携帯電話番号',
-	MailAddress varchar(257) COMMENT 'メールアドレス',
-	PhoneNumber varchar(13) DEFAULT '' COMMENT '電話番号',
-	FaxNumber varchar(13) DEFAULT '' COMMENT 'FAX番号',
-	JapaneseSyllabary varchar(2) COMMENT '50音読み',
-	StartDate date NOT NULL COMMENT '取引開始年月日',
-	Note varchar(300) DEFAULT '' COMMENT '備考',
-	labourKind decimal(1) NOT NULL COMMENT '支払い通常・手間区分',
-	OrderDate date COMMENT '申請日',
-	OrderNo decimal(2) unsigned NOT NULL COMMENT '申請受付番号',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, CreateDate, SeqNo)
-) COMMENT = '協力業者登録申請データ';
-
-
--- 協力会社工種マスタ
-CREATE TABLE SubContractorItemMaster
-(
-	ItemCode decimal(5,0) unsigned NOT NULL COMMENT '工種キー',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	ItemName varchar(120) DEFAULT '' NOT NULL COMMENT '工種名称',
-	DeleteFlg decimal(1) NOT NULL COMMENT '削除フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ItemCode)
-) COMMENT = '協力会社工種マスタ';
-
-
--- 協力会社職種マスタ
-CREATE TABLE SubContractorJobCategory
-(
-	JobCategoryCode decimal(5,0) NOT NULL COMMENT '職種キー',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	JobCategoryName varchar(120) DEFAULT '' NOT NULL COMMENT '職種名称',
-	DeleteFlg decimal(1) NOT NULL COMMENT '削除フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (JobCategoryCode)
-) COMMENT = '協力会社職種マスタ';
-
-
--- 協力会社施工工種データ
-CREATE TABLE SubContractorJobItem
-(
-	CompanyCode decimal(8,0) NOT NULL COMMENT '協力会社コード',
-	ItemCode decimal(5,0) unsigned NOT NULL COMMENT '工種キー',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (CompanyCode, ItemCode)
-) COMMENT = '協力会社施工工種データ';
-
-
--- 協力会社職種リンクマスタ
-CREATE TABLE SubContractorJobLink
-(
-	CompanyCode decimal(8,0) NOT NULL COMMENT '協力会社コード',
-	JobCategoryCode decimal(5,0) NOT NULL COMMENT '職種キー',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (CompanyCode, JobCategoryCode)
-) COMMENT = '協力会社職種リンクマスタ';
-
-
--- 協力会社マスタ
-CREATE TABLE SubContractorMaster
-(
-	CompanyCode decimal(8,0) NOT NULL COMMENT '協力会社コード',
-	DisplayOrder decimal(8) unsigned NOT NULL COMMENT '表示順',
-	CorporateStatusName varchar(40) DEFAULT '' COMMENT '法人格名称',
-	CorporateStatusPoint decimal(1) NOT NULL COMMENT '法人格名称位置',
-	CompanyName varchar(100) DEFAULT '' NOT NULL COMMENT '協力会社名',
-	CEOPositionName varchar(60) DEFAULT '' COMMENT '代表者役職名',
-	CEOName varchar(60) DEFAULT '' COMMENT '代表者氏名',
-	ContactPersonName varchar(60) COMMENT '担当者氏名',
-	ZipCode varchar(8) COMMENT '郵便番号',
-	Address1 varchar(60) COMMENT '住所１',
-	Address2 varchar(60) DEFAULT '' COMMENT '住所2',
-	Address3 varchar(60) COMMENT '住所3',
-	CellPhoneNumber varchar(13) COMMENT '携帯電話番号',
-	MailAddress varchar(257) COMMENT 'メールアドレス',
-	PhoneNumber varchar(13) DEFAULT '' COMMENT '電話番号',
-	FaxNumber varchar(13) DEFAULT '' COMMENT 'FAX番号',
-	JapaneseSyllabary varchar(2) COMMENT '50音読み',
-	StartDate date NOT NULL COMMENT '取引開始年月日',
-	Note varchar(300) DEFAULT '' COMMENT '備考',
-	labourKind decimal(1) NOT NULL COMMENT '支払い通常・手間区分',
-	DeleteFlg decimal(1) DEFAULT 0 NOT NULL COMMENT '削除フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (CompanyCode)
-) COMMENT = '協力会社マスタ';
-
-
--- 仕入先マスタ
-CREATE TABLE SuppliersMaster
-(
-	SuppliersCode decimal(5,0) unsigned NOT NULL COMMENT '仕入先コード',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	SuppliersName1 varchar(60) DEFAULT '' NOT NULL COMMENT '仕入先名1',
-	SuppliersName2 varchar(60) COMMENT '仕入先名２',
-	ZipCode varchar(8) COMMENT '郵便番号',
-	Address1 varchar(60) COMMENT '住所１',
-	Address2 varchar(60) DEFAULT '' COMMENT '住所2',
-	Address3 varchar(60) COMMENT '住所3',
-	PhoneNumber varchar(13) DEFAULT '' COMMENT '電話番号',
-	FaxNumber varchar(13) DEFAULT '' COMMENT 'FAX番号',
-	Note varchar(300) DEFAULT '' COMMENT '備考',
-	DeleteFlg decimal(1) NOT NULL COMMENT '削除フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (SuppliersCode)
-) COMMENT = '仕入先マスタ';
-
-
--- システム起動確認データ
-CREATE TABLE SystemExecute
-(
-	PrimaryCode tinyint NOT NULL COMMENT 'キー項目',
-	TargetDate date NOT NULL COMMENT '起動日付',
-	SystemVersion int NOT NULL COMMENT '本体・環境バージョン',
-	UpDateCopyVersion int NOT NULL COMMENT 'コピーバージョン',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PrimaryCode)
-) COMMENT = 'システム起動確認データ';
-
-
--- 管理マスタ
-CREATE TABLE SystemMaster
-(
-	SystemCode decimal(3,0) unsigned NOT NULL COMMENT '会社コード',
-	CompanyName1 varchar(60) DEFAULT '' NOT NULL COMMENT '会社名１',
-	CompanyName2 varchar(60) DEFAULT '' COMMENT '会社名２',
-	CEOName varchar(60) DEFAULT '' NOT NULL COMMENT '代表者氏名',
-	CEOPositionName varchar(60) DEFAULT '' COMMENT '代表者役職名',
-	ZipCode varchar(8) NOT NULL COMMENT '郵便番号',
-	Address1 varchar(60) NOT NULL COMMENT '住所１',
-	Address2 varchar(60) DEFAULT '' COMMENT '住所2',
-	Address3 varchar(60) COMMENT '住所3',
-	PhoneNumber varchar(13) DEFAULT '' NOT NULL COMMENT '電話番号',
-	FaxNumber varchar(13) DEFAULT '' COMMENT 'FAX番号',
-	ConstructionExpenses decimal(4,2) NOT NULL COMMENT '工事部経費',
-	OfficeExpenses decimal(4,2) NOT NULL COMMENT '事務所経費',
-	OperatingExpenses decimal(4,2) NOT NULL COMMENT '営業経費',
-	ConsumptionTax decimal(4,2) NOT NULL COMMENT '消費税',
-	CooperationRate decimal(4,2) NOT NULL COMMENT '協力金比率',
-	ExcelSavePath varchar(120) COMMENT 'Excel保存パス',
-	BusinessPeriod smallint NOT NULL COMMENT '現在営業期数',
-	ConstructionYear smallint NOT NULL COMMENT '現在工事年度',
-	BusinessBeginningDate varchar(5) NOT NULL COMMENT '営業期期首日',
-	ConstructionBeginningDate varchar(5) NOT NULL COMMENT '工事年度期首日',
-	ConstructionNoBase decimal(1) NOT NULL COMMENT '工事番号基準値',
-	SloganString1 varchar(100) COMMENT '標語1',
-	SloganString2 varchar(100) COMMENT '標語2',
-	SloganString3 varchar(100) COMMENT '標語3',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (SystemCode)
-) COMMENT = '管理マスタ';
-
-
--- 期限マスタ
-CREATE TABLE TermMaster
-(
-	ConstructionStatusFlg decimal(2,0) NOT NULL COMMENT '工事状態フラグ',
-	FieldNo decimal(2) NOT NULL COMMENT 'チェック対象フィールド番号',
-	SeqNo decimal(2) NOT NULL COMMENT '枝番',
-	DisplayOrder decimal(2) NOT NULL COMMENT '表示順',
-	CheckSchdule decimal(1) NOT NULL COMMENT 'チェックタイミング',
-	TermDays decimal(3) NOT NULL COMMENT '経過日',
-	SendTitile varchar(100) COMMENT 'タイトル',
-	SendMessage varchar(100) COMMENT 'メッセージ',
-	BackColor varchar(8) COMMENT '背景色',
-	ForeColor varchar(8) COMMENT '文字色',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (ConstructionStatusFlg, FieldNo, SeqNo)
-) COMMENT = '期限マスタ';
-
-
--- 出勤交通費データ
-CREATE TABLE TranceportDailyData
-(
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '作成者コード',
-	AttendanceDate date NOT NULL COMMENT '日報作成日',
-	StartDistance decimal(7,1) NOT NULL COMMENT '当日出発キロ数',
-	ComplateDistance decimal(7,1) NOT NULL COMMENT '当日終了キロ数',
-	TotalDistance decimal(6,1) NOT NULL COMMENT '当日合計キロ数',
-	OfficeGoFlg decimal(1) NOT NULL COMMENT '事務所出勤フラグ',
-	OfficeOutFlg decimal(1) NOT NULL COMMENT '事務所帰宅フラグ',
-	TrancePayGoFlg decimal(1) NOT NULL COMMENT '有料通勤出勤フラグ',
-	TrancePayOutFlg decimal(1) NOT NULL COMMENT '有料通勤帰宅フラグ',
-	WareHouseFlg decimal(1) NOT NULL COMMENT '資材置場フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (PersonCode, AttendanceDate)
-) COMMENT = '出勤交通費データ';
-
-
--- 工事種別経費率マスタ
-CREATE TABLE TypeExpensesMaster
-(
-	TypeCode decimal(5,0) unsigned NOT NULL COMMENT '工事種別コード',
-	ExpensesPeriod smallint NOT NULL COMMENT '事業期',
-	NameCode decimal(5,0) unsigned NOT NULL COMMENT '経費名称コード',
-	ExpensesRaito decimal(4,2) NOT NULL COMMENT '経費率',
-	DeleteFlg decimal(1) NOT NULL COMMENT '削除フラグ',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (TypeCode, ExpensesPeriod, NameCode)
-) COMMENT = '工事種別経費率マスタ';
-
-
--- 単位マスタ
-CREATE TABLE UnitMaster
-(
-	UnitKey decimal(5,0) unsigned NOT NULL COMMENT '単位キー',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	UnitName varchar(30) NOT NULL COMMENT '単位名称',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (UnitKey)
-) COMMENT = '単位マスタ';
-
-
--- 車両マスタ
-CREATE TABLE VehicleMaster
-(
-	VehicleCode decimal(5,0) unsigned NOT NULL COMMENT '車両コード',
-	DisplayOrder decimal(5) unsigned NOT NULL COMMENT '表示順',
-	VehicleName varchar(100) NOT NULL COMMENT '車両名称',
-	RegistrationNumber varchar(30) COMMENT '登録番号',
-	IdentificationNumber varchar(30) COMMENT '車体番号',
-	ModelCode varchar(30) COMMENT '型式',
-	DepartmentCode decimal(5) unsigned NOT NULL COMMENT '管理部署',
-	VehicleScheduleFlg decimal(1) NOT NULL COMMENT '車両予約表示フラグ',
-	PurchaseDate date COMMENT '購入日',
-	PurchaseName varchar(30) COMMENT '購入先',
-	PurchaseContactPersons varchar(30) COMMENT '購入先担当者',
-	PurchasePhone varchar(13) COMMENT '購入先電話番号',
-	LeaseDate date COMMENT 'リース開始日',
-	LeaseDestination varchar(30) COMMENT 'リース先',
-	LeaseContactPersons varchar(30) COMMENT 'リース先担当者',
-	LeasePhone varchar(13) COMMENT 'リース先電話番号',
-	InsuranceCompany varchar(30) COMMENT '任意保険会社',
-	InsuranceContactPersons varchar(30) COMMENT '任意保険会社担当者',
-	InsurancePhone varchar(13) COMMENT '任意保険会社電話番号',
-	Note varchar(300) COMMENT '備考',
-	EntryDate datetime COMMENT '登録日付',
-	UpdateDate datetime COMMENT '更新日付',
-	PRIMARY KEY (VehicleCode)
-) COMMENT = '車両マスタ';
-
-
--- 車両記録データ
-CREATE TABLE VehicleRecordData
-(
-	VehicleCode decimal(5,0) unsigned NOT NULL COMMENT '車両コード',
-	DivisionCode decimal(2,0) unsigned NOT NULL COMMENT 'データ区分',
-	SeqNo decimal(2) NOT NULL COMMENT '枝番',
-	RecordDate date COMMENT '実地日',
-	Mileage mediumint COMMENT '走行距離',
-	Content varchar(100) COMMENT '内容',
-	PaymentCost decimal(10,0) COMMENT '費用',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (VehicleCode, DivisionCode, SeqNo)
-) COMMENT = '車両記録データ';
-
-
--- 車両予約データ
-CREATE TABLE VehicleScheduleData
-(
-	TargetDate date NOT NULL COMMENT '対象日',
-	VehicleCode decimal(5,0) unsigned NOT NULL COMMENT '車両コード',
-	MorningAfternoon decimal(1) NOT NULL COMMENT '午前・午後',
-	PersonCode decimal(8,0) unsigned NOT NULL COMMENT '担当者コード',
-	TargetYear year(4) NOT NULL COMMENT '該当年',
-	TargetMonth tinyint unsigned NOT NULL COMMENT '該当月',
-	TargetDay year(2) NOT NULL COMMENT '該当日',
-	EntryDate datetime NOT NULL COMMENT '登録日付',
-	UpdateDate datetime NOT NULL COMMENT '更新日付',
-	PRIMARY KEY (TargetDate, VehicleCode, MorningAfternoon)
-) COMMENT = '車両予約データ';
-
-
--- 年マスタ
-CREATE TABLE YearMaster
-(
-	years smallint NOT NULL COMMENT '年'
-) COMMENT = '年マスタ';
-
-
-
-/* Create Indexes */
-
-CREATE INDEX ActionScheduleData_Index1 ON ActionScheduleData (TargetYear ASC);
-CREATE INDEX ActionScheduleData_Index2 ON ActionScheduleData (TargetMonth ASC);
-CREATE INDEX ActionScheduleData_Index3 ON ActionScheduleData (TargetDay ASC);
-CREATE INDEX AttendDaily_Index1 ON AttendanceDailyData (ActionResult ASC);
-CREATE INDEX AttendDaily_Index2 ON AttendanceDailyData (AttendanceDate ASC);
-CREATE INDEX BusinessTypeMaster_Index1 ON BusinessTypeMaster (DisplayOrder ASC);
-CREATE INDEX ComponentLinkMaster_Index1 ON ComponentLinkMaster (ComponentCode ASC);
-CREATE INDEX ComponentLinkMaster_Index2 ON ComponentLinkMaster (ItemCode ASC);
-CREATE INDEX ComponentMaster_Index1 ON ComponentMaster (DisplayOrder ASC);
-CREATE INDEX ComponentToTypeMaster_Index1 ON ComponentToTypeMaster (ComponentCode ASC);
-CREATE INDEX ComponentToTypeMaster_Index2 ON ComponentToTypeMaster (TypeCode ASC);
-CREATE INDEX BaseInfo_Index1 ON ConstructionBaseInfo (ConstructionStatusFlg ASC);
-CREATE INDEX BaseInfo_Index2 ON ConstructionBaseInfo (EstimateType ASC);
-CREATE INDEX BaseInfo_Index3 ON ConstructionBaseInfo (SalesPersonCode ASC);
-CREATE INDEX BaseInfo_Index4 ON ConstructionBaseInfo (ConstructionPersonCode ASC);
-CREATE INDEX BaseInfo_Index5 ON ConstructionBaseInfo (ConstructionInstructor ASC);
-CREATE INDEX BaseInfoDetail_Idx1 ON ConstructionBaseInfoDetail (ConstructionCode ASC);
-CREATE INDEX BaseInfoDetail_Idx2 ON ConstructionBaseInfoDetail (DetailNo ASC);
-CREATE INDEX LedgerDetail_Index01 ON ConstructionLedgerDetail (ConstructionCode ASC);
-CREATE INDEX LedgerDetail_Index02 ON ConstructionLedgerDetail (GroupCount ASC);
-CREATE INDEX LedgerDetail_Index03 ON ConstructionLedgerDetail (SourceCode ASC);
-CREATE INDEX LedgerExcute_Index1 ON ConstructionLedgerExcute (ConstructionCode ASC, TargetMonth ASC, GroupCount ASC, LineCount ASC);
-CREATE INDEX ConstructionLink_Index1 ON ConstructionLink (ConstructionCode ASC);
-CREATE INDEX ConstructionLink_Index2 ON ConstructionLink (FluctuationCode ASC);
-CREATE INDEX ConstructionLink_Index3 ON ConstructionLink (LinkType ASC);
-CREATE INDEX ConstructionSpecMaster_Index1 ON ConstructionSpecMaster (DisplayOrder ASC);
-CREATE INDEX CostDataOfPerson_Index1 ON CostDataOfPerson (TargetMonth ASC);
-CREATE INDEX CostDataOfPerson_Index2 ON CostDataOfPerson (ConstructionCode ASC);
-CREATE INDEX CostomerRegist_Index1 ON CostomerRegist (PetitionPeriod ASC);
-CREATE INDEX DailyDataConstruction_Index1 ON DailyDataConstruction (PersonCode ASC);
-CREATE INDEX DailyDataConstruction_Index2 ON DailyDataConstruction (DailyDataDate ASC);
-CREATE INDEX DailyDataConstruction_Index3 ON DailyDataConstruction (ConstructionCode ASC);
-CREATE INDEX DailyDataDetail_Index ON DailyDataDetail (PersonCode ASC, DailyDataDate ASC, ConstructionCode ASC);
-CREATE INDEX DailyDataField_Index ON DailyDataField (PersonCode ASC, DailyDataDate ASC, ConstructionCode ASC);
-CREATE INDEX DailyDataMaterials_Index ON DailyDataMaterials (PersonCode ASC, DailyDataDate ASC, ConstructionCode ASC);
-CREATE INDEX DailyDataSubcontractors_Index ON DailyDataSubcontractors (PersonCode ASC, DailyDataDate ASC, ConstructionCode ASC);
-CREATE INDEX DailyDataVehicles_Index ON DailyDataVehicles (PersonCode ASC, DailyDataDate ASC, ConstructionCode ASC);
-CREATE INDEX DepartmentMaster_index1 ON DepartmentMaster (DisplayOrder ASC);
-CREATE INDEX EstimateData_Index1 ON EstimateData (ConstructionCode ASC, FixedItemCode ASC);
-CREATE INDEX EstimateDataBody_Index1 ON EstimateDataBody (ConstructionCode ASC, ComponentCode ASC, ItemCode ASC);
-CREATE INDEX EstimateDataDetail_Index1 ON EstimateDataDetail (ConstructionCode ASC, PageCount ASC);
-CREATE INDEX HolidayCalender_Index1 ON HolidayCalenderMaster (BusinessYear ASC);
-CREATE INDEX HolidayCalenderMaster_Index2 ON HolidayCalenderMaster (TargetMonth ASC);
-CREATE INDEX HolidayCalenderMaster_Index3 ON HolidayCalenderMaster (TargetDay ASC);
-CREATE INDEX InputSearchLogData_Index1 ON InputSearchLogData (ConstructionCode ASC, UsedProcessNo ASC, InputCode ASC);
-CREATE INDEX MessageBoardData_Index1 ON MessageBoardData (WritingDate ASC);
-CREATE INDEX MessageBoardData_Index2 ON MessageBoardData (MessageFlag ASC);
-CREATE INDEX MessageBoardTerget_Index1 ON MessageBoardTerget (RecordNumber ASC, BranchNumber ASC);
-CREATE INDEX PersonDepartmentMaster_Index1 ON PersonDepartmentMaster (PersonCode ASC);
-CREATE INDEX PersonDepartmentMaster_Index2 ON PersonDepartmentMaster (DepartmentCode ASC);
-CREATE INDEX PersonInChargeMaster_Index1 ON PersonInChargeMaster (StartDate ASC);
-CREATE INDEX PersonInChargeMaster_Index2 ON PersonInChargeMaster (DepartmentCode ASC);
-CREATE INDEX PersonSalaryMaster_Index1 ON PersonSalaryMaster (PersonCode ASC);
-CREATE INDEX PersonSalaryMaster_Index2 ON PersonSalaryMaster (StartDate ASC);
-CREATE INDEX ProcessExcuteMaster_Index1 ON ProcessExcuteMaster (SecCode ASC);
-CREATE INDEX ProcessExcuteMaster_Index2 ON ProcessExcuteMaster (ExecCode ASC);
-CREATE INDEX POrderDetail_Index1 ON PurchaseOrderDetail (SourceCode ASC);
-CREATE INDEX SalesGraphData_Idx1 ON SalesGraphData (DisplayOrder ASC);
-CREATE INDEX SalesGraphData_idx2 ON SalesGraphData (ConstructionPeriod ASC);
-CREATE INDEX SecurityMaster_Index1 ON SecurityMaster (DisplayOrder ASC);
-CREATE INDEX SecurityMaster_Index2 ON SecurityMaster (SecRank ASC);
-CREATE INDEX SecurityMaster_Index3 ON SecurityMaster (SecRange ASC);
-CREATE INDEX SubContractorJobItem_Index1 ON SubContractorJobItem (CompanyCode ASC);
-CREATE INDEX SubContractorJobItem_Index2 ON SubContractorJobItem (ItemCode ASC);
-CREATE INDEX SubContractorJobLink_Index1 ON SubContractorJobLink (CompanyCode ASC);
-CREATE INDEX SubContractorJobLink_Index2 ON SubContractorJobLink (JobCategoryCode ASC);
-CREATE INDEX SubContractorMaster_Index1 ON SubContractorMaster (JapaneseSyllabary ASC);
-CREATE INDEX TermMaster_Index1 ON TermMaster (DisplayOrder ASC);
-CREATE INDEX TranceportDailyData_Index1 ON TranceportDailyData (AttendanceDate ASC);
-CREATE INDEX UnitMaster_Index1 ON UnitMaster (DisplayOrder ASC);
-CREATE INDEX VehicleScheduleData_Index1 ON VehicleScheduleData (TargetYear ASC);
-CREATE INDEX VehicleScheduleData_Index2 ON VehicleScheduleData (TargetMonth ASC);
-CREATE INDEX VehicleScheduleData_Index3 ON VehicleScheduleData (TargetDay ASC);
-
-
--- 資材管理、請求管理関係のテーブル作成
-
--- 銀行営業日マスタ
-drop table if exists bankbusinessdaymaster cascade;
-
-create table bankbusinessdaymaster (
-  YEARMONTH decimal(6,0) default '0' not null comment '年月'
-  , BANKBUSINESSDAY decimal(2,0) default '0' not null comment '銀行営業日'
-  , NOTE varchar(120) comment '備考'
-  , DELETEFLG decimal(1,0) comment '削除フラグ'
-  , ENTRYDATE datetime comment '登録年月日'
-  , UPDATEDATE datetime comment '更新年月日'
-  , constraint bankbusinessdaymaster_PKC primary key (YEARMONTH,BANKBUSINESSDAY)
-) comment '銀行営業日マスタ' ;
-
--- 業者請求データ
-drop table if exists billingdata cascade;
-
-create table billingdata (
-  COMPANYCODE decimal(8,0) default '0' not null comment '協力会社コード'
-  , TARGETDATE decimal(6,0) default '0' not null comment '対象年月'
-  , SEQNO decimal(3,0) default '0' not null comment '連番'
-  , BILLPRICE decimal(10,0) comment '請求金額'
-  , ENTRYDATE datetime comment '登録年月日'
-  , UPDATEDATE datetime comment '更新年月日'
-  , constraint billingdata_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO)
-) comment '業者請求データ' ;
-
--- 業者請求明細データ
-drop table if exists billingdatadetail cascade;
-
-create table billingdatadetail (
-  COMPANYCODE decimal(8,0) default '0' not null comment '協力会社コード'
-  , TARGETDATE decimal(6,0) default '0' not null comment '対象年月'
-  , SEQNO decimal(3,0) default '0' not null comment '連番'
-  , LINECOUNT decimal(3,0) default '0' not null comment '行番号'
-  , CONSTRUCTIONCODE decimal(10,0) comment '工事番号'
-  , FIELDNAME varchar(120) comment '現場名'
-  , BILLPRICE decimal(10,0) comment '請求金額'
-  , HIGHWPRICE decimal(10,0) comment '高速代'
-  , HARDWPRICE decimal(10,0) comment '金物代'
-  , INDSWASTETAX decimal(10,0) comment '産廃税'
-  , NOTE varchar(120) comment '備考'
-  , ENTRYDATE datetime comment '登録年月日'
-  , UPDATEDATE datetime comment '更新年月日'
-  , constraint billingdatadetail_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT)
-) comment '業者請求明細データ' ;
-
--- 業者請求支払サマリーデータ
-drop table if exists billingpaymentsummary cascade;
-
-create table billingpaymentsummary (
-  COMPANYCODE decimal(8,0) default '0' not null comment '協力会社コード'
-  , TARGETDATE decimal(6,0) default '0' not null comment '対象年月'
-  , CHARGEPAYMENTKIND decimal(1,0) default '0' not null comment '請求支払区分'
-  , PAYDAY date comment '支払日'
-  , BILLPRICESTOTAL decimal(10,0) comment '請求金額小計'
-  , CONSUMPTIONTAXRATE decimal(6,3) comment '消費税率'
-  , CONSUMPTIONTAXPRICE decimal(10,0) comment '消費税額'
-  , HIGHWPRICESTOTAL decimal(10,0) comment '高速代小計'
-  , HARDWPRICESTOTAL decimal(10,0) comment '金物代小計'
-  , INDSWASTETAXSTOTAL decimal(10,0) comment '産廃税小計'
-  , CNSTRPRICERATE decimal(6,3) comment '協力金比率'
-  , CNSTRPRICESTOTAL decimal(10,0) comment '協力金小計'
-  , BILLINGPRICETOTAL decimal(10,0) comment '請求金額合計'
-  , ENTRYDATE datetime comment '登録年月日'
-  , UPDATEDATE datetime comment '更新年月日'
-  , constraint billingpaymentsummary_PKC primary key (COMPANYCODE,TARGETDATE,CHARGEPAYMENTKIND)
-) comment '業者請求支払サマリーデータ' ;
-
--- 工事資材情報
-drop table if exists constructionmaterialinfo cascade;
-
-create table constructionmaterialinfo (
-  CONSTRUCTIONCODE int(10) unsigned default 0 not null comment '工事番号'
-  , MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '資材品目コード'
-  , RENTCOUNT smallint(5) unsigned comment '貸出数'
-  , REPAYCOUNT smallint(5) unsigned comment '返却数'
-  , COMPLETEFLG tinyint(3) unsigned comment '完了フラグ'
-  , ENTRYDATE datetime comment '登録日付'
-  , UPDATEDATE datetime comment '更新日付'
-  , constraint constructionmaterialinfo_PKC primary key (CONSTRUCTIONCODE,MATERIALITEMCODE)
-) comment '工事資材情報' ;
-
 -- 締日マスタ
 drop table if exists deadlinemaster cascade;
 
@@ -2016,9 +1036,44 @@
   , constraint deadlinemaster_PKC primary key (LABOURKIND)
 ) comment '締日マスタ' ;
 
+-- 部署経費率マスタ
+drop table if exists departmentexpensesmaster cascade;
+
+create table departmentexpensesmaster (
+  DepartmentCode decimal(5,0) unsigned not null comment '部署コード'
+  , ExpensesPeriod smallint(6) not null comment '事業期'
+  , NameCode decimal(5,0) unsigned not null comment '経費名称コード'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , ExpensesRaito decimal(4,2) not null comment '経費率'
+  , DeleteFlg decimal(1,0) not null comment '削除フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint departmentexpensesmaster_PKC primary key (DepartmentCode,ExpensesPeriod,NameCode)
+) comment '部署経費率マスタ' ;
+
+-- 部署マスタ
+drop index DepartmentMaster_index1 on departmentmaster;
+
+drop table if exists departmentmaster cascade;
+
+create table departmentmaster (
+  DepartmentCode decimal(5,0) unsigned not null comment '部署コード'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , DepartmentString varchar(100) not null comment '部署名'
+  , ActionScheduleFlg decimal(1,0) not null comment '行動予定表示フラグ'
+  , StaffAssignFlg decimal(1,0) not null comment '人員配置表示フラグ'
+  , DeleteFlg decimal(1,0) not null comment '削除フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint departmentmaster_PKC primary key (DepartmentCode)
+) comment '部署マスタ' ;
+
+create index DepartmentMaster_index1
+  on departmentmaster(DisplayOrder);
+
 -- 入金確認承認データ
 drop table if exists depositapprovalinfo cascade;
-/*
+
 create table depositapprovalinfo (
   ORDERERSDIVISION decimal(5,0) not null comment '発注者区分'
   , ORDERERSCODE decimal(5,0) not null comment '発注者コード'
@@ -2034,7 +1089,6 @@
   , UPDATEDATE datetime comment '更新日付'
   , constraint depositapprovalinfo_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,SEQNO,LINECOUNT,APPROVALNO)
 ) comment '入金確認承認データ' ;
-*/
 
 -- 入金データ
 drop table if exists depositdata cascade;
@@ -2044,9 +1098,9 @@
   , ORDERERSCODE decimal(5,0) not null comment '発注者コード'
   , TARGETDATE decimal(6,0) not null comment '対象年月'
   , SEQNO decimal(3,0) not null comment '連番'
-  , BUSINESSPERIOD decimal(4,0) comment '営業期'
+  , BusinessPeriod decimal(4,0) comment '営業期'
   , DEPOSITDATE date comment '入金日'
-  , DEPOSITAMOUNT decimal(12,0) comment '入金金額'
+  , DepositAmount decimal(12,0) comment '入金金額'
   , DEPOSITAMOUNTCASH decimal(10,0) comment '入金金額（現金）'
   , DEPOSITAMOUNTBILL decimal(10,0) comment '入金金額（手形）'
   , DEPOSITPERSONCODE decimal(8,0) NOT NULL COMMENT '入金担当者コード'
@@ -2080,6 +1134,192 @@
   , constraint depositdatadetail_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,REQUESTNO)
 ) comment '入金明細データ' ;
 
+-- 区分マスタ
+drop table if exists divisionmaster cascade;
+
+create table divisionmaster (
+  DivisionCode decimal(5,0) unsigned not null comment '区分コード'
+  , NameCode decimal(5,0) unsigned not null comment '名称コード'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , NameString varchar(100) not null comment '名称'
+  , DeleteFlg decimal(1,0) not null comment '削除フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint divisionmaster_PKC primary key (DivisionCode,NameCode)
+) comment '区分マスタ' ;
+
+-- 積算予算書データ
+drop table if exists estimatebudget cascade;
+
+create table estimatebudget (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , ConstructionTime decimal(5,2) unsigned not null comment '工期'
+  , IntegratedCode decimal(8,0) not null comment '積算者'
+  , DataCreateDate datetime not null comment 'データ引込日'
+  , RetValue1 decimal(12,0) not null comment '予定価格'
+  , RetValue2 decimal(12,0) not null comment '直接工事費'
+  , RetValue3 decimal(12,0) not null comment '積み上げ共通仮設費'
+  , RetValue4 decimal(12,0) not null comment '積み上げ現場管理費'
+  , RetPercent decimal(5,2) not null comment '一般管理費率'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint estimatebudget_PKC primary key (ConstructionCode)
+) comment '積算予算書データ' ;
+
+-- 積算予算内訳データ明細
+drop table if exists estimatebudgetdetail cascade;
+
+create table estimatebudgetdetail (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , GroupCount decimal(2,0) unsigned not null comment 'グループ番号'
+  , LineCount decimal(3,0) unsigned not null comment '行番号'
+  , ComponentCode decimal(5,0) unsigned not null comment '構成キー'
+  , ItemCode decimal(5,0) unsigned comment '工種キー'
+  , CompanyCode decimal(8,0) not null comment '協力会社コード'
+  , FirstString varchar(120) comment '大項目名称'
+  , SecondString varchar(120) comment '工種名称・協力会社名'
+  , Content varchar(120) comment '内容'
+  , EstimatePrice decimal(12,0) not null comment '見積時金額'
+  , NegotiationPrice decimal(12,0) not null comment '交渉時金額'
+  , Notes varchar(120) comment '注意事項'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint estimatebudgetdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
+) comment '積算予算内訳データ明細' ;
+
+-- 積算見積データ
+drop index EstimateData_Index1 on estimatedata;
+
+drop table if exists estimatedata cascade;
+
+create table estimatedata (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , LineCount decimal(3,0) unsigned not null comment '行番号'
+  , ComponentCode decimal(5,0) unsigned not null comment '構成キー'
+  , FixedItemCode varchar(1) comment '固定項目キー'
+  , ItemName varchar(120) comment '作業名称'
+  , SpecName varchar(120) comment '作業／品質・形状・寸法'
+  , PriceValue decimal(14,0) not null comment '金額'
+  , note varchar(60) comment '備考'
+  , MyExpensesFlg decimal(1,0) not null comment '自社経費フラグ'
+  , InputFlg decimal(1,0) not null comment '入力フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint estimatedata_PKC primary key (ConstructionCode,LineCount)
+) comment '積算見積データ' ;
+
+create index EstimateData_Index1
+  on estimatedata(ConstructionCode,FixedItemCode);
+
+-- 積算見積ページデータ
+drop index EstimateDataBody_Index1 on estimatedatabody;
+
+drop table if exists estimatedatabody cascade;
+
+create table estimatedatabody (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , PageCount decimal(4,0) unsigned not null comment 'ページ番号'
+  , Category decimal(1,0) not null comment 'ページ区分'
+  , UnionComponentCode decimal(5,0) unsigned not null comment '所属構成キー'
+  , ComponentCode decimal(5,0) unsigned not null comment '構成キー'
+  , ItemCode decimal(5,0) unsigned not null comment '工種キー'
+  , SelectComponent decimal(5,0) unsigned not null comment '選択構成キー'
+  , PageTitle varchar(120) not null comment 'ページ表示名'
+  , DetailLineCount decimal(3,0) unsigned not null comment '明細行番号'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint estimatedatabody_PKC primary key (ConstructionCode,PageCount)
+) comment '積算見積ページデータ' ;
+
+create index EstimateDataBody_Index1
+  on estimatedatabody(ConstructionCode,ComponentCode,ItemCode);
+
+-- 積算見積データ明細
+drop index EstimateDataDetail_Index1 on estimatedatadetail;
+
+drop table if exists estimatedatadetail cascade;
+
+create table estimatedatadetail (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , PageCount decimal(4,0) unsigned not null comment 'ページ番号'
+  , LineCount decimal(3,0) unsigned not null comment '行番号'
+  , DataType decimal(1,0) not null comment 'データ種別'
+  , ComponentCode decimal(5,0) unsigned not null comment '構成キー'
+  , ItemCode decimal(5,0) unsigned not null comment '工種キー'
+  , SpecCode decimal(5,0) unsigned not null comment '作業キー'
+  , ItemName varchar(120) comment '作業名称'
+  , SpecName varchar(120) comment '作業／品質・形状・寸法'
+  , Unitcount decimal(8,2) not null comment '数量'
+  , UnitName varchar(30) comment '単位名称'
+  , UnitPrice decimal(9,2) not null comment '単価'
+  , LineTotal decimal(12,0) not null comment '金額'
+  , note varchar(60) comment '備考'
+  , CompanyCode decimal(8,0) not null comment '協力会社コード'
+  , MyExpensesFlg decimal(1,0) not null comment '自社経費フラグ'
+  , InputFlg decimal(1,0) comment '入力フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint estimatedatadetail_PKC primary key (ConstructionCode,PageCount,LineCount)
+) comment '積算見積データ明細' ;
+
+create index EstimateDataDetail_Index1
+  on estimatedatadetail(ConstructionCode,PageCount);
+
+-- 経費率マスタ
+drop table if exists expensesmaster cascade;
+
+create table expensesmaster (
+  DivisionCode smallint(6) not null comment '工事種別コード'
+  , NameCode smallint(6) not null comment '経費名称コード'
+  , DisplayOrder smallint(6) not null comment '表示順'
+  , ExpensesRatio decimal(4,2) not null comment '経費率'
+  , DeleteFlg decimal(1,0) not null comment '削除フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint expensesmaster_PKC primary key (DivisionCode,NameCode)
+) comment '経費率マスタ' ;
+
+-- 会社休日マスタ
+drop index HolidayCalender_Index1 on holidaycalendermaster;
+drop index HolidayCalenderMaster_Index2 on holidaycalendermaster;
+drop index HolidayCalenderMaster_Index3 on holidaycalendermaster;
+
+drop table if exists holidaycalendermaster cascade;
+
+create table holidaycalendermaster (
+  Holiday date not null comment '休日'
+  , BusinessYear smallint(5) unsigned not null comment '営業年度'
+  , TargetMonth tinyint(3) unsigned not null comment '該当月'
+  , TargetDay tinyint(3) unsigned not null comment '該当日'
+  , constraint holidaycalendermaster_PKC primary key (Holiday)
+) comment '会社休日マスタ' ;
+
+create index HolidayCalender_Index1
+  on holidaycalendermaster(BusinessYear);
+
+create index HolidayCalenderMaster_Index2
+  on holidaycalendermaster(TargetMonth);
+
+create index HolidayCalenderMaster_Index3
+  on holidaycalendermaster(TargetDay);
+
+-- 入力時検索履歴
+drop index InputSearchLogData_Index1 on inputsearchlogdata;
+
+drop table if exists inputsearchlogdata cascade;
+
+create table inputsearchlogdata (
+  ConstructionCode decimal(10,0) not null comment '工事コード'
+  , UsedProcessNo decimal(4,0) not null comment '使用機能番号'
+  , DisplayOrder decimal(4,0) unsigned not null comment '表示順'
+  , DataType decimal(1,0) not null comment 'データ種別'
+  , InputCode decimal(10,0) comment '入力コード'
+  , constraint inputsearchlogdata_PKC primary key (ConstructionCode,UsedProcessNo,DisplayOrder)
+) comment '入力時検索履歴' ;
+
+create index InputSearchLogData_Index1
+  on inputsearchlogdata(ConstructionCode,UsedProcessNo,InputCode);
+
 -- 請求書データ
 drop table if exists invoicedata cascade;
 
@@ -2131,7 +1371,7 @@
   , DELETEFLG tinyint(3) unsigned comment '削除フラグ'
   , ENTRYDATE datetime comment '登録日付'
   , UPDATEDATE datetime comment '更新日付'
-  , VERSIONNO decimal(8,0) not null default 0 comment 'バージョン番号'
+  , VERSIONNO decimal(8,0) default '0' not null comment 'バージョン番号'
   , constraint materialitemmaster_PKC primary key (MATERIALITEMCODE)
 ) comment '資材品目マスタ' ;
 
@@ -2166,6 +1406,131 @@
   , constraint materialrecordinfo_PKC primary key (MATERIALITEMCODE,PROCESSDATE,SEQNO)
 ) comment '資材履歴情報' ;
 
+-- 掲示板メッセージ
+drop index MessageBoardData_Index1 on messageboarddata;
+drop index MessageBoardData_Index2 on messageboarddata;
+
+drop table if exists messageboarddata cascade;
+
+create table messageboarddata (
+  RecordNumber decimal(6,0) unsigned not null comment 'レコード番号'
+  , BranchNumber decimal(3,0) unsigned not null comment 'レコード枝番'
+  , FromCode decimal(8,0) unsigned not null comment '書込み者コード'
+  , FromName varchar(60) not null comment '書込み者'
+  , MessageTitile varchar(100) comment '伝言タイトル'
+  , MessageContent varchar(1333) not null comment '伝言内容'
+  , LinkType decimal(2,0) not null comment 'リンク動作タイプ'
+  , LinkMessage varchar(200) comment 'リンク文字列'
+  , LinkCode varchar(30) comment 'リンクキー'
+  , WritingDate datetime not null comment '書込み日時'
+  , PersonCode decimal(8,0) not null comment '書込み担当者コード'
+  , ShareFlag decimal(2,0) not null comment '管理者対象フラグ'
+  , MessageColor varchar(8) comment '文字色'
+  , BackColor varchar(8) comment 'バックカラー'
+  , MessageFlag decimal(1,0) not null comment 'メッセージフラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint messageboarddata_PKC primary key (RecordNumber,BranchNumber)
+) comment '掲示板メッセージ' ;
+
+create index MessageBoardData_Index1
+  on messageboarddata(WritingDate);
+
+create index MessageBoardData_Index2
+  on messageboarddata(MessageFlag);
+
+-- 掲示板対象者テーブル
+drop index MessageBoardTerget_Index1 on messageboardterget;
+
+drop table if exists messageboardterget cascade;
+
+create table messageboardterget (
+  RecordNumber decimal(6,0) unsigned not null comment 'レコード番号'
+  , BranchNumber decimal(3,0) unsigned not null comment 'レコード枝番'
+  , SeqNum decimal(3,0) unsigned not null comment '順番'
+  , ToCode decimal(8,0) not null comment '対象者コード'
+  , ToName varchar(60) not null comment '対象者'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint messageboardterget_PKC primary key (RecordNumber,BranchNumber,SeqNum)
+) comment '掲示板対象者テーブル' ;
+
+create index MessageBoardTerget_Index1
+  on messageboardterget(RecordNumber,BranchNumber);
+
+-- 掲示板メッセージ閲覧履歴
+drop table if exists messagebrowsinghistory cascade;
+
+create table messagebrowsinghistory (
+  RecordNumber decimal(6,0) unsigned not null comment 'レコード番号'
+  , BranchNumber decimal(3,0) unsigned not null comment 'レコード枝番'
+  , SeqNum decimal(3,0) unsigned not null comment '順番'
+  , BrowsingCode decimal(8,0) not null comment '閲覧者コード'
+  , BrowsingDate datetime not null comment '閲覧日付'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint messagebrowsinghistory_PKC primary key (RecordNumber,BranchNumber,SeqNum)
+) comment '掲示板メッセージ閲覧履歴' ;
+
+-- 月マスタ
+drop index month_Index1 on monthmaster;
+
+drop table if exists monthmaster cascade;
+
+create table monthmaster (
+  month smallint(6) not null comment '月'
+) comment '月マスタ' ;
+
+create index month_Index1
+  on monthmaster(month);
+
+-- 発注者マスタ
+drop table if exists orderersmaster cascade;
+
+create table orderersmaster (
+  OrderCotegory decimal(5,0) unsigned not null comment '発注者区分'
+  , OrderersCode decimal(5,0) unsigned not null comment '発注者コード'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , OrderFlg decimal(1,0) not null comment '法人団体・個人フラグ'
+  , CorporateStatusName varchar(100) comment '法人格名称'
+  , CorporateStatusPoint decimal(1,0) comment '法人格名称位置'
+  , OrderersName1 varchar(60) not null comment '発注者名1'
+  , OrderersName2 varchar(60) comment '発注者名２'
+  , DepartmentName varchar(60) comment '部署名'
+  , ChargePersonName varchar(60) comment '担当者名'
+  , ZipCode varchar(8) comment '郵便番号'
+  , Address1 varchar(60) comment '住所１'
+  , Address2 varchar(60) comment '住所2'
+  , Address3 varchar(60) comment '住所3'
+  , PhoneNumber varchar(13) comment '電話番号'
+  , FaxNumber varchar(13) comment 'FAX番号'
+  , MailAddress varchar(257) comment 'メールアドレス'
+  , Note varchar(300) comment '備考'
+  , DeleteFlg decimal(1,0) not null comment '削除フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint orderersmaster_PKC primary key (OrderCotegory,OrderersCode)
+) comment '発注者マスタ' ;
+
+-- 受注金額データ
+drop table if exists orderspricedata cascade;
+
+create table orderspricedata (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , ChangeNo decimal(3,0) unsigned not null comment '変更番号'
+  , ChangeDate date not null comment '変更日'
+  , ChangePersonCode decimal(8,0) unsigned not null comment '変更者コード'
+  , ChangePersonName varchar(60) comment '変更者名'
+  , BeforeValue decimal(14,0) not null comment '変更前税抜受注金額'
+  , BeforeValueInTax decimal(14,0) not null comment '変更前税込受注金額'
+  , AfterValue decimal(14,0) not null comment '変更後税抜受注金額'
+  , AfterValueInTax decimal(14,0) not null comment '変更後税込受注金額'
+  , ChangeComment varchar(200) comment '変更理由'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint orderspricedata_PKC primary key (ConstructionCode,ChangeNo)
+) comment '受注金額データ' ;
+
 -- 支払承認情報データ
 drop table if exists paymentapprovalinfo cascade;
 
@@ -2209,6 +1574,351 @@
   , constraint paymentdatadetail_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT)
 ) comment '支払明細データ' ;
 
+-- 担当者承認データ
+drop table if exists personapproval cascade;
+
+create table personapproval (
+  PersonCode decimal(8,0) unsigned not null comment '担当者コード'
+  , ApprovalCode decimal(3,0) unsigned not null comment '承認機能番号'
+  , OrderDate date not null comment '受付日'
+  , OrderNo decimal(2,0) unsigned not null comment '受付番号'
+  , SeqNo decimal(2,0) not null comment '枝番'
+  , PersonCodeApproval decimal(8,0) unsigned not null comment '申請・承認者コード'
+  , PetitionApprovalDate datetime not null comment '申請・承認日付'
+  , ApprovalLimitDates datetime not null comment '承認希望日'
+  , ApprovalStatus decimal(1,0) not null comment '承認状態'
+  , InputComment varchar(300) comment 'コメント'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint personapproval_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,SeqNo)
+) comment '担当者承認データ' ;
+
+-- 担当者承認コメントデータ
+drop table if exists personapprovalcomment cascade;
+
+create table personapprovalcomment (
+  PersonCode decimal(8,0) unsigned not null comment '担当者コード'
+  , ApprovalCode decimal(3,0) unsigned not null comment '承認機能番号'
+  , OrderDate date not null comment '受付日'
+  , OrderNo decimal(2,0) unsigned not null comment '受付番号'
+  , CommentNo decimal(2,0) not null comment 'コメント番号'
+  , ParentNo decimal(2,0) not null comment '親コメント番号'
+  , ApproValComment varchar(300) comment '指示・連絡コメント'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint personapprovalcomment_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,CommentNo)
+) comment '担当者承認コメントデータ' ;
+
+-- 担当者対象部署マスタ
+drop index PersonDepartmentMaster_Index1 on persondepartmentmaster;
+drop index PersonDepartmentMaster_Index2 on persondepartmentmaster;
+
+drop table if exists persondepartmentmaster cascade;
+
+create table persondepartmentmaster (
+  PersonCode decimal(8,0) unsigned not null comment '担当者コード'
+  , DepartmentCode decimal(5,0) unsigned not null comment '部署コード'
+  , AffiliationFlg decimal(1,0) not null comment '所属フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint persondepartmentmaster_PKC primary key (PersonCode,DepartmentCode)
+) comment '担当者対象部署マスタ' ;
+
+create index PersonDepartmentMaster_Index1
+  on persondepartmentmaster(PersonCode);
+
+create index PersonDepartmentMaster_Index2
+  on persondepartmentmaster(DepartmentCode);
+
+-- 担当者マスタ
+drop index PersonInChargeMaster_Index1 on personinchargemaster;
+drop index PersonInChargeMaster_Index2 on personinchargemaster;
+
+drop table if exists personinchargemaster cascade;
+
+create table personinchargemaster (
+  PersonCode decimal(8,0) unsigned not null comment '担当者コード'
+  , DisplayOrder decimal(8,0) unsigned not null comment '表示順'
+  , PersonName varchar(60) not null comment '担当者名'
+  , StartDate date not null comment '使用開始年月日'
+  , EndDate date comment '使用終了年月日'
+  , PassWord varchar(16) comment 'パスワード'
+  , SecurityManagement decimal(1,0) not null comment '機密区分'
+  , SecCode decimal(2,0) unsigned not null comment '保護区分番号'
+  , MsgBackColor varchar(8) comment 'メッセージ背景色'
+  , DisplayString varchar(20) comment '表示・印刷名称'
+  , DepartmentCode decimal(5,0) unsigned comment '部署コード'
+  , MonthlySalary decimal(11,0) not null comment '月給金額'
+  , YearSalary decimal(12,0) not null comment '年俸金額'
+  , Qualification varchar(120) comment '資格入力欄'
+  , SealPrintName varchar(5) comment '印鑑表示名'
+  , EmployeeClassFlg decimal(1,0) not null comment '社員区分'
+  , LedgerFlg decimal(1,0) not null comment '台帳計算対象フラグ'
+  , DeleteFlg decimal(1,0) not null comment '削除フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint personinchargemaster_PKC primary key (PersonCode)
+) comment '担当者マスタ' ;
+
+create index PersonInChargeMaster_Index1
+  on personinchargemaster(StartDate);
+
+create index PersonInChargeMaster_Index2
+  on personinchargemaster(DepartmentCode);
+
+-- 担当者給与マスタ
+drop index PersonSalaryMaster_Index1 on personsalarymaster;
+drop index PersonSalaryMaster_Index2 on personsalarymaster;
+
+drop table if exists personsalarymaster cascade;
+
+create table personsalarymaster (
+  PersonCode decimal(8,0) unsigned not null comment '担当者コード'
+  , StartDate date not null comment '使用開始年月日'
+  , MonthlySalary decimal(11,0) not null comment '月給金額'
+  , YearSalary decimal(12,0) not null comment '年俸金額'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint personsalarymaster_PKC primary key (PersonCode,StartDate)
+) comment '担当者給与マスタ' ;
+
+create index PersonSalaryMaster_Index1
+  on personsalarymaster(PersonCode);
+
+create index PersonSalaryMaster_Index2
+  on personsalarymaster(StartDate);
+
+-- 指示事項データ
+drop table if exists pointingoutcomment cascade;
+
+create table pointingoutcomment (
+  ConstructionCode decimal(10,0) not null comment '工事コード'
+  , ProcessNo smallint(6) not null comment '処理番号（画面番号）'
+  , SeqNo smallint(6) not null comment '順序'
+  , PageCount smallint(6) not null comment 'ページ番号'
+  , PersonCode decimal(8,0) not null comment '記入者コード'
+  , DrowColor varchar(8) comment '描画色'
+  , CommentMessage varchar(1000) comment 'メッセージ'
+  , StartPointX smallint(6) not null comment '指摘項目位置Ｘ'
+  , StartPointY smallint(6) not null comment '指摘項目位置Ｙ'
+  , CurrentPointX smallint(6) not null comment '初期位置Ｘ'
+  , CurrentPointY smallint(6) not null comment '初期位置Ｙ'
+  , CurrentWidth smallint(6) not null comment '表示サイズWidth'
+  , CurrentHeight smallint(6) not null comment '表示サイズHeigth'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint pointingoutcomment_PKC primary key (ConstructionCode,ProcessNo,SeqNo)
+) comment '指示事項データ' ;
+
+-- 発注者打ち合わせ議事録データ
+drop table if exists proceedingsdata cascade;
+
+create table proceedingsdata (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , ProceedingsDataDate date not null comment '議事録作成日'
+  , StartMeetingTime decimal(4,0) unsigned not null comment '会議時間開始'
+  , EndMeetingTime decimal(4,0) unsigned not null comment '会議時間終了'
+  , CreatorCode decimal(8,0) not null comment '作成者コード'
+  , PalceFlag decimal(1,0) not null comment '現地フラグ'
+  , MeetingPalce varchar(120) comment '打合せ場所'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint proceedingsdata_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime)
+) comment '発注者打ち合わせ議事録データ' ;
+
+-- 発注者打ち合わせ議事録データ（出席者）
+drop table if exists proceedingsdataattend cascade;
+
+create table proceedingsdataattend (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , ProceedingsDataDate date not null comment '議事録作成日'
+  , StartMeetingTime decimal(4,0) unsigned not null comment '会議時間開始'
+  , SeqNo decimal(3,0) unsigned not null comment '明細行番号'
+  , Department varchar(20) comment '出席者所属'
+  , AttendName varchar(10) comment '出席者氏名'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint proceedingsdataattend_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
+) comment '発注者打ち合わせ議事録データ（出席者）' ;
+
+-- 発注者打ち合わせ議事録データ（出席者）
+drop table if exists proceedingsdataattendee cascade;
+
+create table proceedingsdataattendee (
+  PersonCode decimal(8,0) not null comment '作成者コード'
+  , ProceedingsDataDate date not null comment '議事録作成日'
+  , ConstructionCode int(11) not null comment '工事番号'
+  , SeqNo smallint(6) not null comment 'データ行番号'
+  , Department varchar(100) comment '出席者所属'
+  , AttendeeName varchar(100) comment '出席者氏名'
+  , EntryDate datetime not null comment '登録年月日'
+  , UpdateDate datetime not null comment '更新年月日'
+  , constraint proceedingsdataattendee_PKC primary key (PersonCode,ProceedingsDataDate,ConstructionCode,SeqNo)
+) comment '発注者打ち合わせ議事録データ（出席者）' ;
+
+-- 発注者打ち合わせ議事録データ（明細）
+drop table if exists proceedingsdatadetail cascade;
+
+create table proceedingsdatadetail (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , ProceedingsDataDate date not null comment '議事録作成日'
+  , StartMeetingTime decimal(4,0) unsigned not null comment '会議時間開始'
+  , SeqNo decimal(3,0) unsigned not null comment '明細行番号'
+  , TitleNo varchar(5) comment '議題番号'
+  , Title varchar(20) comment '議題'
+  , ContentsText varchar(50) comment '内容'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint proceedingsdatadetail_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
+) comment '発注者打ち合わせ議事録データ（明細）' ;
+
+-- 承認データ
+drop table if exists processapproval cascade;
+
+create table processapproval (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , ApprovalCode decimal(3,0) unsigned not null comment '承認機能番号'
+  , OrderNo decimal(2,0) unsigned not null comment '受付番号'
+  , SeqNo decimal(2,0) not null comment '枝番'
+  , PersonCode decimal(8,0) unsigned not null comment '申請・承認者コード'
+  , PetitionApprovalDate datetime not null comment '申請・承認日付'
+  , ApprovalLimitDates datetime not null comment '承認希望日'
+  , ApprovalStatus decimal(1,0) not null comment '承認状態'
+  , InputComment varchar(300) comment 'コメント'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint processapproval_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SeqNo)
+) comment '承認データ' ;
+
+-- 承認コメントデータ
+drop table if exists processapprovalcomment cascade;
+
+create table processapprovalcomment (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , ApprovalCode decimal(3,0) unsigned not null comment '承認機能番号'
+  , OrderNo decimal(2,0) unsigned not null comment '受付番号'
+  , CommentNo decimal(2,0) not null comment 'コメント番号'
+  , ParentNo decimal(2,0) not null comment '親コメント番号'
+  , ApproValComment varchar(300) comment '指示・連絡コメント'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint processapprovalcomment_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,CommentNo)
+) comment '承認コメントデータ' ;
+
+-- 承認明細データ
+drop table if exists processapprovaldetail cascade;
+
+create table processapprovaldetail (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , ApprovalCode decimal(3,0) unsigned not null comment '承認機能番号'
+  , OrderNo decimal(2,0) unsigned not null comment '受付番号'
+  , SerialNo decimal(2,0) unsigned not null comment '枝番'
+  , LinkCode decimal(10,0) not null comment 'リンク情報'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint processapprovaldetail_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SerialNo)
+) comment '承認明細データ' ;
+
+-- 起動対象マスタ
+drop index ProcessExcuteMaster_Index1 on processexcutemaster;
+drop index ProcessExcuteMaster_Index2 on processexcutemaster;
+
+drop table if exists processexcutemaster cascade;
+
+create table processexcutemaster (
+  SecCode decimal(2,0) unsigned not null comment '保護区分番号'
+  , ExecCode decimal(4,0) unsigned not null comment '起動処理番号'
+  , EditFlg decimal(1,0) not null comment '編集フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint processexcutemaster_PKC primary key (SecCode,ExecCode)
+) comment '起動対象マスタ' ;
+
+create index ProcessExcuteMaster_Index1
+  on processexcutemaster(SecCode);
+
+create index ProcessExcuteMaster_Index2
+  on processexcutemaster(ExecCode);
+
+-- 注文書データ
+drop table if exists purchaseorder cascade;
+
+create table purchaseorder (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , SeqNo decimal(3,0) unsigned not null comment '注文書枝番'
+  , CompanyCode decimal(8,0) not null comment '協力会社コード'
+  , CreateDate date comment '作成日付'
+  , OrderPrice decimal(12,0) not null comment '発注金額'
+  , LastRowStringDate date not null comment '最終行表示日付'
+  , OrderSheetType decimal(1,0) not null comment '簡易・本式フラグ'
+  , PaymentTerms decimal(1,0) not null comment '支払い条件'
+  , CashRatio decimal(4,1) not null comment '現金割合（％）'
+  , BillPeriod decimal(4,0) not null comment '手形期間'
+  , PrePayments decimal(1,0) not null comment '前金払'
+  , PrePaymentsDays decimal(3,0) not null comment '前金払日数'
+  , PrePaymentsPrice decimal(12,0) not null comment '前金払金額'
+  , PartialPayment decimal(1,0) not null comment '部分払'
+  , PartialPaymentMounth decimal(2,0) unsigned not null comment '部分払締切月'
+  , PartialPaymentDay1 decimal(2,0) unsigned not null comment '部分払締切日'
+  , PartialPaymentDay2 decimal(2,0) unsigned not null comment '部分払支払日'
+  , PartialPaymentPrice decimal(12,0) not null comment '部分払金額'
+  , CompletionPayment decimal(1,0) not null comment '引渡し時の支払'
+  , CompletionPaymentDays decimal(3,0) unsigned not null comment '引渡し時の支払日数'
+  , CompletionPaymentPrice decimal(12,0) not null comment '引渡し時の支払金額'
+  , LeadEngineerCode decimal(8,0) comment '主任技術者コード'
+  , LeadEngineerName varchar(60) comment 'LeadEngineerName'
+  , SafetyOfficerCode decimal(8,0) comment '安全管理者コード'
+  , SafetyOfficerName varchar(60) comment '安全管理者名'
+  , WorkersCount decimal(3,0) unsigned comment '作業員数'
+  , PrintoutDate date not null comment '印刷年月日'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint purchaseorder_PKC primary key (ConstructionCode,SeqNo)
+) comment '注文書データ' ;
+
+-- 注文書日付データ
+drop table if exists purchaseorderdate cascade;
+
+create table purchaseorderdate (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , SeqNo decimal(3,0) unsigned not null comment '注文書枝番'
+  , CompanyCode decimal(8,0) not null comment '協力会社コード'
+  , SendDate date not null comment '注文書郵送日'
+  , ReturnDate date not null comment '注文書返送日'
+  , ReturnCheckDate date not null comment '注文書返送確認日'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint purchaseorderdate_PKC primary key (ConstructionCode,SeqNo)
+) comment '注文書日付データ' ;
+
+-- 注文書明細データ
+drop index POrderDetail_Index1 on purchaseorderdetail;
+
+drop table if exists purchaseorderdetail cascade;
+
+create table purchaseorderdetail (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , SeqNo decimal(3,0) unsigned not null comment '注文書枝番'
+  , GroupCount decimal(1,0) not null comment 'グループ番号'
+  , LineCount decimal(3,0) unsigned not null comment '行番号'
+  , ComponentCode decimal(5,0) unsigned not null comment '構成キー'
+  , ItemCode decimal(5,0) unsigned not null comment '工種キー'
+  , FirstString varchar(120) comment '工種・品名'
+  , SecondString varchar(120) comment '内容内訳'
+  , UnitCount decimal(8,2) not null comment '数量'
+  , UnitName varchar(30) comment '単位'
+  , UnitPrice decimal(10,0) not null comment '単価'
+  , OrdersLinePrice decimal(12,0) comment '金額'
+  , SourceCode decimal(10,0) unsigned not null comment '予算作成時工事番号'
+  , SourceLineCnt decimal(3,0) unsigned not null comment '注文書作成時台帳行番号'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint purchaseorderdetail_PKC primary key (ConstructionCode,SeqNo,GroupCount,LineCount)
+) comment '注文書明細データ' ;
+
+create index POrderDetail_Index1
+  on purchaseorderdetail(SourceCode);
+
 -- 請求データ
 drop table if exists requestdata cascade;
 
@@ -2275,19 +1985,471 @@
 
 alter table requesthead add unique REQCONSTRUCTIONCODE (REQCONSTRUCTIONCODE,ORDERNO) ;
 
+-- 請求書日付データ
+drop table if exists requestorderdate cascade;
 
--- データ投入
--- 銀行営業日マスタ
-LOCK TABLES `bankbusinessdaymaster` WRITE;
-/*!40000 ALTER TABLE `bankbusinessdaymaster` DISABLE KEYS */;
-INSERT INTO `bankbusinessdaymaster` VALUES (201611,2,NULL,0,NULL,NULL),(201611,4,NULL,0,NULL,NULL),(201611,7,NULL,0,NULL,NULL),(201611,8,NULL,0,NULL,NULL),(201611,9,NULL,0,NULL,NULL),(201611,10,NULL,0,NULL,NULL),(201611,11,NULL,0,NULL,NULL),(201611,14,NULL,0,NULL,NULL),(201611,15,NULL,0,NULL,NULL),(201611,16,NULL,0,NULL,NULL),(201611,17,NULL,0,NULL,NULL),(201611,18,NULL,0,NULL,NULL),(201611,21,NULL,0,NULL,NULL),(201611,22,NULL,0,NULL,NULL),(201611,24,NULL,0,NULL,NULL),(201611,25,NULL,0,NULL,NULL),(201611,28,NULL,0,NULL,NULL),(201611,29,NULL,0,NULL,NULL),(201611,30,NULL,0,NULL,NULL),(201612,1,NULL,0,NULL,NULL),(201612,2,NULL,0,NULL,NULL),(201612,5,NULL,0,NULL,NULL),(201612,6,NULL,0,NULL,NULL),(201612,7,NULL,0,NULL,NULL),(201612,8,NULL,0,NULL,NULL),(201612,9,NULL,0,NULL,NULL),(201612,12,NULL,0,NULL,NULL),(201612,13,NULL,0,NULL,NULL),(201612,14,NULL,0,NULL,NULL),(201612,15,NULL,0,NULL,NULL),(201612,16,NULL,0,NULL,NULL),(201612,19,NULL,0,NULL,NULL),(201612,20,NULL,0,NULL,NULL),(201612,21,NULL,0,NULL,NULL),(201612,22,NULL,0,NULL,NULL),(201612,26,NULL,0,NULL,NULL),(201612,27,NULL,0,NULL,NULL),(201612,28,NULL,0,NULL,NULL),(201612,29,NULL,0,NULL,NULL),(201612,30,NULL,0,NULL,NULL),(201701,4,NULL,0,NULL,NULL),(201701,5,NULL,0,NULL,NULL),(201701,6,NULL,0,NULL,NULL),(201701,10,NULL,0,NULL,NULL),(201701,11,NULL,0,NULL,NULL),(201701,12,NULL,0,NULL,NULL),(201701,13,NULL,0,NULL,NULL),(201701,16,NULL,0,NULL,NULL),(201701,17,NULL,0,NULL,NULL),(201701,18,NULL,0,NULL,NULL),(201701,19,NULL,0,NULL,NULL),(201701,20,NULL,0,NULL,NULL),(201701,23,NULL,0,NULL,NULL),(201701,24,NULL,0,NULL,NULL),(201701,25,NULL,0,NULL,NULL),(201701,26,NULL,0,NULL,NULL),(201701,27,NULL,0,NULL,NULL),(201701,30,NULL,0,NULL,NULL),(201701,31,NULL,0,NULL,NULL),(201702,1,NULL,0,NULL,NULL),(201702,2,NULL,0,NULL,NULL),(201702,3,NULL,0,NULL,NULL),(201702,6,NULL,0,NULL,NULL),(201702,7,NULL,0,NULL,NULL),(201702,8,NULL,0,NULL,NULL),(201702,9,NULL,0,NULL,NULL),(201702,10,NULL,0,NULL,NULL),(201702,13,NULL,0,NULL,NULL),(201702,14,NULL,0,NULL,NULL),(201702,15,NULL,0,NULL,NULL),(201702,16,NULL,0,NULL,NULL),(201702,17,NULL,0,NULL,NULL),(201702,20,NULL,0,NULL,NULL),(201702,21,NULL,0,NULL,NULL),(201702,22,NULL,0,NULL,NULL),(201702,23,NULL,0,NULL,NULL),(201702,24,NULL,0,NULL,NULL),(201702,27,NULL,0,NULL,NULL),(201702,28,NULL,0,NULL,NULL),(201703,1,NULL,0,NULL,NULL),(201703,2,NULL,0,NULL,NULL),(201703,3,NULL,0,NULL,NULL),(201703,6,NULL,0,NULL,NULL),(201703,7,NULL,0,NULL,NULL),(201703,8,NULL,0,NULL,NULL),(201703,9,NULL,0,NULL,NULL),(201703,10,NULL,0,NULL,NULL),(201703,13,NULL,0,NULL,NULL),(201703,14,NULL,0,NULL,NULL),(201703,15,NULL,0,NULL,NULL),(201703,16,NULL,0,NULL,NULL),(201703,17,NULL,0,NULL,NULL),(201703,21,NULL,0,NULL,NULL),(201703,22,NULL,0,NULL,NULL),(201703,23,NULL,0,NULL,NULL),(201703,24,NULL,0,NULL,NULL),(201703,27,NULL,0,NULL,NULL),(201703,28,NULL,0,NULL,NULL),(201703,29,NULL,0,NULL,NULL),(201703,30,NULL,0,NULL,NULL),(201703,31,NULL,0,NULL,NULL),(201704,3,NULL,0,NULL,NULL),(201704,4,NULL,0,NULL,NULL),(201704,5,NULL,0,NULL,NULL),(201704,6,NULL,0,NULL,NULL),(201704,7,NULL,0,NULL,NULL),(201704,10,NULL,0,NULL,NULL),(201704,11,NULL,0,NULL,NULL),(201704,12,NULL,0,NULL,NULL),(201704,13,NULL,0,NULL,NULL),(201704,14,NULL,0,NULL,NULL),(201704,17,NULL,0,NULL,NULL),(201704,18,NULL,0,NULL,NULL),(201704,19,NULL,0,NULL,NULL),(201704,20,NULL,0,NULL,NULL),(201704,21,NULL,0,NULL,NULL),(201704,24,NULL,0,NULL,NULL),(201704,25,NULL,0,NULL,NULL),(201704,26,NULL,0,NULL,NULL),(201704,27,NULL,0,NULL,NULL),(201704,28,NULL,0,NULL,NULL),(201705,1,NULL,0,NULL,NULL),(201705,2,NULL,0,NULL,NULL),(201705,8,NULL,0,NULL,NULL),(201705,9,NULL,0,NULL,NULL),(201705,10,NULL,0,NULL,NULL),(201705,11,NULL,0,NULL,NULL),(201705,12,NULL,0,NULL,NULL),(201705,15,NULL,0,NULL,NULL),(201705,16,NULL,0,NULL,NULL),(201705,17,NULL,0,NULL,NULL),(201705,18,NULL,0,NULL,NULL),(201705,19,NULL,0,NULL,NULL),(201705,22,NULL,0,NULL,NULL),(201705,23,NULL,0,NULL,NULL),(201705,24,NULL,0,NULL,NULL),(201705,25,NULL,0,NULL,NULL),(201705,26,NULL,0,NULL,NULL),(201705,29,NULL,0,NULL,NULL),(201705,30,NULL,0,NULL,NULL),(201705,31,NULL,0,NULL,NULL),(201706,1,NULL,0,NULL,NULL),(201706,2,NULL,0,NULL,NULL),(201706,5,NULL,0,NULL,NULL),(201706,6,NULL,0,NULL,NULL),(201706,7,NULL,0,NULL,NULL),(201706,8,NULL,0,NULL,NULL),(201706,9,NULL,0,NULL,NULL),(201706,12,NULL,0,NULL,NULL),(201706,13,NULL,0,NULL,NULL),(201706,14,NULL,0,NULL,NULL),(201706,15,NULL,0,NULL,NULL),(201706,16,NULL,0,NULL,NULL),(201706,19,NULL,0,NULL,NULL),(201706,20,NULL,0,NULL,NULL),(201706,21,NULL,0,NULL,NULL),(201706,22,NULL,0,NULL,NULL),(201706,23,NULL,0,NULL,NULL),(201706,26,NULL,0,NULL,NULL),(201706,27,NULL,0,NULL,NULL),(201706,28,NULL,0,NULL,NULL),(201706,29,NULL,0,NULL,NULL),(201706,30,NULL,0,NULL,NULL),(201707,3,NULL,0,NULL,NULL),(201707,4,NULL,0,NULL,NULL),(201707,5,NULL,0,NULL,NULL),(201707,6,NULL,0,NULL,NULL),(201707,7,NULL,0,NULL,NULL),(201707,10,NULL,0,NULL,NULL),(201707,11,NULL,0,NULL,NULL),(201707,12,NULL,0,NULL,NULL),(201707,13,NULL,0,NULL,NULL),(201707,14,NULL,0,NULL,NULL),(201707,18,NULL,0,NULL,NULL),(201707,19,NULL,0,NULL,NULL),(201707,20,NULL,0,NULL,NULL),(201707,21,NULL,0,NULL,NULL),(201707,24,NULL,0,NULL,NULL),(201707,25,NULL,0,NULL,NULL),(201707,26,NULL,0,NULL,NULL),(201707,27,NULL,0,NULL,NULL),(201707,28,NULL,0,NULL,NULL),(201707,31,NULL,0,NULL,NULL),(201708,1,NULL,0,NULL,NULL),(201708,2,NULL,0,NULL,NULL),(201708,3,NULL,0,NULL,NULL),(201708,4,NULL,0,NULL,NULL),(201708,7,NULL,0,NULL,NULL),(201708,8,NULL,0,NULL,NULL),(201708,9,NULL,0,NULL,NULL),(201708,10,NULL,0,NULL,NULL),(201708,14,NULL,0,NULL,NULL),(201708,15,NULL,0,NULL,NULL),(201708,16,NULL,0,NULL,NULL),(201708,17,NULL,0,NULL,NULL),(201708,18,NULL,0,NULL,NULL),(201708,21,NULL,0,NULL,NULL),(201708,22,NULL,0,NULL,NULL),(201708,23,NULL,0,NULL,NULL),(201708,24,NULL,0,NULL,NULL),(201708,25,NULL,0,NULL,NULL),(201708,28,NULL,0,NULL,NULL),(201708,29,NULL,0,NULL,NULL),(201708,30,NULL,0,NULL,NULL),(201708,31,NULL,0,NULL,NULL),(201709,1,NULL,0,NULL,NULL),(201709,4,NULL,0,NULL,NULL),(201709,5,NULL,0,NULL,NULL),(201709,6,NULL,0,NULL,NULL),(201709,7,NULL,0,NULL,NULL),(201709,8,NULL,0,NULL,NULL),(201709,11,NULL,0,NULL,NULL),(201709,12,NULL,0,NULL,NULL),(201709,13,NULL,0,NULL,NULL),(201709,14,NULL,0,NULL,NULL),(201709,15,NULL,0,NULL,NULL),(201709,19,NULL,0,NULL,NULL),(201709,20,NULL,0,NULL,NULL),(201709,21,NULL,0,NULL,NULL),(201709,22,NULL,0,NULL,NULL),(201709,25,NULL,0,NULL,NULL),(201709,26,NULL,0,NULL,NULL),(201709,27,NULL,0,NULL,NULL),(201709,28,NULL,0,NULL,NULL),(201709,29,NULL,0,NULL,NULL),(201710,2,NULL,0,NULL,NULL),(201710,3,NULL,0,NULL,NULL),(201710,4,NULL,0,NULL,NULL),(201710,5,NULL,0,NULL,NULL),(201710,6,NULL,0,NULL,NULL),(201710,10,NULL,0,NULL,NULL),(201710,11,NULL,0,NULL,NULL),(201710,12,NULL,0,NULL,NULL),(201710,13,NULL,0,NULL,NULL),(201710,16,NULL,0,NULL,NULL),(201710,17,NULL,0,NULL,NULL),(201710,18,NULL,0,NULL,NULL),(201710,19,NULL,0,NULL,NULL),(201710,20,NULL,0,NULL,NULL),(201710,23,NULL,0,NULL,NULL),(201710,24,NULL,0,NULL,NULL),(201710,25,NULL,0,NULL,NULL),(201710,26,NULL,0,NULL,NULL),(201710,27,NULL,0,NULL,NULL),(201710,30,NULL,0,NULL,NULL),(201710,31,NULL,0,NULL,NULL),(201711,1,NULL,0,NULL,NULL),(201711,2,NULL,0,NULL,NULL),(201711,6,NULL,0,NULL,NULL),(201711,7,NULL,0,NULL,NULL),(201711,8,NULL,0,NULL,NULL),(201711,9,NULL,0,NULL,NULL),(201711,10,NULL,0,NULL,NULL),(201711,13,NULL,0,NULL,NULL),(201711,14,NULL,0,NULL,NULL),(201711,15,NULL,0,NULL,NULL),(201711,16,NULL,0,NULL,NULL),(201711,17,NULL,0,NULL,NULL),(201711,20,NULL,0,NULL,NULL),(201711,21,NULL,0,NULL,NULL),(201711,22,NULL,0,NULL,NULL),(201711,24,NULL,0,NULL,NULL),(201711,27,NULL,0,NULL,NULL),(201711,28,NULL,0,NULL,NULL),(201711,29,NULL,0,NULL,NULL),(201711,30,NULL,0,NULL,NULL),(201712,1,NULL,0,NULL,NULL),(201712,4,NULL,0,NULL,NULL),(201712,5,NULL,0,NULL,NULL),(201712,6,NULL,0,NULL,NULL),(201712,7,NULL,0,NULL,NULL),(201712,8,NULL,0,NULL,NULL),(201712,11,NULL,0,NULL,NULL),(201712,12,NULL,0,NULL,NULL),(201712,13,NULL,0,NULL,NULL),(201712,14,NULL,0,NULL,NULL),(201712,15,NULL,0,NULL,NULL),(201712,18,NULL,0,NULL,NULL),(201712,19,NULL,0,NULL,NULL),(201712,20,NULL,0,NULL,NULL),(201712,21,NULL,0,NULL,NULL),(201712,22,NULL,0,NULL,NULL),(201712,25,NULL,0,NULL,NULL),(201712,26,NULL,0,NULL,NULL),(201712,27,NULL,0,NULL,NULL),(201712,28,NULL,0,NULL,NULL),(201712,29,NULL,0,NULL,NULL);
-/*!40000 ALTER TABLE `bankbusinessdaymaster` ENABLE KEYS */;
-UNLOCK TABLES;
+create table requestorderdate (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , RequestNo decimal(9,0) not null comment '請求No'
+  , SendDate date not null comment '請求書発給郵送日'
+  , PaymentDate date not null comment '入金日'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+) comment '請求書日付データ' ;
 
--- 締日マスタ
-LOCK TABLES `deadlinemaster` WRITE;
-/*!40000 ALTER TABLE `deadlinemaster` DISABLE KEYS */;
-INSERT INTO `deadlinemaster` VALUES (0,18,31,NULL,0,NULL,NULL),(1,8,10,NULL,0,NULL,NULL);
-/*!40000 ALTER TABLE `deadlinemaster` ENABLE KEYS */;
-UNLOCK TABLES;
+-- 売上グラフデータ
+drop index SalesGraphData_Idx1 on salesgraphdata;
+drop index SalesGraphData_idx2 on salesgraphdata;
 
+drop table if exists salesgraphdata cascade;
+
+create table salesgraphdata (
+  GraphDataCode decimal(8,0) not null comment 'グラフデータコード'
+  , ConstructionPeriod decimal(4,0) unsigned not null comment '事業期'
+  , SalesDataDays date not null comment '売上年月'
+  , DisplayOrder decimal(8,0) unsigned not null comment '表示順'
+  , DataName varchar(100) not null comment 'データ表示名称'
+  , SalesAmount decimal(10,0) not null comment '売上データ'
+  , AdministrativeExpense decimal(10,0) not null comment '販管・部署経費'
+  , GrossProfit decimal(10,0) not null comment '粗利益'
+  , NetIncome decimal(10,0) not null comment '純利益(損益)'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint salesgraphdata_PKC primary key (GraphDataCode,ConstructionPeriod,SalesDataDays)
+) comment '売上グラフデータ' ;
+
+create index SalesGraphData_Idx1
+  on salesgraphdata(DisplayOrder);
+
+create index SalesGraphData_idx2
+  on salesgraphdata(ConstructionPeriod);
+
+-- 保護区分マスタ
+drop index SecurityMaster_Index1 on securitymaster;
+drop index SecurityMaster_Index2 on securitymaster;
+drop index SecurityMaster_Index3 on securitymaster;
+
+drop table if exists securitymaster cascade;
+
+create table securitymaster (
+  SecCode decimal(2,0) unsigned not null comment '保護区分番号'
+  , DisplayOrder decimal(2,0) not null comment '表示順'
+  , SecName varchar(60) not null comment '保護区分名称'
+  , SecRank decimal(1,0) not null comment '保護区分ランク'
+  , SecRange decimal(1,0) not null comment '保護区分範囲'
+  , GeneralAffairs decimal(1,0) not null comment '総務業務フラグ'
+  , SelectBackColor varchar(8) not null comment '選択背景色'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint securitymaster_PKC primary key (SecCode)
+) comment '保護区分マスタ' ;
+
+create index SecurityMaster_Index1
+  on securitymaster(DisplayOrder);
+
+create index SecurityMaster_Index2
+  on securitymaster(SecRank);
+
+create index SecurityMaster_Index3
+  on securitymaster(SecRange);
+
+-- 協力業者施工工種登録申請データ
+drop table if exists subconstrjobitemregist cascade;
+
+create table subconstrjobitemregist (
+  PersonCode decimal(8,0) unsigned not null comment '申請者番号'
+  , CreateDate date not null comment '作成日'
+  , SeqNo decimal(2,0) unsigned not null comment '申請連番'
+  , DisplayOrder decimal(8,0) unsigned not null comment '表示順'
+  , ItemCode decimal(5,0) unsigned not null comment '工種キー'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint subconstrjobitemregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
+) comment '協力業者施工工種登録申請データ' ;
+
+-- 協力業者職種リンク登録申請データ
+drop table if exists subconstrjoblinkregist cascade;
+
+create table subconstrjoblinkregist (
+  PersonCode decimal(8,0) unsigned not null comment '申請者番号'
+  , CreateDate date not null comment '作成日'
+  , SeqNo decimal(2,0) unsigned not null comment '申請連番'
+  , DisplayOrder decimal(8,0) unsigned not null comment '表示順'
+  , JobCategoryCode decimal(5,0) not null comment '職種キー'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint subconstrjoblinkregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
+) comment '協力業者職種リンク登録申請データ' ;
+
+-- 協力業者登録申請データ
+drop table if exists subconstrregist cascade;
+
+create table subconstrregist (
+  PersonCode decimal(8,0) unsigned not null comment '申請者番号'
+  , CreateDate date not null comment '作成日'
+  , SeqNo decimal(2,0) unsigned not null comment '申請連番'
+  , DataMode decimal(1,0) comment 'データ区分'
+  , SourceCode decimal(8,0) not null comment '協力会社コード'
+  , PetitionPeriod decimal(4,0) unsigned not null comment '申請年度'
+  , CorporateStatusName varchar(40) comment '法人格名称'
+  , CorporateStatusPoint decimal(1,0) not null comment '法人格名称位置'
+  , CompanyName varchar(100) not null comment '協力会社名'
+  , CEOPositionName varchar(60) comment '代表者役職名'
+  , CEOName varchar(60) comment '代表者氏名'
+  , ContactPersonName varchar(60) comment '担当者氏名'
+  , ZipCode varchar(8) comment '郵便番号'
+  , Address1 varchar(60) comment '住所１'
+  , Address2 varchar(60) comment '住所2'
+  , Address3 varchar(60) comment '住所3'
+  , CellPhoneNumber varchar(13) comment '携帯電話番号'
+  , MailAddress varchar(257) comment 'メールアドレス'
+  , PhoneNumber varchar(13) comment '電話番号'
+  , FaxNumber varchar(13) comment 'FAX番号'
+  , JapaneseSyllabary varchar(2) comment '50音読み'
+  , StartDate date not null comment '取引開始年月日'
+  , Note varchar(300) comment '備考'
+  , labourKind decimal(1,0) not null comment '支払い通常・手間区分'
+  , OrderDate date comment '申請日'
+  , OrderNo decimal(2,0) unsigned not null comment '申請受付番号'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint subconstrregist_PKC primary key (PersonCode,CreateDate,SeqNo)
+) comment '協力業者登録申請データ' ;
+
+-- 協力会社工種マスタ
+drop table if exists subcontractoritemmaster cascade;
+
+create table subcontractoritemmaster (
+  ItemCode decimal(5,0) unsigned not null comment '工種キー'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , ItemName varchar(120) not null comment '工種名称'
+  , DeleteFlg decimal(1,0) not null comment '削除フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint subcontractoritemmaster_PKC primary key (ItemCode)
+) comment '協力会社工種マスタ' ;
+
+-- 協力会社職種マスタ
+drop table if exists subcontractorjobcategory cascade;
+
+create table subcontractorjobcategory (
+  JobCategoryCode decimal(5,0) not null comment '職種キー'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , JobCategoryName varchar(120) not null comment '職種名称'
+  , DeleteFlg decimal(1,0) not null comment '削除フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint subcontractorjobcategory_PKC primary key (JobCategoryCode)
+) comment '協力会社職種マスタ' ;
+
+-- 協力会社施工工種データ
+drop index SubContractorJobItem_Index1 on subcontractorjobitem;
+drop index SubContractorJobItem_Index2 on subcontractorjobitem;
+
+drop table if exists subcontractorjobitem cascade;
+
+create table subcontractorjobitem (
+  CompanyCode decimal(8,0) not null comment '協力会社コード'
+  , ItemCode decimal(5,0) unsigned not null comment '工種キー'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint subcontractorjobitem_PKC primary key (CompanyCode,ItemCode)
+) comment '協力会社施工工種データ' ;
+
+create index SubContractorJobItem_Index1
+  on subcontractorjobitem(CompanyCode);
+
+create index SubContractorJobItem_Index2
+  on subcontractorjobitem(ItemCode);
+
+-- 協力会社職種リンクマスタ
+drop index SubContractorJobLink_Index1 on subcontractorjoblink;
+drop index SubContractorJobLink_Index2 on subcontractorjoblink;
+
+drop table if exists subcontractorjoblink cascade;
+
+create table subcontractorjoblink (
+  CompanyCode decimal(8,0) not null comment '協力会社コード'
+  , JobCategoryCode decimal(5,0) not null comment '職種キー'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint subcontractorjoblink_PKC primary key (CompanyCode,JobCategoryCode)
+) comment '協力会社職種リンクマスタ' ;
+
+create index SubContractorJobLink_Index1
+  on subcontractorjoblink(CompanyCode);
+
+create index SubContractorJobLink_Index2
+  on subcontractorjoblink(JobCategoryCode);
+
+-- 協力会社マスタ
+drop index SubContractorMaster_Index1 on subcontractormaster;
+
+drop table if exists subcontractormaster cascade;
+
+create table subcontractormaster (
+  CompanyCode decimal(8,0) not null comment '協力会社コード'
+  , DisplayOrder decimal(8,0) unsigned not null comment '表示順'
+  , CorporateStatusName varchar(40) comment '法人格名称'
+  , CorporateStatusPoint decimal(1,0) not null comment '法人格名称位置'
+  , CompanyName varchar(100) not null comment '協力会社名'
+  , CEOPositionName varchar(60) comment '代表者役職名'
+  , CEOName varchar(60) comment '代表者氏名'
+  , ContactPersonName varchar(60) comment '担当者氏名'
+  , ZipCode varchar(8) comment '郵便番号'
+  , Address1 varchar(60) comment '住所１'
+  , Address2 varchar(60) comment '住所2'
+  , Address3 varchar(60) comment '住所3'
+  , CellPhoneNumber varchar(13) comment '携帯電話番号'
+  , MailAddress varchar(257) comment 'メールアドレス'
+  , PhoneNumber varchar(13) comment '電話番号'
+  , FaxNumber varchar(13) comment 'FAX番号'
+  , JapaneseSyllabary varchar(2) comment '50音読み'
+  , StartDate date not null comment '取引開始年月日'
+  , Note varchar(300) comment '備考'
+  , labourKind decimal(1,0) not null comment '支払い通常・手間区分'
+  , DeleteFlg decimal(1,0) default '0' not null comment '削除フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint subcontractormaster_PKC primary key (CompanyCode)
+) comment '協力会社マスタ' ;
+
+create index SubContractorMaster_Index1
+  on subcontractormaster(JapaneseSyllabary);
+
+-- 仕入先マスタ
+drop table if exists suppliersmaster cascade;
+
+create table suppliersmaster (
+  SuppliersCode decimal(5,0) unsigned not null comment '仕入先コード'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , SuppliersName1 varchar(60) not null comment '仕入先名1'
+  , SuppliersName2 varchar(60) comment '仕入先名２'
+  , ZipCode varchar(8) comment '郵便番号'
+  , Address1 varchar(60) comment '住所１'
+  , Address2 varchar(60) comment '住所2'
+  , Address3 varchar(60) comment '住所3'
+  , PhoneNumber varchar(13) comment '電話番号'
+  , FaxNumber varchar(13) comment 'FAX番号'
+  , Note varchar(300) comment '備考'
+  , DeleteFlg decimal(1,0) not null comment '削除フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint suppliersmaster_PKC primary key (SuppliersCode)
+) comment '仕入先マスタ' ;
+
+-- システム起動確認データ
+drop table if exists systemexecute cascade;
+
+create table systemexecute (
+  PrimaryCode tinyint(4) not null comment 'キー項目'
+  , TargetDate date not null comment '起動日付'
+  , SystemVersion int(11) not null comment '本体・環境バージョン'
+  , UpDateCopyVersion int(11) not null comment 'コピーバージョン'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint systemexecute_PKC primary key (PrimaryCode)
+) comment 'システム起動確認データ' ;
+
+-- 管理マスタ
+drop table if exists systemmaster cascade;
+
+create table systemmaster (
+  SystemCode decimal(3,0) unsigned not null comment '会社コード'
+  , CompanyName1 varchar(60) not null comment '会社名１'
+  , CompanyName2 varchar(60) comment '会社名２'
+  , CEOName varchar(60) not null comment '代表者氏名'
+  , CEOPositionName varchar(60) comment '代表者役職名'
+  , ZipCode varchar(8) not null comment '郵便番号'
+  , Address1 varchar(60) not null comment '住所１'
+  , Address2 varchar(60) comment '住所2'
+  , Address3 varchar(60) comment '住所3'
+  , PhoneNumber varchar(13) not null comment '電話番号'
+  , FaxNumber varchar(13) comment 'FAX番号'
+  , HomePageURL varchar(120) comment 'ホームページURL'
+  , ConstructionExpenses decimal(4,2) not null comment '工事部経費'
+  , OfficeExpenses decimal(4,2) not null comment '事務所経費'
+  , OperatingExpenses decimal(4,2) not null comment '営業経費'
+  , ConsumptionTax decimal(4,2) not null comment '消費税'
+  , CooperationRate decimal(4,2) not null comment '協力金比率'
+  , StatutoryWelfareRate decimal(4,2) not null comment '法定福利費比率'
+  , ExcelSavePath varchar(120) comment 'Excel保存パス'
+  , BusinessPeriod smallint(6) not null comment '現在営業期数'
+  , ConstructionYear smallint(6) not null comment '現在工事年度'
+  , BusinessBeginningDate varchar(5) not null comment '営業期期首日'
+  , ConstructionBeginningDate varchar(5) not null comment '工事年度期首日'
+  , ConstructionNoBase decimal(1,0) not null comment '工事番号基準値'
+  , SloganString1 varchar(100) comment '標語1'
+  , SloganString2 varchar(100) comment '標語2'
+  , SloganString3 varchar(100) comment '標語3'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint systemmaster_PKC primary key (SystemCode)
+) comment '管理マスタ' ;
+
+-- 期限マスタ
+drop index TermMaster_Index1 on termmaster;
+
+drop table if exists termmaster cascade;
+
+create table termmaster (
+  ConstructionStatusFlg decimal(2,0) not null comment '工事状態フラグ'
+  , FieldNo decimal(2,0) not null comment 'チェック対象フィールド番号'
+  , SeqNo decimal(2,0) not null comment '枝番'
+  , DisplayOrder decimal(2,0) not null comment '表示順'
+  , CheckSchdule decimal(1,0) not null comment 'チェックタイミング'
+  , TermDays decimal(3,0) not null comment '経過日'
+  , SendTitile varchar(100) comment 'タイトル'
+  , SendMessage varchar(100) comment 'メッセージ'
+  , BackColor varchar(8) comment '背景色'
+  , ForeColor varchar(8) comment '文字色'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint termmaster_PKC primary key (ConstructionStatusFlg,FieldNo,SeqNo)
+) comment '期限マスタ' ;
+
+create index TermMaster_Index1
+  on termmaster(DisplayOrder);
+
+-- 出勤交通費データ
+drop index TranceportDailyData_Index1 on tranceportdailydata;
+
+drop table if exists tranceportdailydata cascade;
+
+create table tranceportdailydata (
+  PersonCode decimal(8,0) unsigned not null comment '作成者コード'
+  , AttendanceDate date not null comment '日報作成日'
+  , StartDistance decimal(7,1) not null comment '当日出発キロ数'
+  , ComplateDistance decimal(7,1) not null comment '当日終了キロ数'
+  , TotalDistance decimal(6,1) not null comment '当日合計キロ数'
+  , OfficeGoFlg decimal(1,0) not null comment '事務所出勤フラグ'
+  , OfficeOutFlg decimal(1,0) not null comment '事務所帰宅フラグ'
+  , TrancePayGoFlg decimal(1,0) not null comment '有料通勤出勤フラグ'
+  , TrancePayOutFlg decimal(1,0) not null comment '有料通勤帰宅フラグ'
+  , WareHouseFlg decimal(1,0) not null comment '資材置場フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint tranceportdailydata_PKC primary key (PersonCode,AttendanceDate)
+) comment '出勤交通費データ' ;
+
+create index TranceportDailyData_Index1
+  on tranceportdailydata(AttendanceDate);
+
+-- 工事種別経費率マスタ
+drop table if exists typeexpensesmaster cascade;
+
+create table typeexpensesmaster (
+  TypeCode decimal(5,0) unsigned not null comment '工事種別コード'
+  , ExpensesPeriod smallint(6) not null comment '事業期'
+  , NameCode decimal(5,0) unsigned not null comment '経費名称コード'
+  , ExpensesRaito decimal(4,2) not null comment '経費率'
+  , DeleteFlg decimal(1,0) not null comment '削除フラグ'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint typeexpensesmaster_PKC primary key (TypeCode,ExpensesPeriod,NameCode)
+) comment '工事種別経費率マスタ' ;
+
+-- 単位マスタ
+drop index UnitMaster_Index1 on unitmaster;
+
+drop table if exists unitmaster cascade;
+
+create table unitmaster (
+  UnitKey decimal(5,0) unsigned not null comment '単位キー'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , UnitName varchar(30) not null comment '単位名称'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint unitmaster_PKC primary key (UnitKey)
+) comment '単位マスタ' ;
+
+create index UnitMaster_Index1
+  on unitmaster(DisplayOrder);
+
+-- 車両マスタ
+drop table if exists vehiclemaster cascade;
+
+create table vehiclemaster (
+  VehicleCode decimal(5,0) unsigned not null comment '車両コード'
+  , DisplayOrder decimal(5,0) unsigned not null comment '表示順'
+  , VehicleName varchar(100) not null comment '車両名称'
+  , RegistrationNumber varchar(30) comment '登録番号'
+  , IdentificationNumber varchar(30) comment '車体番号'
+  , ModelCode varchar(30) comment '型式'
+  , DepartmentCode decimal(5,0) unsigned not null comment '管理部署'
+  , VehicleScheduleFlg decimal(1,0) not null comment '車両予約表示フラグ'
+  , PurchaseDate date comment '購入日'
+  , PurchaseName varchar(30) comment '購入先'
+  , PurchaseContactPersons varchar(30) comment '購入先担当者'
+  , PurchasePhone varchar(13) comment '購入先電話番号'
+  , LeaseDate date comment 'リース開始日'
+  , LeaseDestination varchar(30) comment 'リース先'
+  , LeaseContactPersons varchar(30) comment 'リース先担当者'
+  , LeasePhone varchar(13) comment 'リース先電話番号'
+  , InsuranceCompany varchar(30) comment '任意保険会社'
+  , InsuranceContactPersons varchar(30) comment '任意保険会社担当者'
+  , InsurancePhone varchar(13) comment '任意保険会社電話番号'
+  , Note varchar(300) comment '備考'
+  , EntryDate datetime comment '登録日付'
+  , UpdateDate datetime comment '更新日付'
+  , constraint vehiclemaster_PKC primary key (VehicleCode)
+) comment '車両マスタ' ;
+
+-- 車両記録データ
+drop table if exists vehiclerecorddata cascade;
+
+create table vehiclerecorddata (
+  VehicleCode decimal(5,0) unsigned not null comment '車両コード'
+  , DivisionCode decimal(2,0) unsigned not null comment 'データ区分'
+  , SeqNo decimal(2,0) not null comment '枝番'
+  , RecordDate date comment '実地日'
+  , Mileage mediumint(9) comment '走行距離'
+  , Content varchar(100) comment '内容'
+  , PaymentCost decimal(10,0) comment '費用'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint vehiclerecorddata_PKC primary key (VehicleCode,DivisionCode,SeqNo)
+) comment '車両記録データ' ;
+
+-- 車両予約データ
+drop index VehicleScheduleData_Index1 on vehiclescheduledata;
+drop index VehicleScheduleData_Index2 on vehiclescheduledata;
+drop index VehicleScheduleData_Index3 on vehiclescheduledata;
+
+drop table if exists vehiclescheduledata cascade;
+
+create table vehiclescheduledata (
+  TargetDate date not null comment '対象日'
+  , VehicleCode decimal(5,0) unsigned not null comment '車両コード'
+  , MorningAfternoon decimal(1,0) not null comment '午前・午後'
+  , PersonCode decimal(8,0) unsigned not null comment '担当者コード'
+  , TargetYear year(4) not null comment '該当年'
+  , TargetMonth tinyint(3) unsigned not null comment '該当月'
+  , TargetDay year(4) not null comment '該当日'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint vehiclescheduledata_PKC primary key (TargetDate,VehicleCode,MorningAfternoon)
+) comment '車両予約データ' ;
+
+create index VehicleScheduleData_Index1
+  on vehiclescheduledata(TargetYear);
+
+create index VehicleScheduleData_Index2
+  on vehiclescheduledata(TargetMonth);
+
+create index VehicleScheduleData_Index3
+  on vehiclescheduledata(TargetDay);
+
+-- 年マスタ
+drop index year_Index1 on yearmaster;
+
+drop table if exists yearmaster cascade;
+
+create table yearmaster (
+  years smallint(6) not null comment '年'
+) comment '年マスタ' ;
+
+create index year_Index1
+  on yearmaster(years);
