Index: ProcessManagement.sql
===================================================================
--- ProcessManagement.sql	(revision 238)
+++ ProcessManagement.sql	(revision 239)
@@ -1,14 +1,10 @@
 -- Project Name : noname
--- Date/Time    : 2017/06/14 16:16:18
+-- Date/Time    : 2017/07/20 9:53:08
 -- Author       : Horiuchi
 -- RDBMS Type   : MySQL
 -- Application  : A5:SQL Mk-2
 
 -- 担当者行動予定データ
-drop index ActionScheduleData_Index1 on actionscheduledata;
-drop index ActionScheduleData_Index2 on actionscheduledata;
-drop index ActionScheduleData_Index3 on actionscheduledata;
-
 drop table if exists actionscheduledata cascade;
 
 create table actionscheduledata (
@@ -48,9 +44,6 @@
 ) comment '承認経路マスタ' ;
 
 -- 出勤日報データ
-drop index AttendDaily_Index1 on attendancedailydata;
-drop index AttendDaily_Index2 on attendancedailydata;
-
 drop table if exists attendancedailydata cascade;
 
 create table attendancedailydata (
@@ -297,8 +290,6 @@
 ) comment '積算見積データ明細【退避用】' ;
 
 -- 法人格マスタ
-drop index BusinessTypeMaster_Index1 on businesstypemaster;
-
 drop table if exists businesstypemaster cascade;
 
 create table businesstypemaster (
@@ -368,9 +359,6 @@
 ) comment '共通費中項目キーマスタ' ;
 
 -- 構成工種関連マスタ
