プロジェクト

全般

プロフィール

統計
| リビジョン:

h-you / branches / ddl / ProcessManagement.sql @ 324

履歴 | 表示 | アノテート | ダウンロード (108 KB)

1
-- Project Name : noname
2
-- Date/Time    : 2018/03/01 9:30:55
3
-- Author       : Horiuchi
4
-- RDBMS Type   : MySQL
5
-- Application  : A5:SQL Mk-2
6

    
7
-- ?S????s???\??f?[?^
8
drop table actionscheduledata cascade;
9

    
10
create table actionscheduledata (
11
  TargetDate date not null comment '????'
12
  , PersonCode decimal(8,0) not null comment '?S????R?[?h'
13
  , ActionSchedule varchar(30) comment '?s???\??'
14
  , TargetYear year(4) not null comment '?Y???N'
15
  , TargetMonth year(4) not null comment '?Y????'
16
  , TargetDay year(4) not null comment '?Y????'
17
  , EntryDate datetime not null comment '?o?^???t'
18
  , UpdateDate datetime not null comment '?X?V???t'
19
  , constraint actionscheduledata_PKC primary key (TargetDate,PersonCode)
20
) comment '?S????s???\??f?[?^' ;
21

    
22
create index ActionScheduleData_Index1
23
  on actionscheduledata(TargetYear);
24

    
25
create index ActionScheduleData_Index2
26
  on actionscheduledata(TargetMonth);
27

    
28
create index ActionScheduleData_Index3
29
  on actionscheduledata(TargetDay);
30

    
31
-- ???F?o?H?}?X?^
32
drop table approvalmaster cascade;
33

    
34
create table approvalmaster (
35
  ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
36
  , DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
37
  , SeqNo decimal(2,0) not null comment '?}??'
38
  , DisplayOrder decimal(2,0) not null comment '?\????'
39
  , ApprovalPerson decimal(8,0) unsigned not null comment '???F??R?[?h'
40
  , ApprovalAuthority decimal(1,0) not null comment '???F??????'
41
  , EntryDate datetime not null comment '?o?^???t'
42
  , UpdateDate datetime not null comment '?X?V???t'
43
  , constraint approvalmaster_PKC primary key (ApprovalCode,DepartmentCode,SeqNo)
44
) comment '???F?o?H?}?X?^' ;
45

    
46
-- ?o?????f?[?^
47
drop table attendancedailydata cascade;
48

    
49
create table attendancedailydata (
50
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
51
  , AttendanceDate date not null comment '???????'
52
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
53
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
54
  , ActionResult varchar(30) not null comment '?s??????'
55
  , StartTime datetime comment '?J?n????'
56
  , CompTime datetime comment '?I??????'
57
  , DayTimes decimal(4,1) not null comment '????????v????'
58
  , WorkingComment varchar(120) comment '?R?????g'
59
  , NightFlg decimal(1,0) not null comment '?????t???O'
60
  , EntryDate datetime not null comment '?o?^???t'
61
  , UpdateDate datetime not null comment '?X?V???t'
62
  , constraint attendancedailydata_PKC primary key (PersonCode,AttendanceDate,SeqNo)
63
) comment '?o?????f?[?^' ;
64

    
65
create index AttendDaily_Index1
66
  on attendancedailydata(ConstructionCode);
67

    
68
create index AttendDaily_Index2
69
  on attendancedailydata(AttendanceDate);
70

    
71
-- ?o?????f?[?^
72
drop table attendancedata cascade;
73

    
74
create table attendancedata (
75
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
76
  , AttendanceMonth date not null comment '?o?????N??'
77
  , LastDays decimal(2,0) unsigned not null comment '??????I??'
78
  , AttendDayCount decimal(2,0) unsigned not null comment '?o?????'
79
  , TotalOverTimes decimal(4,1) not null comment '?c??????'
80
  , OrderDate date not null comment '?\????'
81
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
82
  , EntryDate datetime not null comment '?o?^???t'
83
  , UpdateDate datetime not null comment '?X?V???t'
84
  , constraint attendancedata_PKC primary key (PersonCode,AttendanceMonth)
85
) comment '?o?????f?[?^' ;
86

    
87
-- ??s?c????}?X?^
88
drop table bankbusinessdaymaster cascade;
89

    
90
create table bankbusinessdaymaster (
91
  YEARMONTH decimal(6,0) default '0' not null comment '?N??'
92
  , BANKBUSINESSDAY decimal(2,0) default '0' not null comment '??s?c???'
93
  , NOTE varchar(120) comment '???l'
94
  , DELETEFLG decimal(1,0) comment '???t???O'
95
  , ENTRYDATE datetime comment '?o?^?N????'
96
  , UPDATEDATE datetime comment '?X?V?N????'
97
  , constraint bankbusinessdaymaster_PKC primary key (YEARMONTH,BANKBUSINESSDAY)
98
) comment '??s?c????}?X?^' ;
99

    
100
-- ???????f?[?^
101
drop table billingdata cascade;
102

    
103
create table billingdata (
104
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
105
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
106
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
107
  , BILLPRICE decimal(10,0) comment '???????z'
108
  , ENTRYDATE datetime comment '?o?^?N????'
109
  , UPDATEDATE datetime comment '?X?V?N????'
110
  , constraint billingdata_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO)
111
) comment '???????f?[?^' ;
112

    
113
-- ??????????f?[?^
114
drop table billingdatadetail cascade;
115

    
116
create table billingdatadetail (
117
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
118
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
119
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
120
  , LINECOUNT decimal(3,0) default '0' not null comment '?s???'
121
  , CONSTRUCTIONCODE decimal(10,0) comment '?H?????'
122
  , CONSTRUCTIONROWCNT decimal(3,0) default '0' not null comment '?s???'
123
  , CONSTRUCTIONCOLCNT decimal(3,0) default '0' not null comment '????'
124
  , FIELDNAME varchar(120) comment '????'
125
  , BILLPRICE decimal(10,0) comment '???????z'
126
  , HIGHWPRICE decimal(10,0) comment '??????'
127
  , HARDWPRICE decimal(10,0) comment '??????'
128
  , INDSWASTETAX decimal(10,0) comment '?Y?p??'
129
  , NOTE varchar(120) comment '???l'
130
  , ENTRYDATE datetime comment '?o?^?N????'
131
  , UPDATEDATE datetime comment '?X?V?N????'
132
  , constraint billingdatadetail_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT)
133
) comment '??????????f?[?^' ;
134

    
135
-- ???????x???T?}???[?f?[?^
136
drop table billingpaymentsummary cascade;
137

    
138
create table billingpaymentsummary (
139
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
140
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
141
  , CHARGEPAYMENTKIND decimal(1,0) default '0' not null comment '?????x????'
142
  , PAYDAY date comment '?x????'
143
  , BILLPRICESTOTAL decimal(10,0) comment '???????z???v'
144
  , CONSUMPTIONTAXRATE decimal(6,3) comment '??????'
145
  , CONSUMPTIONTAXPRICE decimal(10,0) comment '?????z'
146
  , HIGHWPRICESTOTAL decimal(10,0) comment '???????v'
147
  , HARDWPRICESTOTAL decimal(10,0) comment '???????v'
148
  , INDSWASTETAXSTOTAL decimal(10,0) comment '?Y?p????v'
149
  , CNSTRPRICERATE decimal(6,3) comment '???????'
150
  , CNSTRPRICESTOTAL decimal(10,0) comment '????????v'
151
  , BILLINGPRICETOTAL decimal(10,0) comment '???????z???v'
152
  , ENTRYDATE datetime comment '?o?^?N????'
153
  , UPDATEDATE datetime comment '?X?V?N????'
154
  , constraint billingpaymentsummary_PKC primary key (COMPANYCODE,TARGETDATE,CHARGEPAYMENTKIND)
155
) comment '???????x???T?}???[?f?[?^' ;
156

    
157
-- ?^?c?????????
158
drop table bizperiodhistory cascade;
159

    
160
create table bizperiodhistory (
161
  PeriodYear smallint(6) not null comment '?c??????E?H???N?x'
162
  , PeriodFlag smallint(1) not null comment '?c??????E?H???N?x?t???O'
163
  , BeginDate datetime not null comment '?????'
164
  , CompleteDate datetime not null comment '??????'
165
  , EntryDate datetime not null comment '?o?^???t'
166
  , UpdateDate datetime not null comment '?X?V???t'
167
  , constraint bizperiodhistory_PKC primary key (PeriodYear,PeriodFlag)
168
) comment '?^?c?????????' ;
169

    
170
-- ?H???????f?[?^?y???p?z
171
drop table bk_constructionledger cascade;
172

    
173
create table bk_constructionledger (
174
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
175
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
176
  , CreatorCode decimal(8,0) comment '????R?[?h'
177
  , CreatorName varchar(60) comment '?????'
178
  , CreateDate date not null comment '????'
179
  , ConstructionTimes decimal(5,2) not null comment '?H???i?P??E???j'
180
  , ConstructionStart date not null comment '?_??H???J?n'
181
  , ConstructionEnd date not null comment '?_??H??????'
182
  , OrdersDecisionPrice decimal(14,0) not null comment '??????????z'
183
  , CompanyExpenses decimal(10,0) not null comment '???o???v'
184
  , DepartmentExpenses decimal(10,0) not null comment '?????o???v'
185
  , SalesExpenses decimal(10,0) not null comment '?c??o???v'
186
  , TotalPayment decimal(10,0) not null comment '???x???z'
187
  , GrossProfit decimal(10,0) not null comment '?e??'
188
  , Allowance decimal(10,0) not null comment '???^'
189
  , NetProfit decimal(10,0) not null comment '?????v'
190
  , ComplateFlg decimal(1,0) not null comment '????????t???O'
191
  , IntegrationFlg decimal(1,0) not null comment '????z??Z?t???O'
192
  , EntryDate datetime not null comment '?o?^???t'
193
  , UpdateDate datetime not null comment '?X?V???t'
194
  , constraint bk_constructionledger_PKC primary key (ConstructionCode)
195
) comment '?H???????f?[?^?y???p?z' ;
196

    
197
-- ?H??????????f?[?^?y???p?z
198
drop table bk_constructionledgerdetail cascade;
199

    
200
create table bk_constructionledgerdetail (
201
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
202
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
203
  , LineCount decimal(5,0) unsigned not null comment '?s???'
204
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
205
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
206
  , FirstString varchar(120) comment '???????'
207
  , SecondString varchar(120) comment '?H?????e'
208
  , CompanyType decimal(1,0) not null comment '??????R?[?h?^?C?v'
209
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
210
  , CompanyName varchar(120) comment '?????????'
211
  , EstimatePrice decimal(12,0) not null comment '?\?Z?i????j???z'
212
  , ExecutionAmount decimal(12,0) not null comment '???s???z'
213
  , AmountConfigRate decimal(5,2) not null comment '???z?\????'
214
  , PaymentBurden decimal(12,0) not null comment '?x????U?z'
215
  , FixDataFlg decimal(1,0) not null comment '???f?[?^?t???O'
216
  , IndependentFlg decimal(1,0) not null comment '????f?[?^?t???O'
217
  , FluctuationFlg decimal(1,0) not null comment '?????f?[?^?t???O'
218
  , SalaryFlg decimal(1,0) not null comment '???^?U????'
219
  , SalaryDays decimal(4,0) not null comment '???^?U??????'
220
  , OperatingFlg decimal(1,0) not null comment '?S?????t???O'
221
  , SourceCode decimal(10,0) unsigned not null comment '???H?????'
222
  , JoinTitleFlg decimal(1,0) not null comment '?H??????^?C?g??'
223
  , SalaryOnRegist decimal(12,0) not null comment '?o?^?????z???^'
224
  , PurchaseOrderFlg decimal(2,0) not null comment '?????????s?t???O'
225
  , EntryDate datetime not null comment '?o?^???t'
226
  , UpdateDate datetime not null comment '?X?V???t'
227
  , constraint bk_constructionledgerdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
228
) comment '?H??????????f?[?^?y???p?z' ;
229

    
230
-- ?H?????????s?f?[?^?y???p?z
231
drop table bk_constructionledgerexcute cascade;
232

    
233
create table bk_constructionledgerexcute (
234
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
235
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
236
  , LineCount decimal(5,0) unsigned not null comment '?s???'
237
  , ColumnCount decimal(3,0) not null comment '????'
238
  , PaymentAmount decimal(12,0) not null comment '?x?????z'
239
  , TargetMonth date not null comment '???N??'
240
  , EntryDate datetime not null comment '?o?^???t'
241
  , UpdateDate datetime not null comment '?X?V???t'
242
  , constraint bk_constructionledgerexcute_PKC primary key (ConstructionCode,GroupCount,LineCount,ColumnCount)
243
) comment '?H?????????s?f?[?^?y???p?z' ;
244

    
245
-- ??Z????f?[?^?y???p?z
246
drop table bk_estimatedata cascade;
247

    
248
create table bk_estimatedata (
249
  SaveDate datetime not null comment '?????t'
250
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
251
  , LineCount decimal(3,0) unsigned not null comment '?s???'
252
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
253
  , FixedItemCode varchar(1) comment '?????L?['
254
  , ItemName varchar(120) comment '??????'
255
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
256
  , PriceValue decimal(14,0) not null comment '???z'
257
  , note varchar(60) comment '???l'
258
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
259
  , InputFlg decimal(1,0) not null comment '????t???O'
260
  , EntryDate datetime not null comment '?o?^???t'
261
  , UpdateDate datetime not null comment '?X?V???t'
262
  , constraint bk_estimatedata_PKC primary key (SaveDate,ConstructionCode,LineCount)
263
) comment '??Z????f?[?^?y???p?z' ;
264

    
265
-- ??Z????y?[?W?f?[?^?y???p?z
266
drop table bk_estimatedatabody cascade;
267

    
268
create table bk_estimatedatabody (
269
  SaveDate datetime not null comment '?????t'
270
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
271
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
272
  , Category decimal(1,0) not null comment '?y?[?W??'
273
  , UnionComponentCode decimal(5,0) unsigned not null comment '?????\???L?['
274
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
275
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
276
  , SelectComponent decimal(5,0) unsigned not null comment '?I???\???L?['
277
  , PageTitle varchar(120) not null comment '?y?[?W?\????'
278
  , DetailLineCount decimal(3,0) unsigned not null comment '????s???'
279
  , EntryDate datetime not null comment '?o?^???t'
280
  , UpdateDate datetime not null comment '?X?V???t'
281
  , constraint bk_estimatedatabody_PKC primary key (SaveDate,ConstructionCode,PageCount)
282
) comment '??Z????y?[?W?f?[?^?y???p?z' ;
283

    
284
-- ??Z????f?[?^????y???p?z
285
drop table bk_estimatedatadetail cascade;
286

    
287
create table bk_estimatedatadetail (
288
  SaveDate datetime not null comment '?????t'
289
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
290
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
291
  , LineCount decimal(3,0) unsigned not null comment '?s???'
292
  , DataType decimal(1,0) not null comment '?f?[?^???'
293
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
294
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
295
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
296
  , ItemName varchar(120) comment '??????'
297
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
298
  , Unitcount decimal(8,2) not null comment '????'
299
  , UnitName varchar(30) comment '?P?????'
300
  , UnitPrice decimal(9,2) not null comment '?P??'
301
  , LineTotal decimal(12,0) not null comment '???z'
302
  , note varchar(60) comment '???l'
303
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
304
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
305
  , InputFlg decimal(1,0) comment '????t???O'
306
  , EntryDate datetime not null comment '?o?^???t'
307
  , UpdateDate datetime not null comment '?X?V???t'
308
  , constraint bk_estimatedatadetail_PKC primary key (SaveDate,ConstructionCode,PageCount,LineCount)
309
) comment '??Z????f?[?^????y???p?z' ;
310

    
311
-- ?@?l?i?}?X?^
312
drop table businesstypemaster cascade;
313

    
314
create table businesstypemaster (
315
  BusinessTypeCode decimal(5,0) unsigned not null comment '?@?l?i?R?[?h'
316
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
317
  , BusinessTypeName varchar(100) not null comment '???'
318
  , EntryDate datetime not null comment '?o?^???t'
319
  , UpdateDate datetime not null comment '?X?V???t'
320
  , constraint businesstypemaster_PKC primary key (BusinessTypeCode)
321
) comment '?@?l?i?}?X?^' ;
322

    
323
create index BusinessTypeMaster_Index1
324
  on businesstypemaster(DisplayOrder);
325

    
326
-- ????????}?X?^
327
drop table commoncostlarge cascade;
328

    
329
create table commoncostlarge (
330
  LargeCode decimal(5,0) unsigned not null comment '????L?['
331
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
332
  , LargeName varchar(50) not null comment '???????'
333
  , CommentText varchar(120) comment '????????'
334
  , DeleteFlg decimal(1,0) not null comment '???t???O'
335
  , EntryDate datetime not null comment '?o?^???t'
336
  , UpdateDate datetime not null comment '?X?V???t'
337
  , constraint commoncostlarge_PKC primary key (LargeCode)
338
) comment '????????}?X?^' ;
339

    
340
-- ?????H???A?}?X?^
341
drop table commoncostlinkms cascade;
342

    
343
create table commoncostlinkms (
344
  LargeCode decimal(5,0) unsigned not null comment '????L?['
345
  , MiddleCode decimal(5,0) unsigned not null comment '??????L?['
346
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
347
  , EntryDate datetime comment '?o?^???t'
348
  , UpdateDate datetime comment '?X?V???t'
349
  , constraint commoncostlinkms_PKC primary key (LargeCode,MiddleCode,ItemCode)
350
) comment '?????H???A?}?X?^' ;
351

    
352
-- ?????????}?X?^
353
drop table commoncostmiddle cascade;
354

    
355
create table commoncostmiddle (
356
  LargeCode decimal(5,0) unsigned not null comment '????L?['
357
  , MiddleCode decimal(5,0) unsigned not null comment '??????L?['
358
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
359
  , MiddleName varchar(50) not null comment '?????????'
360
  , CommentText varchar(120) comment '????????'
361
  , DeleteFlg decimal(1,0) not null comment '???t???O'
362
  , EntryDate datetime not null comment '?o?^???t'
363
  , UpdateDate datetime not null comment '?X?V???t'
364
  , constraint commoncostmiddle_PKC primary key (LargeCode,MiddleCode)
365
) comment '?????????}?X?^' ;
366

    
367
-- ?????????L?[?}?X?^
368
drop table commoncostmiddlesearchword cascade;
369

    
370
create table commoncostmiddlesearchword (
371
  LargeCode decimal(5,0) unsigned not null comment '????L?['
372
  , MiddleCode decimal(5,0) unsigned not null comment '??????L?['
373
  , SeqNo decimal(5,0) unsigned not null comment '????'
374
  , SearchWord varchar(50) not null comment '????????'
375
  , EntryDate datetime not null comment '?o?^???t'
376
  , UpdateDate datetime not null comment '?X?V???t'
377
  , constraint commoncostmiddlesearchword_PKC primary key (LargeCode,MiddleCode,SeqNo)
378
) comment '?????????L?[?}?X?^' ;
379

    
380
-- ?\???H???A?}?X?^
381
drop table componentlinkmaster cascade;
382

    
383
create table componentlinkmaster (
384
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
385
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
386
  , DisplayOrder decimal(5,0) unsigned comment '?\????'
387
  , EntryDate datetime not null comment '?o?^???t'
388
  , UpdateDate datetime not null comment '?X?V???t'
389
  , constraint componentlinkmaster_PKC primary key (ComponentCode,ItemCode)
390
) comment '?\???H???A?}?X?^' ;
391

    
392
create index ComponentLinkMaster_Index1
393
  on componentlinkmaster(ComponentCode);
394

    
395
create index ComponentLinkMaster_Index2
396
  on componentlinkmaster(ItemCode);
397

    
398
-- ?\???}?X?^
399
drop table componentmaster cascade;
400

    
401
create table componentmaster (
402
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
403
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
404
  , ComponentName varchar(120) not null comment '?\??????'
405
  , SubItemsFlg decimal(1,0) comment '???????t???O'
406
  , DirectInputFlg decimal(1,0) comment '???????t???O'
407
  , MyExpensesFlg decimal(1,0) comment '????o??t???O'
408
  , DeleteFlg decimal(1,0) not null comment '???t???O'
409
  , EntryDate datetime not null comment '?o?^???t'
410
  , UpdateDate datetime not null comment '?X?V???t'
411
  , constraint componentmaster_PKC primary key (ComponentCode)
412
) comment '?\???}?X?^' ;
413

    
414
create index ComponentMaster_Index1
415
  on componentmaster(DisplayOrder);
416

    
417
-- ?\???H??????A?}?X?^
418
drop table componenttotypemaster cascade;
419

    
420
create table componenttotypemaster (
421
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
422
  , TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
423
  , Dummy decimal(1,0) not null comment '?_?~?[????'
424
  , EntryDate datetime not null comment '?o?^???t'
425
  , UpdateDate datetime not null comment '?X?V???t'
426
  , constraint componenttotypemaster_PKC primary key (ComponentCode,TypeCode)
427
) comment '?\???H??????A?}?X?^' ;
428

    
429
create index ComponentToTypeMaster_Index1
430
  on componenttotypemaster(ComponentCode);
431

    
432
create index ComponentToTypeMaster_Index2
433
  on componenttotypemaster(TypeCode);
434

    
435
-- ?H????{???
436
drop table constructionbaseinfo cascade;
437

    
438
create table constructionbaseinfo (
439
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
440
  , TyingFlg decimal(1,0) not null comment '?R?t?f?[?^?t???O'
441
  , JoinFlg decimal(1,0) not null comment '?????_??H???t???O'
442
  , ConstructionYear smallint(5) unsigned not null comment '?H???N?x'
443
  , ConstructionPeriod smallint(5) unsigned not null comment '?H??????'
444
  , RequestedDate date comment '??????'
445
  , EstimatesSubmitDeadline date comment '?????o????'
446
  , EstimatesSubmittedDate date comment '?????o??'
447
  , ProvisionalOrderDate date comment '?????'
448
  , OrderDate date comment '???'
449
  , OrderStartingDate date comment '?J?n?\???'
450
  , OrderCompletionDate date comment '?????\???'
451
  , PreparationStartDate date comment '?{?H?????J?n??'
452
  , ConstructionStartingDate date comment '?{?H?J?n??'
453
  , ConstructionCompletionDate date comment '?{?H??????'
454
  , NonOrderDate date comment '????'
455
  , OrdersDecisionPrice decimal(12,0) not null comment '??????????z'
456
  , OrdersDecisionPriceInTax decimal(12,0) not null comment '??????????z'
457
  , SalesPersonCode decimal(8,0) comment '?c??S?????'
458
  , ConstructionPersonCode decimal(8,0) not null comment '?H???S????'
459
  , ConstrSubPersonCode decimal(8,0) not null comment '?H?????S????'
460
  , ConstructionInstructor decimal(8,0) not null comment '?H???w????'
461
  , TransferConstruction decimal(8,0) not null comment '?H??????R?[?h'
462
  , TransferConstructionDate date comment '?H??????'
463
  , OrderersDivision decimal(5,0) not null comment '???????'
464
  , OrderersCode decimal(5,0) unsigned not null comment '??????R?[?h'
465
  , EstimatesExpirationDate date comment '????L??????'
466
  , ConstructionPeriodStart date comment '?_??H???J?n??'
467
  , ConstructionPeriodEnd date comment '?_??H??????'
468
  , ConstructionPeriodStart2 date comment '?_??H???J?n?i???????j'
469
  , ConstructionPeriodEnd2 date comment '?_??H???????i???????j'
470
  , StartDate date comment '?H???J?n??'
471
  , EndDate date comment '?H???I????'
472
  , PurchaseOrderMailingDate date comment '???????X????'
473
  , PurchaseOrderReturnDate date comment '???????????'
474
  , PurchaseOrderReturnCheckDate date comment '??????????m?F??'
475
  , ConsumptionTaxFlg decimal(1,0) not null comment '?????t???O'
476
  , PrimeContractorFlg decimal(1,0) not null comment '?????t???O'
477
  , SalesCostFlg decimal(1,0) not null comment '?c??o?????t???O'
478
  , ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
479
  , ConstructionType decimal(5,0) not null comment '?H?????R?[?h'
480
  , EstimateType decimal(1,0) not null comment '??????'
481
  , BillingStartDate date not null comment '?????????J?n??'
482
  , BillingDate date not null comment '??????'
483
  , BillingSplitFlg decimal(1,0) not null comment '??????t???O'
484
  , BillingSendDate date comment '???????X??/??n????'
485
  , LedgerComplateDate date not null comment '?H????????????????t'
486
  , InspectPlanningDate date not null comment '?????\???'
487
  , InspectExecuteDate date not null comment '???????s??'
488
  , RevCompleteDate date not null comment '??????????????'
489
  , EntryDate datetime not null comment '?o?^???t'
490
  , UpdateDate datetime not null comment '?X?V???t'
491
  , constraint constructionbaseinfo_PKC primary key (ConstructionCode)
492
) comment '?H????{???' ;
493

    
494
create index BaseInfo_Index1
495
  on constructionbaseinfo(ConstructionStatusFlg);
496

    
497
create index BaseInfo_Index2
498
  on constructionbaseinfo(EstimateType);
499

    
500
create index BaseInfo_Index3
501
  on constructionbaseinfo(SalesPersonCode);
502

    
503
create index BaseInfo_Index4
504
  on constructionbaseinfo(ConstructionPersonCode);
505

    
506
create index BaseInfo_Index5
507
  on constructionbaseinfo(ConstructionInstructor);
508

    
509
create index BaseInfo_Index6
510
  on constructionbaseinfo(ConstructionPeriod);
511

    
512
-- ?H????{????
513
drop table constructionbaseinfodetail cascade;
514

    
515
create table constructionbaseinfodetail (
516
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
517
  , DetailNo decimal(2,0) not null comment '??????'
518
  , DetailString varchar(300) comment '??????e'
519
  , EntryDate datetime not null comment '?o?^???t'
520
  , UpdateDate datetime not null comment '?X?V???t'
521
  , constraint constructionbaseinfodetail_PKC primary key (ConstructionCode,DetailNo)
522
) comment '?H????{????' ;
523

    
524
create index BaseInfoDetail_Idx1
525
  on constructionbaseinfodetail(ConstructionCode);
526

    
527
create index BaseInfoDetail_Idx2
528
  on constructionbaseinfodetail(DetailNo);
529

    
530
-- ?H???{?H?\?Z?f?[?^
531
drop table constructionbudget cascade;
532

    
533
create table constructionbudget (
534
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
535
  , CreatorCode decimal(8,0) not null comment '????R?[?h'
536
  , CreatorName varchar(60) comment '?????'
537
  , CreatorCosts decimal(11,0) not null comment '??????^'
538
  , AssistantCode decimal(8,0) not null comment '???S????R?[?h'
539
  , AssistantName varchar(60) comment '???S?????'
540
  , AssistantCosts decimal(11,0) not null comment '???S??????^'
541
  , InstructorCode decimal(8,0) not null comment '?H???w?????R?[?h'
542
  , InstructorName varchar(60) comment '?H???w??????'
543
  , InstructorCosts decimal(11,0) not null comment '?H???w???????^'
544
  , CreateDate date not null comment '????'
545
  , ConstructionTimes decimal(5,2) not null comment '?H???i?P??E???j'
546
  , ConstructionStart date not null comment '?_??H???J?n'
547
  , ConstructionEnd date not null comment '?_??H??????'
548
  , InstructorTimes decimal(5,2) not null comment '?w???????????'
549
  , SalaryFlg decimal(1,0) not null comment '???^?U????'
550
  , SalaryDays decimal(4,0) not null comment '?U??????'
551
  , A_SalaryFlg decimal(1,0) not null comment '???S??????^?U????'
552
  , A_SalaryDays decimal(4,0) not null comment '???S????U??????'
553
  , I_SalaryFlg decimal(1,0) not null comment '?w???????^?U????'
554
  , I_SalaryDays decimal(4,0) not null comment '?w?????U??????'
555
  , OrdersDecisionPrice decimal(12,0) not null comment '??????????z'
556
  , EntryDate datetime not null comment '?o?^???t'
557
  , UpdateDate datetime not null comment '?X?V???t'
558
  , constraint constructionbudget_PKC primary key (ConstructionCode)
559
) comment '?H???{?H?\?Z?f?[?^' ;
560

    
561
-- ?H???{?H?\?Z?f?[?^????
562
drop table constructionbudgetdetail cascade;
563

    
564
create table constructionbudgetdetail (
565
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
566
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
567
  , LineCount decimal(3,0) unsigned not null comment '?s???'
568
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
569
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
570
  , FirstString varchar(120) comment '???????'
571
  , SecondString varchar(120) comment '?H?????e'
572
  , CompanyType decimal(1,0) not null comment '??????R?[?h?^?C?v'
573
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
574
  , CompanyName varchar(120) comment '?????????'
575
  , EstimatePrice decimal(12,0) not null comment '??Z????????z'
576
  , NegotiationPrice decimal(12,0) not null comment '??Z????????z'
577
  , OrderDesiredAmount decimal(12,0) not null comment '??????]???z'
578
  , ExecutionAmount decimal(12,0) not null comment '???s???z'
579
  , AmountConfigRate decimal(5,2) not null comment '???z?\????'
580
  , NegotiateFlg decimal(1,0) not null comment '?????????t???O'
581
  , EntryDate datetime not null comment '?o?^???t'
582
  , UpdateDate datetime not null comment '?X?V???t'
583
  , constraint constructionbudgetdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
584
) comment '?H???{?H?\?Z?f?[?^????' ;
585

    
586
-- ?H??}?X?^
587
drop table constructionitemmaster cascade;
588

    
589
create table constructionitemmaster (
590
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
591
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
592
  , ItemName varchar(120) not null comment '?H????'
593
  , SubItemsFlg decimal(1,0) comment '???????t???O'
594
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
595
  , DeleteFlg decimal(1,0) not null comment '???t???O'
596
  , EntryDate datetime not null comment '?o?^???t'
597
  , UpdateDate datetime not null comment '?X?V???t'
598
  , constraint constructionitemmaster_PKC primary key (ItemCode)
599
) comment '?H??}?X?^' ;
600

    
601
-- ?H???????f?[?^
602
drop table constructionledger cascade;
603

    
604
create table constructionledger (
605
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
606
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
607
  , CreatorCode decimal(8,0) comment '????R?[?h'
608
  , CreatorName varchar(60) comment '?????'
609
  , CreateDate date not null comment '????'
610
  , ConstructionTimes decimal(5,2) not null comment '?H???i?P??E???j'
611
  , ConstructionStart date not null comment '?_??H???J?n'
612
  , ConstructionEnd date not null comment '?_??H??????'
613
  , OrdersDecisionPrice decimal(14,0) not null comment '??????????z'
614
  , CompanyExpenses decimal(10,0) not null comment '???o???v'
615
  , DepartmentExpenses decimal(10,0) not null comment '?????o???v'
616
  , SalesExpenses decimal(10,0) not null comment '?c??o???v'
617
  , TotalPayment decimal(10,0) not null comment '???x???z'
618
  , GrossProfit decimal(10,0) not null comment '?e??'
619
  , Allowance decimal(10,0) not null comment '???^'
620
  , NetProfit decimal(10,0) not null comment '?????v'
621
  , ComplateFlg decimal(1,0) not null comment '????????t???O'
622
  , IntegrationFlg decimal(1,0) not null comment '????z??Z?t???O'
623
  , EntryDate datetime not null comment '?o?^???t'
624
  , UpdateDate datetime not null comment '?X?V???t'
625
  , constraint constructionledger_PKC primary key (ConstructionCode)
626
) comment '?H???????f?[?^' ;
627

    
628
-- ?H??????????f?[?^
629
drop table constructionledgerdetail cascade;
630

    
631
create table constructionledgerdetail (
632
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
633
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
634
  , LineCount decimal(4,0) unsigned not null comment '?s???'
635
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
636
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
637
  , FirstString varchar(120) comment '???????'
638
  , SecondString varchar(120) comment '?H?????e'
639
  , CompanyType decimal(1,0) not null comment '??????R?[?h?^?C?v'
640
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
641
  , CompanyName varchar(120) comment '?????????'
642
  , EstimatePrice decimal(12,0) not null comment '?\?Z?i????j???z'
643
  , ExecutionAmount decimal(12,0) not null comment '???s???z'
644
  , AmountConfigRate decimal(5,2) not null comment '???z?\????'
645
  , PaymentBurden decimal(12,0) not null comment '?x????U?z'
646
  , FixDataFlg decimal(1,0) not null comment '???f?[?^?t???O'
647
  , IndependentFlg decimal(1,0) not null comment '????f?[?^?t???O'
648
  , FluctuationFlg decimal(1,0) not null comment '?????f?[?^?t???O'
649
  , SalaryFlg decimal(1,0) not null comment '???^?U????'
650
  , SalaryDays decimal(4,0) not null comment '???^?U??????'
651
  , OperatingFlg decimal(1,0) not null comment '?S?????t???O'
652
  , SourceCode decimal(10,0) unsigned not null comment '???H?????'
653
  , JoinTitleFlg decimal(1,0) not null comment '?H??????^?C?g??'
654
  , SalaryOnRegist decimal(12,0) not null comment '?o?^?????z???^'
655
  , PurchaseOrderFlg decimal(2,0) not null comment '?????????s?t???O'
656
  , DetailCount decimal(4,0) unsigned not null comment '??????'
657
  , EntryDate datetime not null comment '?o?^???t'
658
  , UpdateDate datetime not null comment '?X?V???t'
659
  , constraint constructionledgerdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
660
) comment '?H??????????f?[?^' ;
661

    
662
create index LedgerDetail_Index01
663
  on constructionledgerdetail(ConstructionCode);
664

    
665
create index LedgerDetail_Index02
666
  on constructionledgerdetail(GroupCount);
667

    
668
create index LedgerDetail_Index03
669
  on constructionledgerdetail(LineCount);
670

    
671
create index LedgerDetail_Index04
672
  on constructionledgerdetail(SourceCode);
673

    
674
create index LedgerDetail_Index05
675
  on constructionledgerdetail(DetailCount);
676

    
677
-- ?H?????????s?f?[?^
678
drop table constructionledgerexcute cascade;
679

    
680
create table constructionledgerexcute (
681
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
682
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
683
  , LineCount decimal(4,0) unsigned not null comment '?s???'
684
  , ColumnCount decimal(3,0) not null comment '????'
685
  , PaymentAmount decimal(12,0) not null comment '?x?????z'
686
  , TargetMonth date not null comment '???N??'
687
  , EntryDate datetime not null comment '?o?^???t'
688
  , UpdateDate datetime not null comment '?X?V???t'
689
  , constraint constructionledgerexcute_PKC primary key (ConstructionCode,GroupCount,LineCount,ColumnCount)
690
) comment '?H?????????s?f?[?^' ;
691

    
692
create index LedgerExcute_Index1
693
  on constructionledgerexcute(ConstructionCode,TargetMonth,GroupCount,LineCount);
694

    
695
-- ?H???????N???
696
drop table constructionlink cascade;
697

    
698
create table constructionlink (
699
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
700
  , FluctuationCode decimal(10,0) not null comment '?q?H?????'
701
  , LinkType decimal(1,0) not null comment '?????N???'
702
  , EntryDate datetime not null comment '?o?^???t'
703
  , UpdateDate datetime not null comment '?X?V???t'
704
  , constraint constructionlink_PKC primary key (ConstructionCode,FluctuationCode)
705
) comment '?H???????N???' ;
706

    
707
create index ConstructionLink_Index1
708
  on constructionlink(ConstructionCode);
709

    
710
create index ConstructionLink_Index2
711
  on constructionlink(FluctuationCode);
712

    
713
create index ConstructionLink_Index3
714
  on constructionlink(LinkType);
715

    
716
-- ?H????????
717
drop table constructionmaterialinfo cascade;
718

    
719
create table constructionmaterialinfo (
720
  CONSTRUCTIONCODE int(10) unsigned default 0 not null comment '?H?????'
721
  , MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
722
  , PROCESSDATE datetime default '0000-00-00 00:00:00' not null comment '?????N????'
723
  , RENTCOUNT smallint(5) unsigned comment '??o??'
724
  , REPAYCOUNT smallint(5) unsigned comment '??p??'
725
  , JUNKCOUNT smallint(5) unsigned comment '?j????'
726
  , COMPLETEFLG tinyint(3) unsigned comment '?????t???O'
727
  , ENTRYDATE datetime comment '?o?^???t'
728
  , UPDATEDATE datetime comment '?X?V???t'
729
  , constraint constructionmaterialinfo_PKC primary key (CONSTRUCTIONCODE,MATERIALITEMCODE,PROCESSDATE)
730
) comment '?H????????' ;
731

    
732
-- ????i?????t?f?[?^
733
drop table constructionprogressdate cascade;
734

    
735
create table constructionprogressdate (
736
  ConstructionCode decimal(10,0) not null comment '?H?????'
737
  , ConstructionStatusFlg decimal(2,0) not null comment '???H?????'
738
  , PreviousStatusFlg decimal(2,0) comment '??X?O???'
739
  , ChangeDate datetime not null comment '?????t'
740
  , ChangePersonCode decimal(8,0) not null comment '???S????'
741
  , EntryDate datetime not null comment '?o?^???t'
742
  , UpdateDate datetime not null comment '?X?V???t'
743
  , constraint constructionprogressdate_PKC primary key (ConstructionCode,ConstructionStatusFlg)
744
) comment '????i?????t?f?[?^' ;
745

    
746
-- ???}?X?^
747
drop table constructionspecmaster cascade;
748

    
749
create table constructionspecmaster (
750
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
751
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
752
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
753
  , ItemName varchar(120) comment '??????'
754
  , SpecName varchar(120) comment '??????'
755
  , UnitName varchar(30) comment '?P?????'
756
  , UnitPrice decimal(9,2) not null comment '?P??'
757
  , DeleteFlg decimal(1,0) not null comment '???t???O'
758
  , EntryDate datetime not null comment '?o?^???t'
759
  , UpdateDate datetime not null comment '?X?V???t'
760
  , constraint constructionspecmaster_PKC primary key (ItemCode,SpecCode)
761
) comment '???}?X?^' ;
762

    
763
create index ConstructionSpecMaster_Index1
764
  on constructionspecmaster(DisplayOrder);
765

    
766
-- ???P???}?X?^
767
drop table constructionspecunitprice cascade;
768

    
769
create table constructionspecunitprice (
770
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
771
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
772
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
773
  , ConstructionTypeCode mediumint(8) unsigned not null comment '?H?????R?[?h'
774
  , UnitPrice decimal(9,2) not null comment '?P??'
775
  , EntryDate datetime not null comment '?o?^???t'
776
  , UpdateDate datetime not null comment '?X?V???t'
777
  , constraint constructionspecunitprice_PKC primary key (ComponentCode,ItemCode,SpecCode,ConstructionTypeCode)
778
) comment '???P???}?X?^' ;
779

    
780
-- ?H?????}?X?^
781
drop table constructiontypemaster cascade;
782

    
783
create table constructiontypemaster (
784
  TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
785
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
786
  , NameString varchar(100) not null comment '????'
787
  , PublicFlg decimal(1,0) not null comment '?H?????t???O'
788
  , SecRank decimal(1,0) not null comment '?????????N'
789
  , ExpensesLink decimal(1,0) not null comment '?o??g?p??'
790
  , DeleteFlg decimal(1,0) not null comment '???t???O'
791
  , EntryDate datetime not null comment '?o?^???t'
792
  , UpdateDate datetime not null comment '?X?V???t'
793
  , constraint constructiontypemaster_PKC primary key (TypeCode)
794
) comment '?H?????}?X?^' ;
795

    
796
-- ?S??????o??f?[?^
797
drop table costdataofperson cascade;
798

    
799
create table costdataofperson (
800
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
801
  , ActionDate date not null comment '?????t'
802
  , DataType decimal(1,0) not null comment '?f?[?^??'
803
  , DataAddCount decimal(5,0) unsigned not null comment '?f?[?^??????'
804
  , TargetMonth varchar(7) not null comment '???N??'
805
  , ConstructionCode decimal(10,0) unsigned comment '?H???R?[?h'
806
  , SuppliersCode decimal(5,0) unsigned not null comment '?x????R?[?h'
807
  , SuppliersName varchar(120) comment '?x??????'
808
  , PaymentContent varchar(60) comment '?x?????e'
809
  , PaymentType decimal(1,0) not null comment '?x?????@?t???O'
810
  , EntryPrice decimal(12,0) not null comment '???z?i????j'
811
  , EntryPriceInTax decimal(12,0) not null comment '???z?i????j'
812
  , SlipNumber varchar(12) comment '?`?[???'
813
  , ComplateFlg decimal(1,0) not null comment '???????t???O'
814
  , ApprovalFlg decimal(1,0) not null comment '???F?t???O'
815
  , EntryDate datetime not null comment '?o?^???t'
816
  , UpdateDate datetime not null comment '?X?V???t'
817
  , constraint costdataofperson_PKC primary key (PersonCode,ActionDate,DataType,DataAddCount)
818
) comment '?S??????o??f?[?^' ;
819

    
820
create index CostDataOfPerson_Index1
821
  on costdataofperson(TargetMonth);
822

    
823
create index CostDataOfPerson_Index2
824
  on costdataofperson(ConstructionCode);
825

    
826
-- ??????o?^?\???f?[?^
827
drop table costomerregist cascade;
828

    
829
create table costomerregist (
830
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
831
  , CreateDate date not null comment '????'
832
  , SeqNo decimal(2,0) not null comment '?L?[?A??'
833
  , DataMode decimal(1,0) not null comment '?f?[?^??'
834
  , SourceCotegory decimal(5,0) unsigned not null comment '???????'
835
  , SourceCode decimal(5,0) unsigned not null comment '??????R?[?h'
836
  , PetitionPeriod decimal(4,0) unsigned not null comment '?????'
837
  , OrderFlg decimal(1,0) not null comment '?@?l?c??E??l?t???O'
838
  , CorporateStatusName varchar(100) comment '?@?l?i????'
839
  , CorporateStatusPoint decimal(1,0) comment '?@?l?i?????u'
840
  , OrderersName1 varchar(60) not null comment '???????1'
841
  , OrderersName2 varchar(60) comment '????????Q'
842
  , DepartmentName varchar(60) comment '??????'
843
  , ChargePersonName varchar(60) comment '?S?????'
844
  , ZipCode varchar(8) comment '?X????'
845
  , Address1 varchar(60) comment '?Z???P'
846
  , Address2 varchar(60) comment '?Z??2'
847
  , Address3 varchar(60) comment '?Z??3'
848
  , PhoneNumber varchar(13) comment '?d?b???'
849
  , FaxNumber varchar(13) comment 'FAX???'
850
  , MailAddress varchar(257) comment '???[???A?h???X'
851
  , Note varchar(300) comment '???l'
852
  , OrderCotegory decimal(5,0) unsigned not null comment '???????'
853
  , OrderDate date not null comment '?\????'
854
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
855
  , EntryDate datetime not null comment '?o?^???t'
856
  , UpdateDate datetime not null comment '?X?V???t'
857
  , constraint costomerregist_PKC primary key (PersonCode,CreateDate,SeqNo)
858
) comment '??????o?^?\???f?[?^' ;
859

    
860
create index CostomerRegist_Index1
861
  on costomerregist(PetitionPeriod);
862

    
863
-- ????f?[?^
864
drop table dailydataconstruction cascade;
865

    
866
create table dailydataconstruction (
867
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
868
  , DailyDataDate date not null comment '???????'
869
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
870
  , Weather varchar(60) comment '?V?C'
871
  , EntryDate datetime not null comment '?o?^???t'
872
  , UpdateDate datetime not null comment '?X?V???t'
873
  , constraint dailydataconstruction_PKC primary key (PersonCode,DailyDataDate,ConstructionCode)
874
) comment '????f?[?^' ;
875

    
876
create index DailyDataConstruction_Index1
877
  on dailydataconstruction(PersonCode);
878

    
879
create index DailyDataConstruction_Index2
880
  on dailydataconstruction(DailyDataDate);
881

    
882
create index DailyDataConstruction_Index3
883
  on dailydataconstruction(ConstructionCode);
884

    
885
-- ????f?[?^ (????)
886
drop table dailydatadetail cascade;
887

    
888
create table dailydatadetail (
889
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
890
  , DailyDataDate date not null comment '???????'
891
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
892
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
893
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
894
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
895
  , TodayHeadCount decimal(4,1) not null comment '?????l????'
896
  , TotalHeadCount decimal(5,1) not null comment '??v?l????'
897
  , TodayWork varchar(100) comment '?????????e'
898
  , NextdayWork varchar(100) comment '?????????e'
899
  , NextdayHeadCount decimal(4,1) not null comment '?????l????'
900
  , EntryDate datetime not null comment '?o?^???t'
901
  , UpdateDate datetime not null comment '?X?V???t'
902
  , constraint dailydatadetail_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
903
) comment '????f?[?^ (????)' ;
904

    
905
create index DailyDataDetail_Index
906
  on dailydatadetail(PersonCode,DailyDataDate,ConstructionCode);
907

    
908
-- ????f?[?^ (??????)
909
drop table dailydatafield cascade;
910

    
911
create table dailydatafield (
912
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
913
  , DailyDataDate date not null comment '???????'
914
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
915
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
916
  , PatrolTime datetime not null comment '?????'
917
  , ContentsText varchar(200) comment '???e'
918
  , EntryDate datetime not null comment '?o?^???t'
919
  , UpdateDate datetime not null comment '?X?V???t'
920
  , constraint dailydatafield_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
921
) comment '????f?[?^ (??????)' ;
922

    
923
create index DailyDataField_Index
924
  on dailydatafield(PersonCode,DailyDataDate,ConstructionCode);
925

    
926
-- ????f?[?^ (????)
927
drop table dailydatamaterials cascade;
928

    
929
create table dailydatamaterials (
930
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
931
  , DailyDataDate date not null comment '???????'
932
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
933
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
934
  , Materials varchar(100) comment '?????'
935
  , Quantity varchar(100) comment '????'
936
  , Production varchar(100) comment '??????'
937
  , Delivery varchar(100) comment '?[?????'
938
  , QualityControl varchar(100) comment '?i?????????'
939
  , EntryDate datetime not null comment '?o?^???t'
940
  , UpdateDate datetime not null comment '?X?V???t'
941
  , constraint dailydatamaterials_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
942
) comment '????f?[?^ (????)' ;
943

    
944
create index DailyDataMaterials_Index
945
  on dailydatamaterials(PersonCode,DailyDataDate,ConstructionCode);
946

    
947
-- ????f?[?^ (??????w??)
948
drop table dailydatasubcontractors cascade;
949

    
950
create table dailydatasubcontractors (
951
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
952
  , DailyDataDate date not null comment '???????'
953
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
954
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
955
  , Attendee varchar(100) comment '?o???'
956
  , ContentsText varchar(200) comment '???e'
957
  , EntryDate datetime not null comment '?o?^???t'
958
  , UpdateDate datetime not null comment '?X?V???t'
959
  , constraint dailydatasubcontractors_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
960
) comment '????f?[?^ (??????w??)' ;
961

    
962
create index DailyDataSubcontractors_Index
963
  on dailydatasubcontractors(PersonCode,DailyDataDate,ConstructionCode);
964

    
965
-- ????f?[?^ (???)
966
drop table dailydatavehicles cascade;
967

    
968
create table dailydatavehicles (
969
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
970
  , DailyDataDate date not null comment '???????'
971
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
972
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
973
  , Model varchar(100) comment '?@??'
974
  , Performance varchar(100) comment '???\'
975
  , Owner varchar(100) comment '???L???'
976
  , Driver varchar(100) comment '?????^?]??'
977
  , StartWorkingTime datetime not null comment '??????J?n'
978
  , EndWorkingTime datetime not null comment '??????I??'
979
  , EntryDate datetime not null comment '?o?^???t'
980
  , UpdateDate datetime not null comment '?X?V???t'
981
  , constraint dailydatavehicles_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
982
) comment '????f?[?^ (???)' ;
983

984
create index DailyDataVehicles_Index
985
  on dailydatavehicles(PersonCode,DailyDataDate,ConstructionCode);
986

987
-- ???}?X?^
988
drop table daymaster cascade;
989

990
create table daymaster (
991
  days smallint(6) not null comment '??'
992
) comment '???}?X?^' ;
993

994
create index day_Index1
995
  on daymaster(days);
996

997
-- ?????}?X?^
998
drop table deadlinemaster cascade;
999

1000
create table deadlinemaster (
1001
  LABOURKIND decimal(1,0) default '0' not null comment '??????'
1002
  , DEADLINE decimal(2,0) comment '????'
1003
  , PAYDAY decimal(2,0) comment '?x????'
1004
  , NOTE varchar(120) comment '???l'
1005
  , DELETEFLG decimal(1,0) comment '???t???O'
1006
  , ENTRYDATE datetime comment '?o?^???t'
1007
  , UPDATEDATE datetime comment '?X?V???t'
1008
  , constraint deadlinemaster_PKC primary key (LABOURKIND)
1009
) comment '?????}?X?^' ;
1010

1011
-- ?????o???}?X?^
1012
drop table departmentexpensesmaster cascade;
1013

1014
create table departmentexpensesmaster (
1015
  DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1016
  , ExpensesPeriod smallint(6) not null comment '?????'
1017
  , NameCode decimal(5,0) unsigned not null comment '?o????R?[?h'
1018
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1019
  , ExpensesRaito decimal(4,2) not null comment '?o??'
1020
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1021
  , EntryDate datetime not null comment '?o?^???t'
1022
  , UpdateDate datetime not null comment '?X?V???t'
1023
  , constraint departmentexpensesmaster_PKC primary key (DepartmentCode,ExpensesPeriod,NameCode)
1024
) comment '?????o???}?X?^' ;
1025

1026
-- ?????}?X?^
1027
drop table departmentmaster cascade;
1028

1029
create table departmentmaster (
1030
  DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1031
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1032
  , DepartmentString varchar(100) not null comment '??????'
1033
  , ActionScheduleFlg decimal(1,0) not null comment '?s???\??\???t???O'
1034
  , StaffAssignFlg decimal(1,0) not null comment '?l???z?u?\???t???O'
1035
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1036
  , EntryDate datetime not null comment '?o?^???t'
1037
  , UpdateDate datetime not null comment '?X?V???t'
1038
  , constraint departmentmaster_PKC primary key (DepartmentCode)
1039
) comment '?????}?X?^' ;
1040

1041
create index DepartmentMaster_index1
1042
  on departmentmaster(DisplayOrder);
1043

1044
-- ?????m?F???F?f?[?^
1045
drop table depositapprovalinfo cascade;
1046

1047
create table depositapprovalinfo (
1048
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1049
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1050
  , TARGETDATE decimal(6,0) not null comment '???N??'
1051
  , SEQNO decimal(3,0) not null comment '?A??'
1052
  , LINECOUNT decimal(3,0) not null comment '?s???'
1053
  , APPROVALNO decimal(3,0) not null comment '???F????'
1054
  , APPROVALPERSON decimal(8,0) comment '???F??R?[?h'
1055
  , APPROVALPERSONNAME varchar(20) comment '???F???'
1056
  , APPROVALAUTHORITY decimal(1,0) comment '???F??????'
1057
  , APPROVALDATE date comment '???F???t'
1058
  , ENTRYDATE datetime comment '?o?^???t'
1059
  , UPDATEDATE datetime comment '?X?V???t'
1060
  , constraint depositapprovalinfo_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,SEQNO,LINECOUNT,APPROVALNO)
1061
) comment '?????m?F???F?f?[?^' ;
1062

1063
-- ?????f?[?^
1064
drop table depositdata cascade;
1065

1066
create table depositdata (
1067
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1068
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1069
  , TARGETDATE decimal(6,0) not null comment '???N??'
1070
  , SEQNO decimal(3,0) not null comment '?A??'
1071
  , BUSINESSPERIOD decimal(4,0) comment '?c???'
1072
  , DEPOSITDATE date comment '??????'
1073
  , DEPOSITAMOUNT decimal(12,0) comment '???????z'
1074
  , DEPOSITAMOUNTCASH decimal(10,0) comment '???????z?i?????j'
1075
  , DEPOSITAMOUNTBILL decimal(10,0) comment '???????z?i??`?j'
1076
  , DEPOSITPERSONCODE decimal(8,0) not null comment '?????S????R?[?h'
1077
  , NOTE varchar(120) comment '???l'
1078
  , ENTRYDATE datetime comment '?o?^???t'
1079
  , UPDATEDATE datetime comment '?X?V???t'
1080
  , constraint depositdata_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,SEQNO)
1081
) comment '?????f?[?^' ;
1082

1083
-- ????????f?[?^
1084
drop table depositdatadetail cascade;
1085

1086
create table depositdatadetail (
1087
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1088
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1089
  , TARGETDATE decimal(6,0) not null comment '???N??'
1090
  , REQUESTNO decimal(10,0) not null comment '????No'
1091
  , ORDERNO decimal(2,0) comment '??t???'
1092
  , DEPOSITAMOUNT decimal(10,0) comment '???????z'
1093
  , DISCOUNTAMOUNT decimal(10,0) comment '?l???????z'
1094
  , CNSTRPRICE decimal(10,0) comment '?????'
1095
  , FEES decimal(10,0) comment '????'
1096
  , OTHERADJUSTMENTS decimal(10,0) comment '?????'
1097
  , DIFFERENCEAMOUNT decimal(10,0) comment '????'
1098
  , CONFIRMATIONPERSONCODE decimal(8,0) comment '?m?F?S????R?[?h'
1099
  , CONFIRMATIONDATE date comment '?S????m?F???t'
1100
  , CONFIRMATIONENDFLG decimal(1,0) comment '?m?F?????t???O'
1101
  , NOTE varchar(120) comment '???l'
1102
  , ENTRYDATE datetime comment '?o?^???t'
1103
  , UPDATEDATE datetime comment '?X?V???t'
1104
  , constraint depositdatadetail_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,REQUESTNO)
1105
) comment '????????f?[?^' ;
1106

1107
-- ???}?X?^
1108
drop table divisionmaster cascade;
1109

1110
create table divisionmaster (
1111
  DivisionCode decimal(5,0) unsigned not null comment '???R?[?h'
1112
  , NameCode decimal(5,0) unsigned not null comment '????R?[?h'
1113
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1114
  , NameString varchar(100) not null comment '????'
1115
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1116
  , EntryDate datetime not null comment '?o?^???t'
1117
  , UpdateDate datetime not null comment '?X?V???t'
1118
  , constraint divisionmaster_PKC primary key (DivisionCode,NameCode)
1119
) comment '???}?X?^' ;
1120

1121
-- ??Z?\?Z???f?[?^
1122
drop table estimatebudget cascade;
1123

1124
create table estimatebudget (
1125
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1126
  , ConstructionTime decimal(5,2) unsigned not null comment '?H??'
1127
  , IntegratedCode decimal(8,0) not null comment '??Z??'
1128
  , DataCreateDate datetime not null comment '?f?[?^??????'
1129
  , RetValue1 decimal(12,0) not null comment '?\???i'
1130
  , RetValue2 decimal(12,0) not null comment '????H????'
1131
  , RetValue3 decimal(12,0) not null comment '????????????'
1132
  , RetValue4 decimal(12,0) not null comment '????????????'
1133
  , RetPercent decimal(5,2) not null comment '???????'
1134
  , EntryDate datetime not null comment '?o?^???t'
1135
  , UpdateDate datetime not null comment '?X?V???t'
1136
  , constraint estimatebudget_PKC primary key (ConstructionCode)
1137
) comment '??Z?\?Z???f?[?^' ;
1138

1139
-- ??Z?\?Z????f?[?^????
1140
drop table estimatebudgetdetail cascade;
1141

1142
create table estimatebudgetdetail (
1143
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1144
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
1145
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1146
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1147
  , ItemCode decimal(5,0) unsigned comment '?H??L?['
1148
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1149
  , FirstString varchar(120) comment '???????'
1150
  , SecondString varchar(120) comment '?H????E???????'
1151
  , Content varchar(120) comment '???e'
1152
  , EstimatePrice decimal(12,0) not null comment '????????z'
1153
  , NegotiationPrice decimal(12,0) not null comment '????????z'
1154
  , Notes varchar(120) comment '???????'
1155
  , EntryDate datetime not null comment '?o?^???t'
1156
  , UpdateDate datetime not null comment '?X?V???t'
1157
  , constraint estimatebudgetdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
1158
) comment '??Z?\?Z????f?[?^????' ;
1159

1160
-- ??Z????f?[?^
1161
drop table estimatedata cascade;
1162

1163
create table estimatedata (
1164
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1165
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1166
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1167
  , FixedItemCode varchar(1) comment '?????L?['
1168
  , ItemName varchar(120) comment '??????'
1169
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
1170
  , PriceValue decimal(14,0) not null comment '???z'
1171
  , note varchar(60) comment '???l'
1172
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
1173
  , InputFlg decimal(1,0) not null comment '????t???O'
1174
  , EntryDate datetime not null comment '?o?^???t'
1175
  , UpdateDate datetime not null comment '?X?V???t'
1176
  , constraint estimatedata_PKC primary key (ConstructionCode,LineCount)
1177
) comment '??Z????f?[?^' ;
1178

1179
create index EstimateData_Index1
1180
  on estimatedata(ConstructionCode,FixedItemCode);
1181

1182
-- ??Z????y?[?W?f?[?^
1183
drop table estimatedatabody cascade;
1184

1185
create table estimatedatabody (
1186
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1187
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
1188
  , Category decimal(1,0) not null comment '?y?[?W??'
1189
  , UnionComponentCode decimal(5,0) unsigned not null comment '?????\???L?['
1190
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1191
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1192
  , SelectComponent decimal(5,0) unsigned not null comment '?I???\???L?['
1193
  , PageTitle varchar(120) not null comment '?y?[?W?\????'
1194
  , DetailLineCount decimal(3,0) unsigned not null comment '????s???'
1195
  , EntryDate datetime not null comment '?o?^???t'
1196
  , UpdateDate datetime not null comment '?X?V???t'
1197
  , constraint estimatedatabody_PKC primary key (ConstructionCode,PageCount)
1198
) comment '??Z????y?[?W?f?[?^' ;
1199

1200
create index EstimateDataBody_Index1
1201
  on estimatedatabody(ConstructionCode,ComponentCode,ItemCode);
1202

1203
-- ??Z????f?[?^????
1204
drop table estimatedatadetail cascade;
1205

1206
create table estimatedatadetail (
1207
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1208
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
1209
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1210
  , DataType decimal(1,0) not null comment '?f?[?^???'
1211
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1212
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1213
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
1214
  , ItemName varchar(120) comment '??????'
1215
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
1216
  , Unitcount decimal(8,2) not null comment '????'
1217
  , UnitName varchar(30) comment '?P?????'
1218
  , UnitPrice decimal(9,2) not null comment '?P??'
1219
  , LineTotal decimal(12,0) not null comment '???z'
1220
  , note varchar(60) comment '???l'
1221
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1222
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
1223
  , InputFlg decimal(1,0) comment '????t???O'
1224
  , EntryDate datetime not null comment '?o?^???t'
1225
  , UpdateDate datetime not null comment '?X?V???t'
1226
  , constraint estimatedatadetail_PKC primary key (ConstructionCode,PageCount,LineCount)
1227
) comment '??Z????f?[?^????' ;
1228

1229
create index EstimateDataDetail_Index1
1230
  on estimatedatadetail(ConstructionCode,PageCount);
1231

1232
-- ?o???}?X?^
1233
drop table expensesmaster cascade;
1234

1235
create table expensesmaster (
1236
  DivisionCode smallint(6) not null comment '?H?????R?[?h'
1237
  , NameCode smallint(6) not null comment '?o????R?[?h'
1238
  , DisplayOrder smallint(6) not null comment '?\????'
1239
  , ExpensesRatio decimal(4,2) not null comment '?o??'
1240
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1241
  , EntryDate datetime not null comment '?o?^???t'
1242
  , UpdateDate datetime not null comment '?X?V???t'
1243
  , constraint expensesmaster_PKC primary key (DivisionCode,NameCode)
1244
) comment '?o???}?X?^' ;
1245

1246
-- ???x???}?X?^
1247
drop table holidaycalendermaster cascade;
1248

1249
create table holidaycalendermaster (
1250
  Holiday date not null comment '?x??'
1251
  , BusinessYear smallint(5) unsigned not null comment '?c??N?x'
1252
  , TargetMonth tinyint(3) unsigned not null comment '?Y????'
1253
  , TargetDay tinyint(3) unsigned not null comment '?Y????'
1254
  , constraint holidaycalendermaster_PKC primary key (Holiday)
1255
) comment '???x???}?X?^' ;
1256

1257
create index HolidayCalender_Index1
1258
  on holidaycalendermaster(BusinessYear);
1259

1260
create index HolidayCalenderMaster_Index2
1261
  on holidaycalendermaster(TargetMonth);
1262

1263
create index HolidayCalenderMaster_Index3
1264
  on holidaycalendermaster(TargetDay);
1265

1266
-- ?????????????
1267
drop table inputsearchlogdata cascade;
1268

1269
create table inputsearchlogdata (
1270
  ConstructionCode decimal(10,0) not null comment '?H???R?[?h'
1271
  , UsedProcessNo decimal(4,0) not null comment '?g?p?@?\???'
1272
  , DisplayOrder decimal(4,0) unsigned not null comment '?\????'
1273
  , DataType decimal(1,0) not null comment '?f?[?^???'
1274
  , InputCode decimal(10,0) comment '????R?[?h'
1275
  , constraint inputsearchlogdata_PKC primary key (ConstructionCode,UsedProcessNo,DisplayOrder)
1276
) comment '?????????????' ;
1277

1278
create index InputSearchLogData_Index1
1279
  on inputsearchlogdata(ConstructionCode,UsedProcessNo,InputCode);
1280

1281
-- ???????f?[?^
1282
drop table invoicedata cascade;
1283

1284
create table invoicedata (
1285
  INVOICENO decimal(9,0) not null comment '??????No'
1286
  , ORDERERSDIVISION decimal(5,0) not null comment '???????'
1287
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1288
  , REQUESTMONTH decimal(6,0) not null comment '??????'
1289
  , SEQNO decimal(2,0) not null comment '?A??'
1290
  , CRETATEDATE date not null comment '????'
1291
  , REQUESTDATE date not null comment '??????'
1292
  , REQUESTNAME varchar(120) comment '??????'
1293
  , TOTALAMOUNT decimal(10,0) comment '???????v???z'
1294
  , TAXAMOUNT decimal(10,0) comment '???????z'
1295
  , COMMENT1 varchar(60) comment '?R?????g1'
1296
  , COMMENT2 varchar(60) comment '?R?????g2'
1297
  , COMMENT3 varchar(60) not null comment '?R?????g3'
1298
  , COMMENT4 varchar(60) not null comment '?R?????g4'
1299
  , COMMENT5 varchar(60) not null comment '?R?????g5'
1300
  , COMPLETEFLG decimal(1,0) default '0' not null comment '?????t???O'
1301
  , ENTRYDATE datetime not null comment '?o?^?N????'
1302
  , UPDATEDATE datetime not null comment '?X?V?N????'
1303
  , constraint invoicedata_PKC primary key (INVOICENO)
1304
) comment '???????f?[?^' ;
1305

1306
alter table invoicedata add unique ORDERERSDIVISION (ORDERERSDIVISION,ORDERERSCODE,REQUESTMONTH,SEQNO) ;
1307

1308
-- ??????
1309
drop table materialinfo cascade;
1310

1311
create table materialinfo (
1312
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1313
  , MATERIALCOUNT smallint(5) unsigned comment '?????'
1314
  , RENTCOUNT smallint(5) unsigned comment '??o??\??'
1315
  , DELETEFLG smallint(5) unsigned comment '???t???O'
1316
  , ENTRYDATE datetime comment '?o?^???t'
1317
  , UPDATEDATE datetime comment '?X?V???t'
1318
  , constraint materialinfo_PKC primary key (MATERIALITEMCODE)
1319
) comment '??????' ;
1320

1321
-- ????i??}?X?^
1322
drop table materialitemmaster cascade;
1323

1324
create table materialitemmaster (
1325
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1326
  , MATERIALKINDCODE smallint(5) unsigned comment '??????R?[?h'
1327
  , MATERIALITEMNAME varchar(40) comment '????i?????'
1328
  , DISPLAYORDER smallint(5) unsigned comment '?\????'
1329
  , DELETEFLG tinyint(3) unsigned comment '???t???O'
1330
  , ENTRYDATE datetime comment '?o?^???t'
1331
  , UPDATEDATE datetime comment '?X?V???t'
1332
  , VERSIONNO decimal(8,0) default '0' not null comment '?o?[?W???????'
1333
  , constraint materialitemmaster_PKC primary key (MATERIALITEMCODE)
1334
) comment '????i??}?X?^' ;
1335

1336
-- ??????}?X?^
1337
drop table materialkindmaster cascade;
1338

1339
create table materialkindmaster (
1340
  MATERIALKINDCODE smallint(5) unsigned default 0 not null comment '??????R?[?h'
1341
  , MATERIALKINDNAME varchar(40) comment '?????????'
1342
  , DISPLAYORDER smallint(5) unsigned comment '?\????'
1343
  , DELETEFLG tinyint(3) unsigned comment '???t???O'
1344
  , ENTRYDATE datetime comment '?o?^???t'
1345
  , UPDATEDATE datetime comment '?X?V???t'
1346
  , constraint materialkindmaster_PKC primary key (MATERIALKINDCODE)
1347
) comment '??????}?X?^' ;
1348

1349
-- ??????????
1350
drop table materialrecordinfo cascade;
1351

1352
create table materialrecordinfo (
1353
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1354
  , PROCESSDATE date default '0000-00-00' not null comment '?????N????'
1355
  , SEQNO smallint(5) unsigned default 0 not null comment '?A??'
1356
  , RECKIND tinyint(3) unsigned comment '???R?[?h??'
1357
  , CONSTRUCTIONCODE int(10) unsigned comment '?H?????'
1358
  , PERSONCODE int(10) unsigned comment '?S????R?[?h'
1359
  , MATERIALCOUNT smallint(5) unsigned comment '?????'
1360
  , REPAYPLANDATE date comment '??p?\??N????'
1361
  , COMMENTTEXT varchar(80) comment '?R?????g'
1362
  , ENTRYDATE datetime comment '?o?^???t'
1363
  , UPDATEDATE datetime comment '?X?V???t'
1364
  , constraint materialrecordinfo_PKC primary key (MATERIALITEMCODE,PROCESSDATE,SEQNO)
1365
) comment '??????????' ;
1366

1367
-- ?f??????b?Z?[?W
1368
drop table messageboarddata cascade;
1369

1370
create table messageboarddata (
1371
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1372
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1373
  , FromCode decimal(8,0) unsigned not null comment '???????R?[?h'
1374
  , FromName varchar(60) not null comment '???????'
1375
  , MessageTitile varchar(100) comment '?`???^?C?g??'
1376
  , MessageContent varchar(1333) not null comment '?`?????e'
1377
  , LinkType decimal(2,0) not null comment '?????N????^?C?v'
1378
  , LinkMessage varchar(200) comment '?????N??????'
1379
  , LinkCode varchar(30) comment '?????N?L?['
1380
  , WritingDate datetime not null comment '?????????'
1381
  , PersonCode decimal(8,0) not null comment '??????S????R?[?h'
1382
  , ShareFlag decimal(2,0) not null comment '???????t???O'
1383
  , MessageColor varchar(8) comment '?????F'
1384
  , BackColor varchar(8) comment '?o?b?N?J???['
1385
  , MessageFlag decimal(1,0) not null comment '???b?Z?[?W?t???O'
1386
  , EntryDate datetime not null comment '?o?^???t'
1387
  , UpdateDate datetime not null comment '?X?V???t'
1388
  , constraint messageboarddata_PKC primary key (RecordNumber,BranchNumber)
1389
) comment '?f??????b?Z?[?W' ;
1390

1391
create index MessageBoardData_Index1
1392
  on messageboarddata(WritingDate);
1393

1394
create index MessageBoardData_Index2
1395
  on messageboarddata(MessageFlag);
1396

1397
-- ?f???????e?[?u??
1398
drop table messageboardterget cascade;
1399

1400
create table messageboardterget (
1401
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1402
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1403
  , SeqNum decimal(3,0) unsigned not null comment '????'
1404
  , ToCode decimal(8,0) not null comment '????R?[?h'
1405
  , ToName varchar(60) not null comment '????'
1406
  , EntryDate datetime not null comment '?o?^???t'
1407
  , UpdateDate datetime not null comment '?X?V???t'
1408
  , constraint messageboardterget_PKC primary key (RecordNumber,BranchNumber,SeqNum)
1409
) comment '?f???????e?[?u??' ;
1410

1411
create index MessageBoardTerget_Index1
1412
  on messageboardterget(RecordNumber,BranchNumber);
1413

1414
-- ?f??????b?Z?[?W?{??????
1415
drop table messagebrowsinghistory cascade;
1416

1417
create table messagebrowsinghistory (
1418
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1419
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1420
  , SeqNum decimal(3,0) unsigned not null comment '????'
1421
  , BrowsingCode decimal(8,0) not null comment '?{????R?[?h'
1422
  , BrowsingDate datetime not null comment '?{?????t'
1423
  , EntryDate datetime not null comment '?o?^???t'
1424
  , UpdateDate datetime not null comment '?X?V???t'
1425
  , constraint messagebrowsinghistory_PKC primary key (RecordNumber,BranchNumber,SeqNum)
1426
) comment '?f??????b?Z?[?W?{??????' ;
1427

1428
-- ???}?X?^
1429
drop table monthmaster cascade;
1430

1431
create table monthmaster (
1432
  month smallint(6) not null comment '??'
1433
) comment '???}?X?^' ;
1434

1435
create index month_Index1
1436
  on monthmaster(month);
1437

1438
-- ??????}?X?^
1439
drop table orderersmaster cascade;
1440

1441
create table orderersmaster (
1442
  OrderCotegory decimal(5,0) unsigned not null comment '???????'
1443
  , OrderersCode decimal(5,0) unsigned not null comment '??????R?[?h'
1444
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1445
  , OrderFlg decimal(1,0) not null comment '?@?l?c??E??l?t???O'
1446
  , CorporateStatusName varchar(100) comment '?@?l?i????'
1447
  , CorporateStatusPoint decimal(1,0) comment '?@?l?i?????u'
1448
  , OrderersName1 varchar(60) not null comment '???????1'
1449
  , OrderersName2 varchar(60) comment '????????Q'
1450
  , DepartmentName varchar(60) comment '??????'
1451
  , ChargePersonName varchar(60) comment '?S?????'
1452
  , ZipCode varchar(8) comment '?X????'
1453
  , Address1 varchar(60) comment '?Z???P'
1454
  , Address2 varchar(60) comment '?Z??2'
1455
  , Address3 varchar(60) comment '?Z??3'
1456
  , PhoneNumber varchar(13) comment '?d?b???'
1457
  , FaxNumber varchar(13) comment 'FAX???'
1458
  , MailAddress varchar(257) comment '???[???A?h???X'
1459
  , Note varchar(300) comment '???l'
1460
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1461
  , EntryDate datetime not null comment '?o?^???t'
1462
  , UpdateDate datetime not null comment '?X?V???t'
1463
  , constraint orderersmaster_PKC primary key (OrderCotegory,OrderersCode)
1464
) comment '??????}?X?^' ;
1465

1466
-- ????z?f?[?^
1467
drop table orderspricedata cascade;
1468

1469
create table orderspricedata (
1470
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1471
  , ChangeNo decimal(3,0) unsigned not null comment '??X???'
1472
  , ChangeDate date not null comment '??X??'
1473
  , ChangePersonCode decimal(8,0) unsigned not null comment '??X??R?[?h'
1474
  , ChangePersonName varchar(60) comment '??X???'
1475
  , BeforeValue decimal(14,0) not null comment '??X?O???????z'
1476
  , BeforeValueInTax decimal(14,0) not null comment '??X?O???????z'
1477
  , AfterValue decimal(14,0) not null comment '??X????????z'
1478
  , AfterValueInTax decimal(14,0) not null comment '??X????????z'
1479
  , ChangeComment varchar(200) comment '??X???R'
1480
  , EntryDate datetime not null comment '?o?^???t'
1481
  , UpdateDate datetime not null comment '?X?V???t'
1482
  , constraint orderspricedata_PKC primary key (ConstructionCode,ChangeNo)
1483
) comment '????z?f?[?^' ;
1484

1485
-- ?x?????F???f?[?^
1486
drop table paymentapprovalinfo cascade;
1487

1488
create table paymentapprovalinfo (
1489
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
1490
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
1491
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
1492
  , LINECOUNT decimal(3,0) default '0' not null comment '?s???'
1493
  , APPROVALNO decimal(3,0) default '0' not null comment '???F????'
1494
  , APPROVALPERSON decimal(8,0) comment '???F??R?[?h'
1495
  , APPROVALPERSONNAME varchar(20) comment '???F???'
1496
  , APPROVALAUTHORITY decimal(1,0) comment '???F??????'
1497
  , APPROVALDATE date comment '???F???t'
1498
  , ENTRYDATE datetime comment '?o?^???t'
1499
  , UPDATEDATE datetime comment '?X?V???t'
1500
  , constraint paymentapprovalinfo_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT,APPROVALNO)
1501
) comment '?x?????F???f?[?^' ;
1502

1503
-- ?x??????f?[?^
1504
drop table paymentdatadetail cascade;
1505

1506
create table paymentdatadetail (
1507
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
1508
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
1509
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
1510
  , LINECOUNT decimal(3,0) default '0' not null comment '?s???'
1511
  , BILLPRICE decimal(10,0) comment '???????z'
1512
  , DISCOUNTPRICE decimal(10,0) comment '?l???????z'
1513
  , OFFSETPRICE decimal(10,0) comment '???E???z'
1514
  , NEXTCOPRICE decimal(10,0) comment '????J?z'
1515
  , HIGHWPRICE decimal(10,0) comment '??????'
1516
  , HARDWPRICE decimal(10,0) comment '??????'
1517
  , INDSWASTETAX decimal(10,0) comment '?Y?p??'
1518
  , CNSTRPRICE decimal(10,0) comment '?????'
1519
  , CNSTRPRICEEXIST decimal(1,0) comment '??????L??'
1520
  , APPROVALPERSONCODE decimal(8,0) comment '???F?S????R?[?h'
1521
  , APPROVALDATE date comment '?S??????F???t'
1522
  , APPROVALENDFLG decimal(1,0) comment '???F?????t???O'
1523
  , ENTRYDATE datetime comment '?o?^???t'
1524
  , UPDATEDATE datetime comment '?X?V???t'
1525
  , constraint paymentdatadetail_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT)
1526
) comment '?x??????f?[?^' ;
1527

1528
create index PayDataDetail_Index1
1529
  on paymentdatadetail(TARGETDATE);
1530

1531
create index PayDataDetail_Index2
1532
  on paymentdatadetail(APPROVALPERSONCODE);
1533

1534
-- ?H??????????f?[?^
1535
drop table periodavoidance cascade;
1536

1537
create table periodavoidance (
1538
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1539
  , ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
1540
  , FieldNo decimal(2,0) not null comment '?`?F?b?N???t?B?[???h???'
1541
  , EntryDate datetime not null comment '?o?^???t'
1542
  , UpdateDate datetime not null comment '?X?V???t'
1543
  , constraint periodavoidance_PKC primary key (ConstructionCode,ConstructionStatusFlg,FieldNo)
1544
) comment '?H??????????f?[?^' ;
1545

1546
create index PeriodAvoidance_Index1
1547
  on periodavoidance(ConstructionCode);
1548

1549
create index PeriodAvoidance_Index2
1550
  on periodavoidance(ConstructionStatusFlg);
1551

1552
create index PeriodAvoidance_Index3
1553
  on periodavoidance(FieldNo);
1554

1555
-- ?S??????F?f?[?^
1556
drop table personapproval cascade;
1557

1558
create table personapproval (
1559
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1560
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1561
  , OrderDate date not null comment '??t??'
1562
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1563
  , SeqNo decimal(2,0) not null comment '?}??'
1564
  , PersonCodeApproval decimal(8,0) unsigned not null comment '?\???E???F??R?[?h'
1565
  , PetitionApprovalDate datetime not null comment '?\???E???F???t'
1566
  , ApprovalLimitDates datetime not null comment '???F??]??'
1567
  , ApprovalStatus decimal(1,0) not null comment '???F???'
1568
  , InputComment varchar(300) comment '?R?????g'
1569
  , EntryDate datetime not null comment '?o?^???t'
1570
  , UpdateDate datetime not null comment '?X?V???t'
1571
  , constraint personapproval_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,SeqNo)
1572
) comment '?S??????F?f?[?^' ;
1573

1574
-- ?S??????F?R?????g?f?[?^
1575
drop table personapprovalcomment cascade;
1576

1577
create table personapprovalcomment (
1578
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1579
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1580
  , OrderDate date not null comment '??t??'
1581
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1582
  , CommentNo decimal(2,0) not null comment '?R?????g???'
1583
  , ParentNo decimal(2,0) not null comment '?e?R?????g???'
1584
  , ApproValComment varchar(300) comment '?w???E?A???R?????g'
1585
  , EntryDate datetime not null comment '?o?^???t'
1586
  , UpdateDate datetime not null comment '?X?V???t'
1587
  , constraint personapprovalcomment_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,CommentNo)
1588
) comment '?S??????F?R?????g?f?[?^' ;
1589

1590
-- ?S??????????}?X?^
1591
drop table persondepartmentmaster cascade;
1592

1593
create table persondepartmentmaster (
1594
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1595
  , DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1596
  , AffiliationFlg decimal(1,0) not null comment '?????t???O'
1597
  , EntryDate datetime not null comment '?o?^???t'
1598
  , UpdateDate datetime not null comment '?X?V???t'
1599
  , constraint persondepartmentmaster_PKC primary key (PersonCode,DepartmentCode)
1600
) comment '?S??????????}?X?^' ;
1601

1602
create index PersonDepartmentMaster_Index1
1603
  on persondepartmentmaster(PersonCode);
1604

1605
create index PersonDepartmentMaster_Index2
1606
  on persondepartmentmaster(DepartmentCode);
1607

1608
-- ?S????}?X?^
1609
drop table personinchargemaster cascade;
1610

1611
create table personinchargemaster (
1612
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1613
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
1614
  , PersonName varchar(60) not null comment '?S?????'
1615
  , StartDate date not null comment '?g?p?J?n?N????'
1616
  , EndDate date comment '?g?p?I???N????'
1617
  , PassWord varchar(16) comment '?p?X???[?h'
1618
  , SecurityManagement decimal(1,0) not null comment '?@????'
1619
  , SecCode decimal(2,0) unsigned not null comment '???????'
1620
  , MsgBackColor varchar(8) comment '???b?Z?[?W?w?i?F'
1621
  , DisplayString varchar(20) comment '?\???E???????'
1622
  , DepartmentCode decimal(5,0) unsigned comment '?????R?[?h'
1623
  , MonthlySalary decimal(11,0) not null comment '???????z'
1624
  , YearSalary decimal(12,0) not null comment '?N????z'
1625
  , Qualification varchar(120) comment '???i?????'
1626
  , SealPrintName varchar(5) comment '???\????'
1627
  , EmployeeClassFlg decimal(1,0) not null comment '?????'
1628
  , LedgerFlg decimal(1,0) not null comment '???v?Z???t???O'
1629
  , CommutingDistance decimal(5,2) not null comment '??????'
1630
  , CommuteCosts decimal(5,0) not null comment '??????'
1631
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1632
  , EntryDate datetime not null comment '?o?^???t'
1633
  , UpdateDate datetime not null comment '?X?V???t'
1634
  , constraint personinchargemaster_PKC primary key (PersonCode)
1635
) comment '?S????}?X?^' ;
1636

1637
create index PersonInChargeMaster_Index1
1638
  on personinchargemaster(StartDate);
1639

1640
create index PersonInChargeMaster_Index2
1641
  on personinchargemaster(DepartmentCode);
1642

1643
-- ?S??????^?}?X?^
1644
drop table personsalarymaster cascade;
1645

1646
create table personsalarymaster (
1647
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1648
  , StartDate date not null comment '?g?p?J?n?N????'
1649
  , MonthlySalary decimal(11,0) not null comment '???????z'
1650
  , YearSalary decimal(12,0) not null comment '?N????z'
1651
  , EntryDate datetime not null comment '?o?^???t'
1652
  , UpdateDate datetime not null comment '?X?V???t'
1653
  , constraint personsalarymaster_PKC primary key (PersonCode,StartDate)
1654
) comment '?S??????^?}?X?^' ;
1655

1656
create index PersonSalaryMaster_Index1
1657
  on personsalarymaster(PersonCode);
1658

1659
create index PersonSalaryMaster_Index2
1660
  on personsalarymaster(StartDate);
1661

1662
-- ?w???????f?[?^
1663
drop table pointingoutcomment cascade;
1664

1665
create table pointingoutcomment (
1666
  ConstructionCode decimal(10,0) not null comment '?H???R?[?h'
1667
  , ProcessNo smallint(6) not null comment '????????i??????j'
1668
  , SeqNo smallint(6) not null comment '????'
1669
  , PageCount smallint(6) not null comment '?y?[?W???'
1670
  , PersonCode decimal(8,0) not null comment '?L????R?[?h'
1671
  , DrowColor varchar(8) comment '?`??F'
1672
  , CommentMessage varchar(1000) comment '???b?Z?[?W'
1673
  , StartPointX smallint(6) not null comment '?w?E?????u?w'
1674
  , StartPointY smallint(6) not null comment '?w?E?????u?x'
1675
  , CurrentPointX smallint(6) not null comment '??????u?w'
1676
  , CurrentPointY smallint(6) not null comment '??????u?x'
1677
  , CurrentWidth smallint(6) not null comment '?\???T?C?YWidth'
1678
  , CurrentHeight smallint(6) not null comment '?\???T?C?YHeigth'
1679
  , EntryDate datetime not null comment '?o?^???t'
1680
  , UpdateDate datetime not null comment '?X?V???t'
1681
  , constraint pointingoutcomment_PKC primary key (ConstructionCode,ProcessNo,SeqNo)
1682
) comment '?w???????f?[?^' ;
1683

1684
-- ?????????????c???^?f?[?^
1685
drop table proceedingsdata cascade;
1686

1687
create table proceedingsdata (
1688
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1689
  , ProceedingsDataDate date not null comment '?c???^????'
1690
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1691
  , EndMeetingTime decimal(4,0) unsigned not null comment '??c????I??'
1692
  , CreatorCode decimal(8,0) not null comment '????R?[?h'
1693
  , PalceFlag decimal(1,0) not null comment '???n?t???O'
1694
  , MeetingPalce varchar(120) comment '???????'
1695
  , EntryDate datetime not null comment '?o?^???t'
1696
  , UpdateDate datetime not null comment '?X?V???t'
1697
  , constraint proceedingsdata_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime)
1698
) comment '?????????????c???^?f?[?^' ;
1699

1700
-- ?????????????c???^?f?[?^?i?o???j
1701
drop table proceedingsdataattend cascade;
1702

1703
create table proceedingsdataattend (
1704
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1705
  , ProceedingsDataDate date not null comment '?c???^????'
1706
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1707
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1708
  , Department varchar(20) comment '?o??????'
1709
  , AttendName varchar(10) comment '?o??????'
1710
  , EntryDate datetime not null comment '?o?^???t'
1711
  , UpdateDate datetime not null comment '?X?V???t'
1712
  , constraint proceedingsdataattend_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
1713
) comment '?????????????c???^?f?[?^?i?o???j' ;
1714

1715
-- ?????????????c???^?f?[?^?i????j
1716
drop table proceedingsdatadetail cascade;
1717

1718
create table proceedingsdatadetail (
1719
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1720
  , ProceedingsDataDate date not null comment '?c???^????'
1721
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1722
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1723
  , TitleNo varchar(5) comment '?c????'
1724
  , Title varchar(20) comment '?c??'
1725
  , ContentsText varchar(50) comment '???e'
1726
  , EntryDate datetime not null comment '?o?^???t'
1727
  , UpdateDate datetime not null comment '?X?V???t'
1728
  , constraint proceedingsdatadetail_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
1729
) comment '?????????????c???^?f?[?^?i????j' ;
1730

1731
-- ???F?f?[?^
1732
drop table processapproval cascade;
1733

1734
create table processapproval (
1735
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1736
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1737
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1738
  , SeqNo decimal(2,0) not null comment '?}??'
1739
  , PersonCode decimal(8,0) unsigned not null comment '?\???E???F??R?[?h'
1740
  , PetitionApprovalDate datetime not null comment '?\???E???F???t'
1741
  , ApprovalLimitDates datetime not null comment '???F??]??'
1742
  , ApprovalStatus decimal(1,0) not null comment '???F???'
1743
  , InputComment varchar(300) comment '?R?????g'
1744
  , EntryDate datetime not null comment '?o?^???t'
1745
  , UpdateDate datetime not null comment '?X?V???t'
1746
  , constraint processapproval_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SeqNo)
1747
) comment '???F?f?[?^' ;
1748

1749
-- ???F?R?????g?f?[?^
1750
drop table processapprovalcomment cascade;
1751

1752
create table processapprovalcomment (
1753
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1754
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1755
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1756
  , CommentNo decimal(2,0) not null comment '?R?????g???'
1757
  , ParentNo decimal(2,0) not null comment '?e?R?????g???'
1758
  , ApproValComment varchar(300) comment '?w???E?A???R?????g'
1759
  , EntryDate datetime not null comment '?o?^???t'
1760
  , UpdateDate datetime not null comment '?X?V???t'
1761
  , constraint processapprovalcomment_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,CommentNo)
1762
) comment '???F?R?????g?f?[?^' ;
1763

1764
-- ???F????f?[?^
1765
drop table processapprovaldetail cascade;
1766

1767
create table processapprovaldetail (
1768
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1769
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1770
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1771
  , SerialNo decimal(2,0) unsigned not null comment '?}??'
1772
  , LinkCode decimal(10,0) not null comment '?????N???'
1773
  , EntryDate datetime not null comment '?o?^???t'
1774
  , UpdateDate datetime not null comment '?X?V???t'
1775
  , constraint processapprovaldetail_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SerialNo)
1776
) comment '???F????f?[?^' ;
1777

1778
-- ?N?????}?X?^
1779
drop table processexcutemaster cascade;
1780

1781
create table processexcutemaster (
1782
  SecCode decimal(2,0) unsigned not null comment '???????'
1783
  , ExecCode decimal(4,0) unsigned not null comment '?N?????????'
1784
  , EditFlg decimal(1,0) not null comment '??W?t???O'
1785
  , EntryDate datetime not null comment '?o?^???t'
1786
  , UpdateDate datetime not null comment '?X?V???t'
1787
  , constraint processexcutemaster_PKC primary key (SecCode,ExecCode)
1788
) comment '?N?????}?X?^' ;
1789

1790
create index ProcessExcuteMaster_Index1
1791
  on processexcutemaster(SecCode);
1792

1793
create index ProcessExcuteMaster_Index2
1794
  on processexcutemaster(ExecCode);
1795

1796
-- ???????f?[?^
1797
drop table purchaseorder cascade;
1798

1799
create table purchaseorder (
1800
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1801
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1802
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1803
  , CreateDate date comment '?????t'
1804
  , OrderPrice decimal(12,0) not null comment '???????z'
1805
  , LastRowStringDate date not null comment '??I?s?\?????t'
1806
  , OrderSheetType decimal(1,0) not null comment '???E?{???t???O'
1807
  , PaymentTerms decimal(1,0) not null comment '?x????????'
1808
  , CashRatio decimal(4,1) not null comment '?????????i???j'
1809
  , BillPeriod decimal(4,0) not null comment '??`????'
1810
  , PrePayments decimal(1,0) not null comment '?O????'
1811
  , PrePaymentsDays decimal(3,0) not null comment '?O????????'
1812
  , PrePaymentsPrice decimal(12,0) not null comment '?O???????z'
1813
  , PartialPayment decimal(1,0) not null comment '??????'
1814
  , PartialPaymentMounth decimal(2,0) unsigned not null comment '???????????'
1815
  , PartialPaymentDay1 decimal(2,0) unsigned not null comment '???????????'
1816
  , PartialPaymentDay2 decimal(2,0) unsigned not null comment '???????x????'
1817
  , PartialPaymentPrice decimal(12,0) not null comment '?????????z'
1818
  , CompletionPayment decimal(1,0) not null comment '???n??????x??'
1819
  , CompletionPaymentDays decimal(3,0) unsigned not null comment '???n??????x??????'
1820
  , CompletionPaymentPrice decimal(12,0) not null comment '???n??????x?????z'
1821
  , LeadEngineerCode decimal(8,0) comment '??C?Z?p??R?[?h'
1822
  , LeadEngineerName varchar(60) comment '??C?Z?p???'
1823
  , SafetyOfficerCode decimal(8,0) comment '???S?????R?[?h'
1824
  , SafetyOfficerName varchar(60) comment '???S??????'
1825
  , WorkersCount decimal(3,0) unsigned comment '??????'
1826
  , PrintoutDate date not null comment '????N????'
1827
  , EntryDate datetime not null comment '?o?^???t'
1828
  , UpdateDate datetime not null comment '?X?V???t'
1829
  , constraint purchaseorder_PKC primary key (ConstructionCode,SeqNo)
1830
) comment '???????f?[?^' ;
1831

1832
-- ?????????t?f?[?^
1833
drop table purchaseorderdate cascade;
1834

1835
create table purchaseorderdate (
1836
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1837
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1838
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1839
  , SendDate date not null comment '???????X????'
1840
  , ReturnDate date not null comment '???????????'
1841
  , ReturnCheckDate date not null comment '??????????m?F??'
1842
  , EntryDate datetime not null comment '?o?^???t'
1843
  , UpdateDate datetime not null comment '?X?V???t'
1844
  , constraint purchaseorderdate_PKC primary key (ConstructionCode,SeqNo)
1845
) comment '?????????t?f?[?^' ;
1846

1847
-- ??????????f?[?^
1848
drop table purchaseorderdetail cascade;
1849

1850
create table purchaseorderdetail (
1851
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1852
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1853
  , GroupCount decimal(1,0) not null comment '?O???[?v???'
1854
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1855
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1856
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1857
  , FirstString varchar(120) comment '?H??E?i??'
1858
  , SecondString varchar(120) comment '???e????'
1859
  , UnitCount decimal(8,2) not null comment '????'
1860
  , UnitName varchar(30) comment '?P??'
1861
  , UnitPrice decimal(10,0) not null comment '?P??'
1862
  , OrdersLinePrice decimal(12,0) comment '???z'
1863
  , SourceCode decimal(10,0) unsigned not null comment '???H?????'
1864
  , SourceDetailCnt decimal(4,0) unsigned not null comment '????????'
1865
  , DataTypeFlag decimal(1,0) unsigned not null comment '?f?[?^?^?C?v?t???O'
1866
  , EntryDate datetime not null comment '?o?^???t'
1867
  , UpdateDate datetime not null comment '?X?V???t'
1868
  , constraint purchaseorderdetail_PKC primary key (ConstructionCode,SeqNo,GroupCount,LineCount)
1869
) comment '??????????f?[?^' ;
1870

1871
create index POrderDetail_Index1
1872
  on purchaseorderdetail(SourceCode);
1873

1874
-- ?????f?[?^
1875
drop table requestdata cascade;
1876

1877
create table requestdata (
1878
  REQUESTNO decimal(9,0) not null comment '????No'
1879
  , MAINCONSTRUCTIONCODE decimal(10,0) not null comment '?{?H?????'
1880
  , CONSTRUCTIONNAME varchar(120) not null comment '?H??????'
1881
  , CONTRACTAMOUNT decimal(10,0) not null comment '???????z'
1882
  , PAIDAMOUNT decimal(10,0) not null comment '????????z'
1883
  , REQUESTAMOUNT0 decimal(10,0) not null comment '???????z?O'
1884
  , REQUESTAMOUNT1 decimal(10,0) not null comment '???????z?P'
1885
  , REQUESTAMOUNT2 decimal(10,0) comment '???????z?Q'
1886
  , REQUESTAMOUNT3 decimal(10,0) comment '???????z?R'
1887
  , REQUESTAMOUNT4 decimal(10,0) comment '???????z?S'
1888
  , REQUESTAMOUNT5 decimal(10,0) comment '???????z?T'
1889
  , REQUESTAMOUNT6 decimal(10,0) comment '???????z?U'
1890
  , UNCLAIMEDAMOUNT decimal(10,0) not null comment '?????c???z'
1891
  , UNPAIDAMOUNT decimal(10,0) not null comment '?????????z'
1892
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1893
  , NOTE varchar(120) not null comment '???l'
1894
  , ENTRYDATE datetime not null comment '?o?^?N????'
1895
  , UPDATEDATE datetime not null comment '?X?V?N????'
1896
  , constraint requestdata_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE)
1897
) comment '?????f?[?^' ;
1898

1899
-- ?????f?[?^????
1900
drop table requestdatadetail cascade;
1901

1902
create table requestdatadetail (
1903
  REQUESTNO decimal(9,0) not null comment '????No'
1904
  , MAINCONSTRUCTIONCODE decimal(10,0) not null comment '?{?H?????'
1905
  , CONSTRUCTIONCODE decimal(10,0) not null comment '?H?????'
1906
  , CONSTRUCTIONKIND decimal(1,0) not null comment '?H????'
1907
  , REQUESTAMOUNT decimal(10,0) not null comment '???????z'
1908
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1909
  , ENTRYDATE datetime not null comment '?o?^?N????'
1910
  , UPDATEDATE datetime not null comment '?X?V?N????'
1911
  , constraint requestdatadetail_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE,CONSTRUCTIONCODE,CONSTRUCTIONKIND)
1912
) comment '?????f?[?^????' ;
1913

1914
-- ?????w?b?_
1915
drop table requesthead cascade;
1916

1917
create table requesthead (
1918
  REQUESTNO decimal(9,0) not null comment '????No'
1919
  , REQCONSTRUCTIONCODE decimal(10,0) not null comment '?????H?????'
1920
  , ORDERNO decimal(2,0) not null comment '??t???'
1921
  , REQUESTMONTH decimal(6,0) not null comment '??????'
1922
  , ORDERERSDIVISION decimal(5,0) not null comment '???????'
1923
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1924
  , ORDERERSNAME varchar(120) not null comment '???????'
1925
  , REQCONSTRUCTIONNAME varchar(120) not null comment '?????H??????'
1926
  , REQUESTTOTALAMOUNT decimal(10,0) not null comment '???????z???v'
1927
  , REQUESTAMOUNT decimal(10,0) not null comment '???????z'
1928
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1929
  , UNPAIDAMOUNT decimal(10,0) comment '??????'
1930
  , NOTE varchar(120) comment '???l'
1931
  , ASSIGNEDFLG decimal(1,0) comment '??????t???O'
1932
  , INVOICENO decimal(9,0) not null comment '??????No'
1933
  , ENTRYDATE datetime not null comment '?o?^?N????'
1934
  , UPDATEDATE datetime not null comment '?X?V?N????'
1935
  , constraint requesthead_PKC primary key (REQUESTNO)
1936
) comment '?????w?b?_' ;
1937

1938
alter table requesthead add unique REQCONSTRUCTIONCODE (REQCONSTRUCTIONCODE,ORDERNO) ;
1939

1940
-- ?????????t?f?[?^
1941
drop table requestorderdate cascade;
1942

1943
create table requestorderdate (
1944
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1945
  , InvoiceNo decimal(9,0) not null comment '??????No'
1946
  , SendDate date not null comment '???????????X????'
1947
  , EntryDate datetime not null comment '?o?^???t'
1948
  , UpdateDate datetime not null comment '?X?V???t'
1949
  , constraint requestorderdate_PKC primary key (ConstructionCode,InvoiceNo)
1950
) comment '?????????t?f?[?^' ;
1951

1952
-- ????O???t?f?[?^
1953
drop table salesgraphdata cascade;
1954

1955
create table salesgraphdata (
1956
  GraphDataCode decimal(8,0) not null comment '?O???t?f?[?^?R?[?h'
1957
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
1958
  , SalesDataDays date not null comment '????N??'
1959
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
1960
  , DataName varchar(100) not null comment '?f?[?^?\??????'
1961
  , SalesAmount decimal(10,0) not null comment '????f?[?^'
1962
  , AdministrativeExpense decimal(10,0) not null comment '???E?????o??'
1963
  , GrossProfit decimal(10,0) not null comment '?e???v'
1964
  , NetIncome decimal(10,0) not null comment '?????v(???v)'
1965
  , EntryDate datetime not null comment '?o?^???t'
1966
  , UpdateDate datetime not null comment '?X?V???t'
1967
  , constraint salesgraphdata_PKC primary key (GraphDataCode,ConstructionPeriod,SalesDataDays)
1968
) comment '????O???t?f?[?^' ;
1969

1970
create index SalesGraphData_Idx1
1971
  on salesgraphdata(DisplayOrder);
1972

1973
create index SalesGraphData_idx2
1974
  on salesgraphdata(ConstructionPeriod);
1975

1976
-- ?????}?X?^
1977
drop table securitymaster cascade;
1978

1979
create table securitymaster (
1980
  SecCode decimal(2,0) unsigned not null comment '???????'
1981
  , DisplayOrder decimal(2,0) not null comment '?\????'
1982
  , SecName varchar(60) not null comment '????????'
1983
  , SecRank decimal(1,0) not null comment '?????????N'
1984
  , SecRange decimal(1,0) not null comment '???????'
1985
  , GeneralAffairs decimal(1,0) not null comment '????????t???O'
1986
  , SelectBackColor varchar(8) not null comment '?I??w?i?F'
1987
  , EntryDate datetime not null comment '?o?^???t'
1988
  , UpdateDate datetime not null comment '?X?V???t'
1989
  , constraint securitymaster_PKC primary key (SecCode)
1990
) comment '?????}?X?^' ;
1991

1992
create index SecurityMaster_Index1
1993
  on securitymaster(DisplayOrder);
1994

1995
create index SecurityMaster_Index2
1996
  on securitymaster(SecRank);
1997

1998
create index SecurityMaster_Index3
1999
  on securitymaster(SecRange);
2000

2001
-- ???S?p?g???[???f?[?^
2002
drop table sfpdata cascade;
2003

2004
create table sfpdata (
2005
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
2006
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
2007
  , RequestDate datetime not null comment '?p?g???[???v??????'
2008
  , PersonCode decimal(8,0) unsigned not null comment '?\????R?[?h'
2009
  , StringValue varchar(300) comment '?R?????g'
2010
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
2011
  , EntryDate datetime not null comment '?o?^???t'
2012
  , UpdateDate datetime not null comment '?X?V???t'
2013
  , constraint sfpdata_PKC primary key (ConstructionCode,DataCount)
2014
) comment '???S?p?g???[???f?[?^' ;
2015

2016
create index SFPData_Index1
2017
  on sfpdata(RequestDate);
2018

2019
-- ???S?p?g???[??????f?[?^
2020
drop table sfpdatadetail cascade;
2021

2022
create table sfpdatadetail (
2023
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
2024
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
2025
  , SeqNo decimal(2,0) unsigned not null comment '?f?[?^?}??'
2026
  , CompanyCode decimal(8,0) unsigned not null comment '??????R?[?h'
2027
  , EntryDate datetime not null comment '?o?^???t'
2028
  , UpdateDate datetime not null comment '?X?V???t'
2029
  , constraint sfpdatadetail_PKC primary key (ConstructionCode,DataCount,SeqNo)
2030
) comment '???S?p?g???[??????f?[?^' ;
2031

2032
-- ??????{?H?H??o?^?\???f?[?^
2033
drop table subconstrjobitemregist cascade;
2034

2035
create table subconstrjobitemregist (
2036
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2037
  , CreateDate date not null comment '????'
2038
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2039
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2040
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2041
  , EntryDate datetime not null comment '?o?^???t'
2042
  , UpdateDate datetime not null comment '?X?V???t'
2043
  , constraint subconstrjobitemregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
2044
) comment '??????{?H?H??o?^?\???f?[?^' ;
2045

2046
-- ??????E?????N?o?^?\???f?[?^
2047
drop table subconstrjoblinkregist cascade;
2048

2049
create table subconstrjoblinkregist (
2050
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2051
  , CreateDate date not null comment '????'
2052
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2053
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2054
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
2055
  , EntryDate datetime not null comment '?o?^???t'
2056
  , UpdateDate datetime not null comment '?X?V???t'
2057
  , constraint subconstrjoblinkregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
2058
) comment '??????E?????N?o?^?\???f?[?^' ;
2059

2060
-- ??????o?^?\???f?[?^
2061
drop table subconstrregist cascade;
2062

2063
create table subconstrregist (
2064
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2065
  , CreateDate date not null comment '????'
2066
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2067
  , DataMode decimal(1,0) comment '?f?[?^??'
2068
  , SourceCode decimal(8,0) not null comment '??????R?[?h'
2069
  , PetitionPeriod decimal(4,0) unsigned not null comment '?\???N?x'
2070
  , CorporateStatusName varchar(40) comment '?@?l?i????'
2071
  , CorporateStatusPoint decimal(1,0) not null comment '?@?l?i?????u'
2072
  , CompanyName varchar(100) not null comment '???????'
2073
  , CEOPositionName varchar(60) comment '??\???E??'
2074
  , CEOName varchar(60) comment '??\?????'
2075
  , ContactPersonName varchar(60) comment '?S???????'
2076
  , ZipCode varchar(8) comment '?X????'
2077
  , Address1 varchar(60) comment '?Z???P'
2078
  , Address2 varchar(60) comment '?Z??2'
2079
  , Address3 varchar(60) comment '?Z??3'
2080
  , CellPhoneNumber varchar(13) comment '?g??d?b???'
2081
  , MailAddress varchar(257) comment '???[???A?h???X'
2082
  , PhoneNumber varchar(13) comment '?d?b???'
2083
  , FaxNumber varchar(13) comment 'FAX???'
2084
  , JapaneseSyllabary varchar(2) comment '50?????'
2085
  , StartDate date not null comment '????J?n?N????'
2086
  , Note varchar(300) comment '???l'
2087
  , labourKind decimal(1,0) not null comment '?x???????E????'
2088
  , OrderDate date comment '?\????'
2089
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
2090
  , EntryDate datetime not null comment '?o?^???t'
2091
  , UpdateDate datetime not null comment '?X?V???t'
2092
  , constraint subconstrregist_PKC primary key (PersonCode,CreateDate,SeqNo)
2093
) comment '??????o?^?\???f?[?^' ;
2094

2095
-- ??????H??}?X?^
2096
drop table subcontractoritemmaster cascade;
2097

2098
create table subcontractoritemmaster (
2099
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2100
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2101
  , ItemName varchar(120) not null comment '?H????'
2102
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2103
  , EntryDate datetime not null comment '?o?^???t'
2104
  , UpdateDate datetime not null comment '?X?V???t'
2105
  , constraint subcontractoritemmaster_PKC primary key (ItemCode)
2106
) comment '??????H??}?X?^' ;
2107

2108
-- ??????E??}?X?^
2109
drop table subcontractorjobcategory cascade;
2110

2111
create table subcontractorjobcategory (
2112
  JobCategoryCode decimal(5,0) not null comment '?E??L?['
2113
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2114
  , JobCategoryName varchar(120) not null comment '?E????'
2115
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2116
  , EntryDate datetime not null comment '?o?^???t'
2117
  , UpdateDate datetime not null comment '?X?V???t'
2118
  , constraint subcontractorjobcategory_PKC primary key (JobCategoryCode)
2119
) comment '??????E??}?X?^' ;
2120

2121
-- ??????{?H?H??f?[?^
2122
drop table subcontractorjobitem cascade;
2123

2124
create table subcontractorjobitem (
2125
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2126
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2127
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2128
  , EntryDate datetime not null comment '?o?^???t'
2129
  , UpdateDate datetime not null comment '?X?V???t'
2130
  , constraint subcontractorjobitem_PKC primary key (CompanyCode,ItemCode)
2131
) comment '??????{?H?H??f?[?^' ;
2132

2133
create index SubContractorJobItem_Index1
2134
  on subcontractorjobitem(CompanyCode);
2135

2136
create index SubContractorJobItem_Index2
2137
  on subcontractorjobitem(ItemCode);
2138

2139
-- ??????E?????N?}?X?^
2140
drop table subcontractorjoblink cascade;
2141

2142
create table subcontractorjoblink (
2143
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2144
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
2145
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2146
  , EntryDate datetime not null comment '?o?^???t'
2147
  , UpdateDate datetime not null comment '?X?V???t'
2148
  , constraint subcontractorjoblink_PKC primary key (CompanyCode,JobCategoryCode)
2149
) comment '??????E?????N?}?X?^' ;
2150

2151
create index SubContractorJobLink_Index1
2152
  on subcontractorjoblink(CompanyCode);
2153

2154
create index SubContractorJobLink_Index2
2155
  on subcontractorjoblink(JobCategoryCode);
2156

2157
-- ??????}?X?^
2158
drop table subcontractormaster cascade;
2159

2160
create table subcontractormaster (
2161
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2162
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2163
  , CorporateStatusName varchar(40) comment '?@?l?i????'
2164
  , CorporateStatusPoint decimal(1,0) not null comment '?@?l?i?????u'
2165
  , CompanyName varchar(100) not null comment '???????'
2166
  , CEOPositionName varchar(60) comment '??\???E??'
2167
  , CEOName varchar(60) comment '??\?????'
2168
  , ContactPersonName varchar(60) comment '?S???????'
2169
  , ZipCode varchar(8) comment '?X????'
2170
  , Address1 varchar(60) comment '?Z???P'
2171
  , Address2 varchar(60) comment '?Z??2'
2172
  , Address3 varchar(60) comment '?Z??3'
2173
  , CellPhoneNumber varchar(13) comment '?g??d?b???'
2174
  , MailAddress varchar(257) comment '???[???A?h???X'
2175
  , PhoneNumber varchar(13) comment '?d?b???'
2176
  , FaxNumber varchar(13) comment 'FAX???'
2177
  , JapaneseSyllabary varchar(2) comment '50?????'
2178
  , StartDate date not null comment '????J?n?N????'
2179
  , Note varchar(300) comment '???l'
2180
  , labourKind decimal(1,0) not null comment '?x???????E????'
2181
  , DeleteFlg decimal(1,0) default '0' not null comment '???t???O'
2182
  , EntryDate datetime not null comment '?o?^???t'
2183
  , UpdateDate datetime not null comment '?X?V???t'
2184
  , constraint subcontractormaster_PKC primary key (CompanyCode)
2185
) comment '??????}?X?^' ;
2186

2187
create index SubContractorMaster_Index1
2188
  on subcontractormaster(JapaneseSyllabary);
2189

2190
-- ?d????}?X?^
2191
drop table suppliersmaster cascade;
2192

2193
create table suppliersmaster (
2194
  SuppliersCode decimal(5,0) unsigned not null comment '?d????R?[?h'
2195
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2196
  , SuppliersName1 varchar(60) not null comment '?d????1'
2197
  , SuppliersName2 varchar(60) comment '?d?????Q'
2198
  , ZipCode varchar(8) comment '?X????'
2199
  , Address1 varchar(60) comment '?Z???P'
2200
  , Address2 varchar(60) comment '?Z??2'
2201
  , Address3 varchar(60) comment '?Z??3'
2202
  , PhoneNumber varchar(13) comment '?d?b???'
2203
  , FaxNumber varchar(13) comment 'FAX???'
2204
  , Note varchar(300) comment '???l'
2205
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2206
  , EntryDate datetime not null comment '?o?^???t'
2207
  , UpdateDate datetime not null comment '?X?V???t'
2208
  , constraint suppliersmaster_PKC primary key (SuppliersCode)
2209
) comment '?d????}?X?^' ;
2210

2211
-- ?V?X?e???N???m?F?f?[?^
2212
drop table systemexecute cascade;
2213

2214
create table systemexecute (
2215
  PrimaryCode tinyint(4) not null comment '?L?[????'
2216
  , TargetDate date not null comment '?N?????t'
2217
  , SystemVersion int(11) not null comment '?{??E????o?[?W????'
2218
  , UpDateCopyVersion int(11) not null comment '?R?s?[?o?[?W????'
2219
  , EntryDate datetime not null comment '?o?^???t'
2220
  , UpdateDate datetime not null comment '?X?V???t'
2221
  , constraint systemexecute_PKC primary key (PrimaryCode)
2222
) comment '?V?X?e???N???m?F?f?[?^' ;
2223

2224
-- ????}?X?^
2225
drop table systemmaster cascade;
2226

2227
create table systemmaster (
2228
  SystemCode decimal(3,0) unsigned not null comment '???R?[?h'
2229
  , CompanyName1 varchar(60) not null comment '?????P'
2230
  , CompanyName2 varchar(60) comment '?????Q'
2231
  , CEOName varchar(60) not null comment '??\?????'
2232
  , CEOPositionName varchar(60) comment '??\???E??'
2233
  , ZipCode varchar(8) not null comment '?X????'
2234
  , Address1 varchar(60) not null comment '?Z???P'
2235
  , Address2 varchar(60) comment '?Z??2'
2236
  , Address3 varchar(60) comment '?Z??3'
2237
  , PhoneNumber varchar(13) not null comment '?d?b???'
2238
  , FaxNumber varchar(13) comment 'FAX???'
2239
  , HomePageURL varchar(120) comment '?z?[???y?[?WURL'
2240
  , ConsumptionTax decimal(4,2) not null comment '?????'
2241
  , CooperationRate decimal(4,2) not null comment '???????'
2242
  , StatutoryWelfareRate decimal(4,2) not null comment '?@???????'
2243
  , FuelPrice decimal(5,2) not null comment '?R???L???P??'
2244
  , AreaDistance decimal(5,2) not null comment '????u????????'
2245
  , ExcelSavePath varchar(120) comment 'Excel????p?X'
2246
  , BusinessPeriod smallint(6) not null comment '????c?????'
2247
  , ConstrYear smallint(6) not null comment '????H???N?x'
2248
  , BusinessBeginDate datetime not null comment '?c????????'
2249
  , ConstrBeginDate datetime not null comment '?H???N?x?????'
2250
  , BusinessCompDate datetime not null comment '?c?????????'
2251
  , ConstrCompDate datetime not null comment '?H???N?x??????'
2252
  , ConstructionNoBase decimal(1,0) not null comment '?H????????l'
2253
  , SloganString1 varchar(100) comment '?W??1'
2254
  , SloganString2 varchar(100) comment '?W??2'
2255
  , SloganString3 varchar(100) comment '?W??3'
2256
  , EntryDate datetime not null comment '?o?^???t'
2257
  , UpdateDate datetime not null comment '?X?V???t'
2258
  , constraint systemmaster_PKC primary key (SystemCode)
2259
) comment '????}?X?^' ;
2260

2261
-- ?????}?X?^
2262
drop table termmaster cascade;
2263

2264
create table termmaster (
2265
  ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
2266
  , FieldNo decimal(2,0) not null comment '?`?F?b?N???t?B?[???h???'
2267
  , SeqNo decimal(2,0) not null comment '?}??'
2268
  , DisplayOrder decimal(2,0) not null comment '?\????'
2269
  , CheckSchdule decimal(1,0) not null comment '?`?F?b?N?^?C?~???O'
2270
  , TermDays decimal(3,0) not null comment '?o???'
2271
  , SendTitile varchar(100) comment '?^?C?g??'
2272
  , SendMessage varchar(100) comment '???b?Z?[?W'
2273
  , BackColor varchar(8) comment '?w?i?F'
2274
  , ForeColor varchar(8) comment '?????F'
2275
  , EntryDate datetime not null comment '?o?^???t'
2276
  , UpdateDate datetime not null comment '?X?V???t'
2277
  , constraint termmaster_PKC primary key (ConstructionStatusFlg,FieldNo,SeqNo)
2278
) comment '?????}?X?^' ;
2279

2280
create index TermMaster_Index1
2281
  on termmaster(DisplayOrder);
2282

2283
-- ?o?????f?[?^
2284
drop table tranceportdailydata cascade;
2285

2286
create table tranceportdailydata (
2287
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
2288
  , AttendanceDate date not null comment '???????'
2289
  , StartDistance decimal(7,1) not null comment '?????o???L????'
2290
  , ComplateDistance decimal(7,1) not null comment '?????I???L????'
2291
  , TotalDistance decimal(6,1) not null comment '???????v?L????'
2292
  , OfficeGoFlg decimal(1,0) not null comment '???????o??t???O'
2293
  , OfficeOutFlg decimal(1,0) not null comment '???????A??t???O'
2294
  , TrancePayGoFlg decimal(1,0) not null comment '?L?????o??t???O'
2295
  , TrancePayOutFlg decimal(1,0) not null comment '?L?????A??t???O'
2296
  , WareHouseFlg decimal(1,0) not null comment '????u??t???O'
2297
  , EntryDate datetime not null comment '?o?^???t'
2298
  , UpdateDate datetime not null comment '?X?V???t'
2299
  , constraint tranceportdailydata_PKC primary key (PersonCode,AttendanceDate)
2300
) comment '?o?????f?[?^' ;
2301

2302
create index TranceportDailyData_Index1
2303
  on tranceportdailydata(AttendanceDate);
2304

2305
-- ?H?????o???}?X?^
2306
drop table typeexpensesmaster cascade;
2307

2308
create table typeexpensesmaster (
2309
  TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
2310
  , ExpensesPeriod smallint(6) not null comment '?????'
2311
  , NameCode decimal(5,0) unsigned not null comment '?o????R?[?h'
2312
  , ExpensesRaito decimal(4,2) not null comment '?o??'
2313
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2314
  , EntryDate datetime not null comment '?o?^???t'
2315
  , UpdateDate datetime not null comment '?X?V???t'
2316
  , constraint typeexpensesmaster_PKC primary key (TypeCode,ExpensesPeriod,NameCode)
2317
) comment '?H?????o???}?X?^' ;
2318

2319
-- ?P??}?X?^
2320
drop table unitmaster cascade;
2321

2322
create table unitmaster (
2323
  UnitKey decimal(5,0) unsigned not null comment '?P??L?['
2324
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2325
  , UnitName varchar(30) not null comment '?P?????'
2326
  , EntryDate datetime not null comment '?o?^???t'
2327
  , UpdateDate datetime not null comment '?X?V???t'
2328
  , constraint unitmaster_PKC primary key (UnitKey)
2329
) comment '?P??}?X?^' ;
2330

2331
create index UnitMaster_Index1
2332
  on unitmaster(DisplayOrder);
2333

2334
-- ????}?X?^
2335
drop table vehiclemaster cascade;
2336

2337
create table vehiclemaster (
2338
  VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2339
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2340
  , VehicleName varchar(100) not null comment '???????'
2341
  , RegistrationNumber varchar(30) comment '?o?^???'
2342
  , IdentificationNumber varchar(30) comment '?????'
2343
  , ModelCode varchar(30) comment '?^??'
2344
  , DepartmentCode decimal(5,0) unsigned not null comment '???????'
2345
  , VehicleScheduleFlg decimal(1,0) not null comment '????\??\???t???O'
2346
  , PurchaseDate date comment '?w????'
2347
  , PurchaseName varchar(30) comment '?w????'
2348
  , PurchaseContactPersons varchar(30) comment '?w????S????'
2349
  , PurchasePhone varchar(13) comment '?w????d?b???'
2350
  , LeaseDate date comment '???[?X?J?n??'
2351
  , LeaseDestination varchar(30) comment '???[?X??'
2352
  , LeaseContactPersons varchar(30) comment '???[?X??S????'
2353
  , LeasePhone varchar(13) comment '???[?X??d?b???'
2354
  , InsuranceCompany varchar(30) comment '?C???????'
2355
  , InsuranceContactPersons varchar(30) comment '?C???????S????'
2356
  , InsurancePhone varchar(13) comment '?C???????d?b???'
2357
  , Note varchar(300) comment '???l'
2358
  , EntryDate datetime comment '?o?^???t'
2359
  , UpdateDate datetime comment '?X?V???t'
2360
  , constraint vehiclemaster_PKC primary key (VehicleCode)
2361
) comment '????}?X?^' ;
2362

2363
-- ????L?^?f?[?^
2364
drop table vehiclerecorddata cascade;
2365

2366
create table vehiclerecorddata (
2367
  VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2368
  , DivisionCode decimal(2,0) unsigned not null comment '?f?[?^??'
2369
  , SeqNo decimal(2,0) not null comment '?}??'
2370
  , RecordDate date comment '???n??'
2371
  , Mileage mediumint(9) comment '???s????'
2372
  , Content varchar(100) comment '???e'
2373
  , PaymentCost decimal(10,0) comment '??p'
2374
  , EntryDate datetime not null comment '?o?^???t'
2375
  , UpdateDate datetime not null comment '?X?V???t'
2376
  , constraint vehiclerecorddata_PKC primary key (VehicleCode,DivisionCode,SeqNo)
2377
) comment '????L?^?f?[?^' ;
2378

2379
-- ????\??f?[?^
2380
drop table vehiclescheduledata cascade;
2381

2382
create table vehiclescheduledata (
2383
  TargetDate date not null comment '????'
2384
  , VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2385
  , MorningAfternoon decimal(1,0) not null comment '??O?E???'
2386
  , PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
2387
  , TargetYear year(4) not null comment '?Y???N'
2388
  , TargetMonth tinyint(3) unsigned not null comment '?Y????'
2389
  , TargetDay year(4) not null comment '?Y????'
2390
  , EntryDate datetime not null comment '?o?^???t'
2391
  , UpdateDate datetime not null comment '?X?V???t'
2392
  , constraint vehiclescheduledata_PKC primary key (TargetDate,VehicleCode,MorningAfternoon)
2393
) comment '????\??f?[?^' ;
2394

2395
create index VehicleScheduleData_Index1
2396
  on vehiclescheduledata(TargetYear);
2397

2398
create index VehicleScheduleData_Index2
2399
  on vehiclescheduledata(TargetMonth);
2400

2401
create index VehicleScheduleData_Index3
2402
  on vehiclescheduledata(TargetDay);
2403

2404
-- ?N?}?X?^
2405
drop table yearmaster cascade;
2406

2407
create table yearmaster (
2408
  years smallint(6) not null comment '?N'
2409
) comment '?N?}?X?^' ;
2410

2411
create index year_Index1
2412
  on yearmaster(years);
2413