SET SESSION FOREIGN_KEY_CHECKS=0; /* Drop Indexes */ 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 Tables */ 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 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 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; /* Create Tables */ -- 担当者行動予定データ 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 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 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) 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 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 = '工事詳細台帳データ【退避用】'; -- 工事詳細台帳明細データ【退避用】 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 = '工事詳細台帳明細データ【退避用】'; -- 工事詳細台帳実行データ【退避用】 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 = '工事詳細台帳実行データ【退避用】'; -- 積算見積データ【退避用】 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 = '積算見積データ【退避用】'; -- 積算見積ページデータ【退避用】 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 = '積算見積ページデータ【退避用】'; -- 積算見積データ明細【退避用】 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 = '積算見積データ明細【退避用】'; -- 法人格マスタ 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 = '法人格マスタ'; -- 共通費大項目マスタ 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 = '共通費大項目マスタ'; -- 共通費工種関連マスタ 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 = '共通費工種関連マスタ'; -- 共通費中項目マスタ 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 = '共通費中項目マスタ'; -- 共通費中項目キーマスタ 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 = '共通費中項目キーマスタ'; -- 構成工種関連マスタ 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 = '構成工種関連マスタ'; -- 構成マスタ 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 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 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 = '工事基本情報'; -- 工事基本情報明細 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 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 = '工事施工予算データ'; -- 工事施工予算データ明細 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 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 = '工種マスタ'; -- 工事詳細台帳データ 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 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 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 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 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 = '案件進捗日付データ'; -- 作業マスタ 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 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 = '作業単価マスタ'; -- 工事種別マスタ 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 = '工事種別マスタ'; -- 担当者毎経費データ 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 = '担当者毎経費データ'; -- 発注者登録申請データ 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 '発注者名2', DepartmentName varchar(60) COMMENT '部署名', ChargePersonName varchar(60) COMMENT '担当者名', ZipCode varchar(8) COMMENT '郵便番号', Address1 varchar(60) COMMENT '住所1', 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 = '発注者登録申請データ'; -- 日報データ 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 = '日報データ'; -- 日報データ (明細) 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 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 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 = '日報データ (資材)'; -- 日報データ (協力業者指示) 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 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 = '日報データ (車両)'; -- 部署経費率マスタ 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 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 = '部署マスタ'; -- 区分マスタ 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 = '区分マスタ'; -- 積算予算書データ 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 = '積算予算書データ'; -- 積算予算内訳データ明細 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 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 = '積算見積データ'; -- 積算見積ページデータ 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 = '積算見積ページデータ'; -- 積算見積データ明細 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 = '積算見積データ明細'; -- 会社休日マスタ 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 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 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 = '掲示板メッセージ'; -- 掲示板対象者テーブル 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 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 = '掲示板メッセージ閲覧履歴'; -- 発注者マスタ 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 '発注者名2', DepartmentName varchar(60) COMMENT '部署名', ChargePersonName varchar(60) COMMENT '担当者名', ZipCode varchar(8) COMMENT '郵便番号', Address1 varchar(60) COMMENT '住所1', 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 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 = '受注金額データ'; -- 担当者承認データ 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 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 = '担当者承認コメントデータ'; -- 担当者対象部署マスタ 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 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 = '担当者マスタ'; -- 担当者給与マスタ 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 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 = '発注者打ち合わせ議事録データ'; -- 発注者打ち合わせ議事録データ(出席者) 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 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 = '発注者打ち合わせ議事録データ(明細)'; -- 承認データ 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 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 = '承認コメントデータ'; -- 承認明細データ 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 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 '予算作成時工事番号', 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 '住所1', 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 '住所1', 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 '仕入先名2', ZipCode varchar(8) COMMENT '郵便番号', Address1 varchar(60) COMMENT '住所1', 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 '会社名1', CompanyName2 varchar(60) DEFAULT '' COMMENT '会社名2', CEOName varchar(60) DEFAULT '' NOT NULL COMMENT '代表者氏名', CEOPositionName varchar(60) DEFAULT '' COMMENT '代表者役職名', ZipCode varchar(8) NOT NULL COMMENT '郵便番号', Address1 varchar(60) NOT NULL COMMENT '住所1', 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 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);