-drop index ComponentLinkMaster_Index1 on componentlinkmaster;
-drop index ComponentLinkMaster_Index2 on componentlinkmaster;
-
 drop table if exists componentlinkmaster cascade;
 
 create table componentlinkmaster (
@@ -389,8 +377,6 @@
   on componentlinkmaster(ItemCode);
 
 -- 構成マスタ
-drop index ComponentMaster_Index1 on componentmaster;
-
 drop table if exists componentmaster cascade;
 
 create table componentmaster (
@@ -410,9 +396,6 @@
   on componentmaster(DisplayOrder);
 
 -- 構成工事種別関連マスタ
-drop index ComponentToTypeMaster_Index1 on componenttotypemaster;
-drop index ComponentToTypeMaster_Index2 on componenttotypemaster;
-
 drop table if exists componenttotypemaster cascade;
 
 create table componenttotypemaster (
@@ -431,13 +414,6 @@
   on componenttotypemaster(TypeCode);
 
 -- 工事基本情報
-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 constructionbaseinfo (
@@ -512,9 +488,6 @@
   on constructionbaseinfo(ConstructionPeriod);
 
 -- 工事基本情報明細
-drop index BaseInfoDetail_Idx1 on constructionbaseinfodetail;
-drop index BaseInfoDetail_Idx2 on constructionbaseinfodetail;
-
 drop table if exists constructionbaseinfodetail cascade;
 
 create table constructionbaseinfodetail (
@@ -630,10 +603,6 @@
 ) 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 constructionledgerdetail (
@@ -676,8 +645,6 @@
   on constructionledgerdetail(SourceCode);
 
 -- 工事詳細台帳実行データ
-drop index LedgerExcute_Index1 on constructionledgerexcute;
-
 drop table if exists constructionledgerexcute cascade;
 
 create table constructionledgerexcute (
@@ -696,10 +663,6 @@
   on constructionledgerexcute(ConstructionCode,TargetMonth,GroupCount,LineCount);
 
 -- 工事リンク情報
-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 constructionlink (
@@ -749,8 +712,6 @@
 ) comment '案件進捗日付データ' ;
 
 -- 作業マスタ
-drop index ConstructionSpecMaster_Index1 on constructionspecmaster;
-
 drop table if exists constructionspecmaster cascade;
 
 create table constructionspecmaster (
@@ -801,9 +762,6 @@
 ) comment '工事種別マスタ' ;
 
 -- 担当者毎経費データ
-drop index CostDataOfPerson_Index1 on costdataofperson;
-drop index CostDataOfPerson_Index2 on costdataofperson;
-
 drop table if exists costdataofperson cascade;
 
 create table costdataofperson (
@@ -834,8 +792,6 @@
   on costdataofperson(ConstructionCode);
 
 -- 発注者登録申請データ
-drop index CostomerRegist_Index1 on costomerregist;
-
 drop table if exists costomerregist cascade;
 
 create table costomerregist (
@@ -873,10 +829,6 @@
   on costomerregist(PetitionPeriod);
 
 -- 日報データ
-drop index DailyDataConstruction_Index1 on dailydataconstruction;
-drop index DailyDataConstruction_Index2 on dailydataconstruction;
-drop index DailyDataConstruction_Index3 on dailydataconstruction;
-
 drop table if exists dailydataconstruction cascade;
 
 create table dailydataconstruction (
@@ -899,8 +851,6 @@
   on dailydataconstruction(ConstructionCode);
 
 -- 日報データ (明細)
-drop index DailyDataDetail_Index on dailydatadetail;
-
 drop table if exists dailydatadetail cascade;
 
 create table dailydatadetail (
@@ -924,8 +874,6 @@
   on dailydatadetail(PersonCode,DailyDataDate,ConstructionCode);
 
 -- 日報データ (現場巡回)
-drop index DailyDataField_Index on dailydatafield;
-
 drop table if exists dailydatafield cascade;
 
 create table dailydatafield (
@@ -944,8 +892,6 @@
   on dailydatafield(PersonCode,DailyDataDate,ConstructionCode);
 
 -- 日報データ (資材)
-drop index DailyDataMaterials_Index on dailydatamaterials;
-
 drop table if exists dailydatamaterials cascade;
 
 create table dailydatamaterials (
@@ -967,8 +913,6 @@
   on dailydatamaterials(PersonCode,DailyDataDate,ConstructionCode);
 
 -- 日報データ (協力業者指示)
-drop index DailyDataSubcontractors_Index on dailydatasubcontractors;
-
 drop table if exists dailydatasubcontractors cascade;
 
 create table dailydatasubcontractors (
@@ -987,8 +931,6 @@
   on dailydatasubcontractors(PersonCode,DailyDataDate,ConstructionCode);
 
 -- 日報データ (車両)
-drop index DailyDataVehicles_Index on dailydatavehicles;
-
 drop table if exists dailydatavehicles cascade;
 
 create table dailydatavehicles (
@@ -1011,8 +953,6 @@
   on dailydatavehicles(PersonCode,DailyDataDate,ConstructionCode);
 
 -- 日マスタ
-drop index day_Index1 on daymaster;
-
 drop table if exists daymaster cascade;
 
 create table daymaster (
@@ -1052,8 +992,6 @@
 ) comment '部署経費率マスタ' ;
 
 -- 部署マスタ
-drop index DepartmentMaster_index1 on departmentmaster;
-
 drop table if exists departmentmaster cascade;
 
 create table departmentmaster (
@@ -1098,12 +1036,12 @@
   , 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 '入金担当者コード'
+  , DEPOSITPERSONCODE decimal(8,0) not null comment '入金担当者コード'
   , NOTE varchar(120) comment '備考'
   , ENTRYDATE datetime comment '登録日付'
   , UPDATEDATE datetime comment '更新日付'
@@ -1188,8 +1126,6 @@
 ) comment '積算予算内訳データ明細' ;
 
 -- 積算見積データ
-drop index EstimateData_Index1 on estimatedata;
-
 drop table if exists estimatedata cascade;
 
 create table estimatedata (
@@ -1212,8 +1148,6 @@
   on estimatedata(ConstructionCode,FixedItemCode);
 
 -- 積算見積ページデータ
-drop index EstimateDataBody_Index1 on estimatedatabody;
-
 drop table if exists estimatedatabody cascade;
 
 create table estimatedatabody (
@@ -1235,8 +1169,6 @@
   on estimatedatabody(ConstructionCode,ComponentCode,ItemCode);
 
 -- 積算見積データ明細
-drop index EstimateDataDetail_Index1 on estimatedatadetail;
-
 drop table if exists estimatedatadetail cascade;
 
 create table estimatedatadetail (
@@ -1280,10 +1212,6 @@
 ) 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 (
@@ -1304,8 +1232,6 @@
   on holidaycalendermaster(TargetDay);
 
 -- 入力時検索履歴
-drop index InputSearchLogData_Index1 on inputsearchlogdata;
-
 drop table if exists inputsearchlogdata cascade;
 
 create table inputsearchlogdata (
@@ -1407,9 +1333,6 @@
 ) comment '資材履歴情報' ;
 
 -- 掲示板メッセージ
-drop index MessageBoardData_Index1 on messageboarddata;
-drop index MessageBoardData_Index2 on messageboarddata;
-
 drop table if exists messageboarddata cascade;
 
 create table messageboarddata (
@@ -1440,8 +1363,6 @@
   on messageboarddata(MessageFlag);
 
 -- 掲示板対象者テーブル
-drop index MessageBoardTerget_Index1 on messageboardterget;
-
 drop table if exists messageboardterget cascade;
 
 create table messageboardterget (
@@ -1473,8 +1394,6 @@
 ) comment '掲示板メッセージ閲覧履歴' ;
 
 -- 月マスタ
-drop index month_Index1 on monthmaster;
-
 drop table if exists monthmaster cascade;
 
 create table monthmaster (
@@ -1610,9 +1529,6 @@
 ) comment '担当者承認コメントデータ' ;
 
 -- 担当者対象部署マスタ
-drop index PersonDepartmentMaster_Index1 on persondepartmentmaster;
-drop index PersonDepartmentMaster_Index2 on persondepartmentmaster;
-
 drop table if exists persondepartmentmaster cascade;
 
 create table persondepartmentmaster (
@@ -1631,9 +1547,6 @@
   on persondepartmentmaster(DepartmentCode);
 
 -- 担当者マスタ
-drop index PersonInChargeMaster_Index1 on personinchargemaster;
-drop index PersonInChargeMaster_Index2 on personinchargemaster;
-
 drop table if exists personinchargemaster cascade;
 
 create table personinchargemaster (
@@ -1669,9 +1582,6 @@
   on personinchargemaster(DepartmentCode);
 
 -- 担当者給与マスタ
-drop index PersonSalaryMaster_Index1 on personsalarymaster;
-drop index PersonSalaryMaster_Index2 on personsalarymaster;
-
 drop table if exists personsalarymaster cascade;
 
 create table personsalarymaster (
@@ -1822,9 +1732,6 @@
 ) comment '承認明細データ' ;
 
 -- 起動対象マスタ
-drop index ProcessExcuteMaster_Index1 on processexcutemaster;
-drop index ProcessExcuteMaster_Index2 on processexcutemaster;
-
 drop table if exists processexcutemaster cascade;
 
 create table processexcutemaster (
@@ -1894,8 +1801,6 @@
 ) comment '注文書日付データ' ;
 
 -- 注文書明細データ
-drop index POrderDetail_Index1 on purchaseorderdetail;
-
 drop table if exists purchaseorderdetail cascade;
 
 create table purchaseorderdetail (
@@ -1995,14 +1900,11 @@
   , InvoiceNo decimal(9,0) not null comment '請求書No'
   , SendDate date not null comment '請求書発給郵送日'
   , EntryDate datetime not null comment '登録日付'
-  , UpdateDate datetime not null comment '更新日付',
-	PRIMARY KEY (ConstructionCode, InvoiceNo)
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint requestorderdate_PKC primary key (ConstructionCode,InvoiceNo)
 ) comment '請求書日付データ' ;
 
 -- 売上グラフデータ
-drop index SalesGraphData_Idx1 on salesgraphdata;
-drop index SalesGraphData_idx2 on salesgraphdata;
-
 drop table if exists salesgraphdata cascade;
 
 create table salesgraphdata (
@@ -2027,10 +1929,6 @@
   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 (
@@ -2055,6 +1953,37 @@
 create index SecurityMaster_Index3
   on securitymaster(SecRange);
 
+-- 安全パトロールデータ
+drop table if exists sfpdata cascade;
+
+create table sfpdata (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , DataCount decimal(2,0) unsigned not null comment 'パトロール回数'
+  , RequestDate datetime not null comment 'パトロール要請日時'
+  , PersonCode decimal(8,0) unsigned not null comment '申請者コード'
+  , StringValue varchar(300) comment 'コメント'
+  , OrderNo decimal(2,0) unsigned not null comment '申請受付番号'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint sfpdata_PKC primary key (ConstructionCode,DataCount)
+) comment '安全パトロールデータ' ;
+
+create index SFPData_Index1
+  on sfpdata(RequestDate);
+
+-- 安全パトロール明細データ
+drop table if exists sfpdatadetail cascade;
+
+create table sfpdatadetail (
+  ConstructionCode decimal(10,0) unsigned not null comment '工事コード'
+  , DataCount decimal(2,0) unsigned not null comment 'パトロール回数'
+  , SeqNo decimal(2,0) unsigned not null comment 'データ枝番'
+  , CompanyCode decimal(8,0) unsigned not null comment '協力会社コード'
+  , EntryDate datetime not null comment '登録日付'
+  , UpdateDate datetime not null comment '更新日付'
+  , constraint sfpdatadetail_PKC primary key (ConstructionCode,DataCount,SeqNo)
+) comment '安全パトロール明細データ' ;
+
 -- 協力業者施工工種登録申請データ
 drop table if exists subconstrjobitemregist cascade;
 
@@ -2145,9 +2074,6 @@
 ) comment '協力会社職種マスタ' ;
 
 -- 協力会社施工工種データ
-drop index SubContractorJobItem_Index1 on subcontractorjobitem;
-drop index SubContractorJobItem_Index2 on subcontractorjobitem;
-
 drop table if exists subcontractorjobitem cascade;
 
 create table subcontractorjobitem (
@@ -2166,9 +2092,6 @@
   on subcontractorjobitem(ItemCode);
 
 -- 協力会社職種リンクマスタ
-drop index SubContractorJobLink_Index1 on subcontractorjoblink;
-drop index SubContractorJobLink_Index2 on subcontractorjoblink;
-
 drop table if exists subcontractorjoblink cascade;
 
 create table subcontractorjoblink (
@@ -2187,8 +2110,6 @@
   on subcontractorjoblink(JobCategoryCode);
 
 -- 協力会社マスタ
-drop index SubContractorMaster_Index1 on subcontractormaster;
-
 drop table if exists subcontractormaster cascade;
 
 create table subcontractormaster (
@@ -2277,8 +2198,8 @@
   , ConsumptionTax decimal(4,2) not null comment '消費税'
   , CooperationRate decimal(4,2) not null comment '協力金比率'
   , StatutoryWelfareRate decimal(4,2) not null comment '法定福利費比率'
-  , FuelPrice decimal(5,2) NOT NULL COMMENT '燃料キロ単価'
-  , AreaDistance decimal(5,2) NOT NULL COMMENT '資材置場移動距離'
+  , FuelPrice decimal(5,2) not null comment '燃料キロ単価'
+  , AreaDistance decimal(5,2) not null comment '資材置場移動距離'
   , ExcelSavePath varchar(120) comment 'Excel保存パス'
   , BusinessPeriod smallint(6) not null comment '現在営業期数'
   , ConstructionYear smallint(6) not null comment '現在工事年度'
@@ -2294,8 +2215,6 @@
 ) comment '管理マスタ' ;
 
 -- 期限マスタ
-drop index TermMaster_Index1 on termmaster;
-
 drop table if exists termmaster cascade;
 
 create table termmaster (
@@ -2318,8 +2237,6 @@
   on termmaster(DisplayOrder);
 
 -- 出勤交通費データ
-drop index TranceportDailyData_Index1 on tranceportdailydata;
-
 drop table if exists tranceportdailydata cascade;
 
 create table tranceportdailydata (
@@ -2356,8 +2273,6 @@
 ) comment '工事種別経費率マスタ' ;
 
 -- 単位マスタ
-drop index UnitMaster_Index1 on unitmaster;
-
 drop table if exists unitmaster cascade;
 
 create table unitmaster (
@@ -2418,10 +2333,6 @@
 ) 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 (
@@ -2447,8 +2358,6 @@
   on vehiclescheduledata(TargetDay);
 
 -- 年マスタ
-drop index year_Index1 on yearmaster;
-
 drop table if exists yearmaster cascade;
 
 create table yearmaster (
