プロジェクト

全般

プロフィール

統計
| リビジョン:

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

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

1
-- Project Name : noname
2
-- Date/Time    : 2018/02/27 8:14:07
3
-- Author       : Horiuchi
4
-- RDBMS Type   : MySQL
5
-- Application  : A5:SQL Mk-2
6

    
7
-- ?S????s???\??f?[?^
8
drop table if exists 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 if exists 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 if exists 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 if exists 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 if exists 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 if exists 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 if exists 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 if exists 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
-- ?H???????f?[?^?y???p?z
158
drop table if exists bk_constructionledger cascade;
159

    
160
create table bk_constructionledger (
161
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
162
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
163
  , CreatorCode decimal(8,0) comment '????R?[?h'
164
  , CreatorName varchar(60) comment '?????'
165
  , CreateDate date not null comment '????'
166
  , ConstructionTimes decimal(5,2) not null comment '?H???i?P??E???j'
167
  , ConstructionStart date not null comment '?_??H???J?n'
168
  , ConstructionEnd date not null comment '?_??H??????'
169
  , OrdersDecisionPrice decimal(14,0) not null comment '??????????z'
170
  , CompanyExpenses decimal(10,0) not null comment '???o???v'
171
  , DepartmentExpenses decimal(10,0) not null comment '?????o???v'
172
  , SalesExpenses decimal(10,0) not null comment '?c??o???v'
173
  , TotalPayment decimal(10,0) not null comment '???x???z'
174
  , GrossProfit decimal(10,0) not null comment '?e??'
175
  , Allowance decimal(10,0) not null comment '???^'
176
  , NetProfit decimal(10,0) not null comment '?????v'
177
  , ComplateFlg decimal(1,0) not null comment '????????t???O'
178
  , IntegrationFlg decimal(1,0) not null comment '????z??Z?t???O'
179
  , EntryDate datetime not null comment '?o?^???t'
180
  , UpdateDate datetime not null comment '?X?V???t'
181
  , constraint bk_constructionledger_PKC primary key (ConstructionCode)
182
) comment '?H???????f?[?^?y???p?z' ;
183

    
184
-- ?H??????????f?[?^?y???p?z
185
drop table if exists bk_constructionledgerdetail cascade;
186

    
187
create table bk_constructionledgerdetail (
188
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
189
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
190
  , LineCount decimal(5,0) unsigned not null comment '?s???'
191
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
192
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
193
  , FirstString varchar(120) comment '???????'
194
  , SecondString varchar(120) comment '?H?????e'
195
  , CompanyType decimal(1,0) not null comment '??????R?[?h?^?C?v'
196
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
197
  , CompanyName varchar(120) comment '?????????'
198
  , EstimatePrice decimal(12,0) not null comment '?\?Z?i????j???z'
199
  , ExecutionAmount decimal(12,0) not null comment '???s???z'
200
  , AmountConfigRate decimal(5,2) not null comment '???z?\????'
201
  , PaymentBurden decimal(12,0) not null comment '?x????U?z'
202
  , FixDataFlg decimal(1,0) not null comment '???f?[?^?t???O'
203
  , IndependentFlg decimal(1,0) not null comment '????f?[?^?t???O'
204
  , FluctuationFlg decimal(1,0) not null comment '?????f?[?^?t???O'
205
  , SalaryFlg decimal(1,0) not null comment '???^?U????'
206
  , SalaryDays decimal(4,0) not null comment '???^?U??????'
207
  , OperatingFlg decimal(1,0) not null comment '?S?????t???O'
208
  , SourceCode decimal(10,0) unsigned not null comment '???H?????'
209
  , JoinTitleFlg decimal(1,0) not null comment '?H??????^?C?g??'
210
  , SalaryOnRegist decimal(12,0) not null comment '?o?^?????z???^'
211
  , PurchaseOrderFlg decimal(2,0) not null comment '?????????s?t???O'
212
  , EntryDate datetime not null comment '?o?^???t'
213
  , UpdateDate datetime not null comment '?X?V???t'
214
  , constraint bk_constructionledgerdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
215
) comment '?H??????????f?[?^?y???p?z' ;
216

    
217
-- ?H?????????s?f?[?^?y???p?z
218
drop table if exists bk_constructionledgerexcute cascade;
219

    
220
create table bk_constructionledgerexcute (
221
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
222
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
223
  , LineCount decimal(5,0) unsigned not null comment '?s???'
224
  , ColumnCount decimal(3,0) not null comment '????'
225
  , PaymentAmount decimal(12,0) not null comment '?x?????z'
226
  , TargetMonth date not null comment '???N??'
227
  , EntryDate datetime not null comment '?o?^???t'
228
  , UpdateDate datetime not null comment '?X?V???t'
229
  , constraint bk_constructionledgerexcute_PKC primary key (ConstructionCode,GroupCount,LineCount,ColumnCount)
230
) comment '?H?????????s?f?[?^?y???p?z' ;
231

    
232
-- ??Z????f?[?^?y???p?z
233
drop table if exists bk_estimatedata cascade;
234

    
235
create table bk_estimatedata (
236
  SaveDate datetime not null comment '?????t'
237
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
238
  , LineCount decimal(3,0) unsigned not null comment '?s???'
239
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
240
  , FixedItemCode varchar(1) comment '?????L?['
241
  , ItemName varchar(120) comment '??????'
242
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
243
  , PriceValue decimal(14,0) not null comment '???z'
244
  , note varchar(60) comment '???l'
245
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
246
  , InputFlg decimal(1,0) not null comment '????t???O'
247
  , EntryDate datetime not null comment '?o?^???t'
248
  , UpdateDate datetime not null comment '?X?V???t'
249
  , constraint bk_estimatedata_PKC primary key (SaveDate,ConstructionCode,LineCount)
250
) comment '??Z????f?[?^?y???p?z' ;
251

    
252
-- ??Z????y?[?W?f?[?^?y???p?z
253
drop table if exists bk_estimatedatabody cascade;
254

    
255
create table bk_estimatedatabody (
256
  SaveDate datetime not null comment '?????t'
257
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
258
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
259
  , Category decimal(1,0) not null comment '?y?[?W??'
260
  , UnionComponentCode decimal(5,0) unsigned not null comment '?????\???L?['
261
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
262
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
263
  , SelectComponent decimal(5,0) unsigned not null comment '?I???\???L?['
264
  , PageTitle varchar(120) not null comment '?y?[?W?\????'
265
  , DetailLineCount decimal(3,0) unsigned not null comment '????s???'
266
  , EntryDate datetime not null comment '?o?^???t'
267
  , UpdateDate datetime not null comment '?X?V???t'
268
  , constraint bk_estimatedatabody_PKC primary key (SaveDate,ConstructionCode,PageCount)
269
) comment '??Z????y?[?W?f?[?^?y???p?z' ;
270

    
271
-- ??Z????f?[?^????y???p?z
272
drop table if exists bk_estimatedatadetail cascade;
273

    
274
create table bk_estimatedatadetail (
275
  SaveDate datetime not null comment '?????t'
276
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
277
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
278
  , LineCount decimal(3,0) unsigned not null comment '?s???'
279
  , DataType decimal(1,0) not null comment '?f?[?^???'
280
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
281
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
282
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
283
  , ItemName varchar(120) comment '??????'
284
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
285
  , Unitcount decimal(8,2) not null comment '????'
286
  , UnitName varchar(30) comment '?P?????'
287
  , UnitPrice decimal(9,2) not null comment '?P??'
288
  , LineTotal decimal(12,0) not null comment '???z'
289
  , note varchar(60) comment '???l'
290
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
291
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
292
  , InputFlg decimal(1,0) comment '????t???O'
293
  , EntryDate datetime not null comment '?o?^???t'
294
  , UpdateDate datetime not null comment '?X?V???t'
295
  , constraint bk_estimatedatadetail_PKC primary key (SaveDate,ConstructionCode,PageCount,LineCount)
296
) comment '??Z????f?[?^????y???p?z' ;
297

    
298
-- ?@?l?i?}?X?^
299
drop table if exists businesstypemaster cascade;
300

    
301
create table businesstypemaster (
302
  BusinessTypeCode decimal(5,0) unsigned not null comment '?@?l?i?R?[?h'
303
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
304
  , BusinessTypeName varchar(100) not null comment '???'
305
  , EntryDate datetime not null comment '?o?^???t'
306
  , UpdateDate datetime not null comment '?X?V???t'
307
  , constraint businesstypemaster_PKC primary key (BusinessTypeCode)
308
) comment '?@?l?i?}?X?^' ;
309

    
310
create index BusinessTypeMaster_Index1
311
  on businesstypemaster(DisplayOrder);
312

    
313
-- ????????}?X?^
314
drop table if exists commoncostlarge cascade;
315

    
316
create table commoncostlarge (
317
  LargeCode decimal(5,0) unsigned not null comment '????L?['
318
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
319
  , LargeName varchar(50) not null comment '???????'
320
  , CommentText varchar(120) comment '????????'
321
  , DeleteFlg decimal(1,0) not null comment '???t???O'
322
  , EntryDate datetime not null comment '?o?^???t'
323
  , UpdateDate datetime not null comment '?X?V???t'
324
  , constraint commoncostlarge_PKC primary key (LargeCode)
325
) comment '????????}?X?^' ;
326

    
327
-- ?????H???A?}?X?^
328
drop table if exists commoncostlinkms cascade;
329

    
330
create table commoncostlinkms (
331
  LargeCode decimal(5,0) unsigned not null comment '????L?['
332
  , MiddleCode decimal(5,0) unsigned not null comment '??????L?['
333
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
334
  , EntryDate datetime comment '?o?^???t'
335
  , UpdateDate datetime comment '?X?V???t'
336
  , constraint commoncostlinkms_PKC primary key (LargeCode,MiddleCode,ItemCode)
337
) comment '?????H???A?}?X?^' ;
338

    
339
-- ?????????}?X?^
340
drop table if exists commoncostmiddle cascade;
341

    
342
create table commoncostmiddle (
343
  LargeCode decimal(5,0) unsigned not null comment '????L?['
344
  , MiddleCode decimal(5,0) unsigned not null comment '??????L?['
345
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
346
  , MiddleName varchar(50) not null comment '?????????'
347
  , CommentText varchar(120) comment '????????'
348
  , DeleteFlg decimal(1,0) not null comment '???t???O'
349
  , EntryDate datetime not null comment '?o?^???t'
350
  , UpdateDate datetime not null comment '?X?V???t'
351
  , constraint commoncostmiddle_PKC primary key (LargeCode,MiddleCode)
352
) comment '?????????}?X?^' ;
353

    
354
-- ?????????L?[?}?X?^
355
drop table if exists commoncostmiddlesearchword cascade;
356

    
357
create table commoncostmiddlesearchword (
358
  LargeCode decimal(5,0) unsigned not null comment '????L?['
359
  , MiddleCode decimal(5,0) unsigned not null comment '??????L?['
360
  , SeqNo decimal(5,0) unsigned not null comment '????'
361
  , SearchWord varchar(50) not null comment '????????'
362
  , EntryDate datetime not null comment '?o?^???t'
363
  , UpdateDate datetime not null comment '?X?V???t'
364
  , constraint commoncostmiddlesearchword_PKC primary key (LargeCode,MiddleCode,SeqNo)
365
) comment '?????????L?[?}?X?^' ;
366

    
367
-- ?\???H???A?}?X?^
368
drop table if exists componentlinkmaster cascade;
369

    
370
create table componentlinkmaster (
371
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
372
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
373
  , DisplayOrder decimal(5,0) unsigned comment '?\????'
374
  , EntryDate datetime not null comment '?o?^???t'
375
  , UpdateDate datetime not null comment '?X?V???t'
376
  , constraint componentlinkmaster_PKC primary key (ComponentCode,ItemCode)
377
) comment '?\???H???A?}?X?^' ;
378

    
379
create index ComponentLinkMaster_Index1
380
  on componentlinkmaster(ComponentCode);
381

    
382
create index ComponentLinkMaster_Index2
383
  on componentlinkmaster(ItemCode);
384

    
385
-- ?\???}?X?^
386
drop table if exists componentmaster cascade;
387

    
388
create table componentmaster (
389
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
390
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
391
  , ComponentName varchar(120) not null comment '?\??????'
392
  , SubItemsFlg decimal(1,0) comment '???????t???O'
393
  , DirectInputFlg decimal(1,0) comment '???????t???O'
394
  , MyExpensesFlg decimal(1,0) comment '????o??t???O'
395
  , DeleteFlg decimal(1,0) not null comment '???t???O'
396
  , EntryDate datetime not null comment '?o?^???t'
397
  , UpdateDate datetime not null comment '?X?V???t'
398
  , constraint componentmaster_PKC primary key (ComponentCode)
399
) comment '?\???}?X?^' ;
400

    
401
create index ComponentMaster_Index1
402
  on componentmaster(DisplayOrder);
403

    
404
-- ?\???H??????A?}?X?^
405
drop table if exists componenttotypemaster cascade;
406

    
407
create table componenttotypemaster (
408
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
409
  , TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
410
  , Dummy decimal(1,0) not null comment '?_?~?[????'
411
  , EntryDate datetime not null comment '?o?^???t'
412
  , UpdateDate datetime not null comment '?X?V???t'
413
  , constraint componenttotypemaster_PKC primary key (ComponentCode,TypeCode)
414
) comment '?\???H??????A?}?X?^' ;
415

    
416
create index ComponentToTypeMaster_Index1
417
  on componenttotypemaster(ComponentCode);
418

    
419
create index ComponentToTypeMaster_Index2
420
  on componenttotypemaster(TypeCode);
421

    
422
-- ?H????{???
423
drop table if exists constructionbaseinfo cascade;
424

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

    
481
create index BaseInfo_Index1
482
  on constructionbaseinfo(ConstructionStatusFlg);
483

    
484
create index BaseInfo_Index2
485
  on constructionbaseinfo(EstimateType);
486

    
487
create index BaseInfo_Index3
488
  on constructionbaseinfo(SalesPersonCode);
489

    
490
create index BaseInfo_Index4
491
  on constructionbaseinfo(ConstructionPersonCode);
492

    
493
create index BaseInfo_Index5
494
  on constructionbaseinfo(ConstructionInstructor);
495

    
496
create index BaseInfo_Index6
497
  on constructionbaseinfo(ConstructionPeriod);
498

    
499
-- ?H????{????
500
drop table if exists constructionbaseinfodetail cascade;
501

    
502
create table constructionbaseinfodetail (
503
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
504
  , DetailNo decimal(2,0) not null comment '??????'
505
  , DetailString varchar(300) comment '??????e'
506
  , EntryDate datetime not null comment '?o?^???t'
507
  , UpdateDate datetime not null comment '?X?V???t'
508
  , constraint constructionbaseinfodetail_PKC primary key (ConstructionCode,DetailNo)
509
) comment '?H????{????' ;
510

    
511
create index BaseInfoDetail_Idx1
512
  on constructionbaseinfodetail(ConstructionCode);
513

    
514
create index BaseInfoDetail_Idx2
515
  on constructionbaseinfodetail(DetailNo);
516

    
517
-- ?H???{?H?\?Z?f?[?^
518
drop table if exists constructionbudget cascade;
519

    
520
create table constructionbudget (
521
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
522
  , CreatorCode decimal(8,0) not null comment '????R?[?h'
523
  , CreatorName varchar(60) comment '?????'
524
  , CreatorCosts decimal(11,0) not null comment '??????^'
525
  , AssistantCode decimal(8,0) not null comment '???S????R?[?h'
526
  , AssistantName varchar(60) comment '???S?????'
527
  , AssistantCosts decimal(11,0) not null comment '???S??????^'
528
  , InstructorCode decimal(8,0) not null comment '?H???w?????R?[?h'
529
  , InstructorName varchar(60) comment '?H???w??????'
530
  , InstructorCosts decimal(11,0) not null comment '?H???w???????^'
531
  , CreateDate date not null comment '????'
532
  , ConstructionTimes decimal(5,2) not null comment '?H???i?P??E???j'
533
  , ConstructionStart date not null comment '?_??H???J?n'
534
  , ConstructionEnd date not null comment '?_??H??????'
535
  , InstructorTimes decimal(5,2) not null comment '?w???????????'
536
  , SalaryFlg decimal(1,0) not null comment '???^?U????'
537
  , SalaryDays decimal(4,0) not null comment '?U??????'
538
  , A_SalaryFlg decimal(1,0) not null comment '???S??????^?U????'
539
  , A_SalaryDays decimal(4,0) not null comment '???S????U??????'
540
  , I_SalaryFlg decimal(1,0) not null comment '?w???????^?U????'
541
  , I_SalaryDays decimal(4,0) not null comment '?w?????U??????'
542
  , OrdersDecisionPrice decimal(12,0) not null comment '??????????z'
543
  , EntryDate datetime not null comment '?o?^???t'
544
  , UpdateDate datetime not null comment '?X?V???t'
545
  , constraint constructionbudget_PKC primary key (ConstructionCode)
546
) comment '?H???{?H?\?Z?f?[?^' ;
547

    
548
-- ?H???{?H?\?Z?f?[?^????
549
drop table if exists constructionbudgetdetail cascade;
550

    
551
create table constructionbudgetdetail (
552
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
553
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
554
  , LineCount decimal(3,0) unsigned not null comment '?s???'
555
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
556
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
557
  , FirstString varchar(120) comment '???????'
558
  , SecondString varchar(120) comment '?H?????e'
559
  , CompanyType decimal(1,0) not null comment '??????R?[?h?^?C?v'
560
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
561
  , CompanyName varchar(120) comment '?????????'
562
  , EstimatePrice decimal(12,0) not null comment '??Z????????z'
563
  , NegotiationPrice decimal(12,0) not null comment '??Z????????z'
564
  , OrderDesiredAmount decimal(12,0) not null comment '??????]???z'
565
  , ExecutionAmount decimal(12,0) not null comment '???s???z'
566
  , AmountConfigRate decimal(5,2) not null comment '???z?\????'
567
  , NegotiateFlg decimal(1,0) not null comment '?????????t???O'
568
  , EntryDate datetime not null comment '?o?^???t'
569
  , UpdateDate datetime not null comment '?X?V???t'
570
  , constraint constructionbudgetdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
571
) comment '?H???{?H?\?Z?f?[?^????' ;
572

    
573
-- ?H??}?X?^
574
drop table if exists constructionitemmaster cascade;
575

    
576
create table constructionitemmaster (
577
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
578
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
579
  , ItemName varchar(120) not null comment '?H????'
580
  , SubItemsFlg decimal(1,0) comment '???????t???O'
581
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
582
  , DeleteFlg decimal(1,0) not null comment '???t???O'
583
  , EntryDate datetime not null comment '?o?^???t'
584
  , UpdateDate datetime not null comment '?X?V???t'
585
  , constraint constructionitemmaster_PKC primary key (ItemCode)
586
) comment '?H??}?X?^' ;
587

    
588
-- ?H???????f?[?^
589
drop table if exists constructionledger cascade;
590

    
591
create table constructionledger (
592
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
593
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
594
  , CreatorCode decimal(8,0) comment '????R?[?h'
595
  , CreatorName varchar(60) comment '?????'
596
  , CreateDate date not null comment '????'
597
  , ConstructionTimes decimal(5,2) not null comment '?H???i?P??E???j'
598
  , ConstructionStart date not null comment '?_??H???J?n'
599
  , ConstructionEnd date not null comment '?_??H??????'
600
  , OrdersDecisionPrice decimal(14,0) not null comment '??????????z'
601
  , CompanyExpenses decimal(10,0) not null comment '???o???v'
602
  , DepartmentExpenses decimal(10,0) not null comment '?????o???v'
603
  , SalesExpenses decimal(10,0) not null comment '?c??o???v'
604
  , TotalPayment decimal(10,0) not null comment '???x???z'
605
  , GrossProfit decimal(10,0) not null comment '?e??'
606
  , Allowance decimal(10,0) not null comment '???^'
607
  , NetProfit decimal(10,0) not null comment '?????v'
608
  , ComplateFlg decimal(1,0) not null comment '????????t???O'
609
  , IntegrationFlg decimal(1,0) not null comment '????z??Z?t???O'
610
  , EntryDate datetime not null comment '?o?^???t'
611
  , UpdateDate datetime not null comment '?X?V???t'
612
  , constraint constructionledger_PKC primary key (ConstructionCode)
613
) comment '?H???????f?[?^' ;
614

    
615
-- ?H??????????f?[?^
616
drop table if exists constructionledgerdetail cascade;
617

    
618
create table constructionledgerdetail (
619
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
620
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
621
  , LineCount decimal(4,0) unsigned not null comment '?s???'
622
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
623
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
624
  , FirstString varchar(120) comment '???????'
625
  , SecondString varchar(120) comment '?H?????e'
626
  , CompanyType decimal(1,0) not null comment '??????R?[?h?^?C?v'
627
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
628
  , CompanyName varchar(120) comment '?????????'
629
  , EstimatePrice decimal(12,0) not null comment '?\?Z?i????j???z'
630
  , ExecutionAmount decimal(12,0) not null comment '???s???z'
631
  , AmountConfigRate decimal(5,2) not null comment '???z?\????'
632
  , PaymentBurden decimal(12,0) not null comment '?x????U?z'
633
  , FixDataFlg decimal(1,0) not null comment '???f?[?^?t???O'
634
  , IndependentFlg decimal(1,0) not null comment '????f?[?^?t???O'
635
  , FluctuationFlg decimal(1,0) not null comment '?????f?[?^?t???O'
636
  , SalaryFlg decimal(1,0) not null comment '???^?U????'
637
  , SalaryDays decimal(4,0) not null comment '???^?U??????'
638
  , OperatingFlg decimal(1,0) not null comment '?S?????t???O'
639
  , SourceCode decimal(10,0) unsigned not null comment '???H?????'
640
  , JoinTitleFlg decimal(1,0) not null comment '?H??????^?C?g??'
641
  , SalaryOnRegist decimal(12,0) not null comment '?o?^?????z???^'
642
  , PurchaseOrderFlg decimal(2,0) not null comment '?????????s?t???O'
643
  , DetailCount decimal(4,0) unsigned not null comment '??????'
644
  , EntryDate datetime not null comment '?o?^???t'
645
  , UpdateDate datetime not null comment '?X?V???t'
646
  , constraint constructionledgerdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
647
) comment '?H??????????f?[?^' ;
648

    
649
create index LedgerDetail_Index01
650
  on constructionledgerdetail(ConstructionCode);
651

    
652
create index LedgerDetail_Index02
653
  on constructionledgerdetail(GroupCount);
654

    
655
create index LedgerDetail_Index03
656
  on constructionledgerdetail(LineCount);
657

    
658
create index LedgerDetail_Index04
659
  on constructionledgerdetail(SourceCode);
660

    
661
create index LedgerDetail_Index05
662
  on constructionledgerdetail(DetailCount);
663

    
664
-- ?H?????????s?f?[?^
665
drop table if exists constructionledgerexcute cascade;
666

    
667
create table constructionledgerexcute (
668
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
669
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
670
  , LineCount decimal(4,0) unsigned not null comment '?s???'
671
  , ColumnCount decimal(3,0) not null comment '????'
672
  , PaymentAmount decimal(12,0) not null comment '?x?????z'
673
  , TargetMonth date not null comment '???N??'
674
  , EntryDate datetime not null comment '?o?^???t'
675
  , UpdateDate datetime not null comment '?X?V???t'
676
  , constraint constructionledgerexcute_PKC primary key (ConstructionCode,GroupCount,LineCount,ColumnCount)
677
) comment '?H?????????s?f?[?^' ;
678

    
679
create index LedgerExcute_Index1
680
  on constructionledgerexcute(ConstructionCode,TargetMonth,GroupCount,LineCount);
681

    
682
-- ?H???????N???
683
drop table if exists constructionlink cascade;
684

    
685
create table constructionlink (
686
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
687
  , FluctuationCode decimal(10,0) not null comment '?q?H?????'
688
  , LinkType decimal(1,0) not null comment '?????N???'
689
  , EntryDate datetime not null comment '?o?^???t'
690
  , UpdateDate datetime not null comment '?X?V???t'
691
  , constraint constructionlink_PKC primary key (ConstructionCode,FluctuationCode)
692
) comment '?H???????N???' ;
693

    
694
create index ConstructionLink_Index1
695
  on constructionlink(ConstructionCode);
696

    
697
create index ConstructionLink_Index2
698
  on constructionlink(FluctuationCode);
699

    
700
create index ConstructionLink_Index3
701
  on constructionlink(LinkType);
702

    
703
-- ?H????????
704
drop table if exists constructionmaterialinfo cascade;
705

    
706
create table constructionmaterialinfo (
707
  CONSTRUCTIONCODE int(10) unsigned default 0 not null comment '?H?????'
708
  , MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
709
  , PROCESSDATE datetime default '0000-00-00 00:00:00' not null comment '?????N????'
710
  , RENTCOUNT smallint(5) unsigned comment '??o??'
711
  , REPAYCOUNT smallint(5) unsigned comment '??p??'
712
  , JUNKCOUNT smallint(5) unsigned comment '?j????'
713
  , COMPLETEFLG tinyint(3) unsigned comment '?????t???O'
714
  , ENTRYDATE datetime comment '?o?^???t'
715
  , UPDATEDATE datetime comment '?X?V???t'
716
  , constraint constructionmaterialinfo_PKC primary key (CONSTRUCTIONCODE,MATERIALITEMCODE,PROCESSDATE)
717
) comment '?H????????' ;
718

    
719
-- ????i?????t?f?[?^
720
drop table if exists constructionprogressdate cascade;
721

    
722
create table constructionprogressdate (
723
  ConstructionCode decimal(10,0) not null comment '?H?????'
724
  , ConstructionStatusFlg decimal(2,0) not null comment '???H?????'
725
  , PreviousStatusFlg decimal(2,0) comment '??X?O???'
726
  , ChangeDate datetime not null comment '?????t'
727
  , ChangePersonCode decimal(8,0) not null comment '???S????'
728
  , EntryDate datetime not null comment '?o?^???t'
729
  , UpdateDate datetime not null comment '?X?V???t'
730
  , constraint constructionprogressdate_PKC primary key (ConstructionCode,ConstructionStatusFlg)
731
) comment '????i?????t?f?[?^' ;
732

    
733
-- ???}?X?^
734
drop table if exists constructionspecmaster cascade;
735

    
736
create table constructionspecmaster (
737
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
738
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
739
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
740
  , ItemName varchar(120) comment '??????'
741
  , SpecName varchar(120) comment '??????'
742
  , UnitName varchar(30) comment '?P?????'
743
  , UnitPrice decimal(9,2) not null comment '?P??'
744
  , DeleteFlg decimal(1,0) not null comment '???t???O'
745
  , EntryDate datetime not null comment '?o?^???t'
746
  , UpdateDate datetime not null comment '?X?V???t'
747
  , constraint constructionspecmaster_PKC primary key (ItemCode,SpecCode)
748
) comment '???}?X?^' ;
749

    
750
create index ConstructionSpecMaster_Index1
751
  on constructionspecmaster(DisplayOrder);
752

    
753
-- ???P???}?X?^
754
drop table if exists constructionspecunitprice cascade;
755

    
756
create table constructionspecunitprice (
757
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
758
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
759
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
760
  , ConstructionTypeCode mediumint(8) unsigned not null comment '?H?????R?[?h'
761
  , UnitPrice decimal(9,2) not null comment '?P??'
762
  , EntryDate datetime not null comment '?o?^???t'
763
  , UpdateDate datetime not null comment '?X?V???t'
764
  , constraint constructionspecunitprice_PKC primary key (ComponentCode,ItemCode,SpecCode,ConstructionTypeCode)
765
) comment '???P???}?X?^' ;
766

    
767
-- ?H?????}?X?^
768
drop table if exists constructiontypemaster cascade;
769

    
770
create table constructiontypemaster (
771
  TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
772
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
773
  , NameString varchar(100) not null comment '????'
774
  , PublicFlg decimal(1,0) not null comment '?H?????t???O'
775
  , SecRank decimal(1,0) not null comment '?????????N'
776
  , ExpensesLink decimal(1,0) not null comment '?o??g?p??'
777
  , DeleteFlg decimal(1,0) not null comment '???t???O'
778
  , EntryDate datetime not null comment '?o?^???t'
779
  , UpdateDate datetime not null comment '?X?V???t'
780
  , constraint constructiontypemaster_PKC primary key (TypeCode)
781
) comment '?H?????}?X?^' ;
782

    
783
-- ?S??????o??f?[?^
784
drop table if exists costdataofperson cascade;
785

    
786
create table costdataofperson (
787
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
788
  , ActionDate date not null comment '?????t'
789
  , DataType decimal(1,0) not null comment '?f?[?^??'
790
  , DataAddCount decimal(5,0) unsigned not null comment '?f?[?^??????'
791
  , TargetMonth varchar(7) not null comment '???N??'
792
  , ConstructionCode decimal(10,0) unsigned comment '?H???R?[?h'
793
  , SuppliersCode decimal(5,0) unsigned not null comment '?x????R?[?h'
794
  , SuppliersName varchar(120) comment '?x??????'
795
  , PaymentContent varchar(60) comment '?x?????e'
796
  , PaymentType decimal(1,0) not null comment '?x?????@?t???O'
797
  , EntryPrice decimal(12,0) not null comment '???z?i????j'
798
  , EntryPriceInTax decimal(12,0) not null comment '???z?i????j'
799
  , SlipNumber varchar(12) comment '?`?[???'
800
  , ComplateFlg decimal(1,0) not null comment '???????t???O'
801
  , ApprovalFlg decimal(1,0) not null comment '???F?t???O'
802
  , EntryDate datetime not null comment '?o?^???t'
803
  , UpdateDate datetime not null comment '?X?V???t'
804
  , constraint costdataofperson_PKC primary key (PersonCode,ActionDate,DataType,DataAddCount)
805
) comment '?S??????o??f?[?^' ;
806

    
807
create index CostDataOfPerson_Index1
808
  on costdataofperson(TargetMonth);
809

    
810
create index CostDataOfPerson_Index2
811
  on costdataofperson(ConstructionCode);
812

    
813
-- ??????o?^?\???f?[?^
814
drop table if exists costomerregist cascade;
815

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

    
847
create index CostomerRegist_Index1
848
  on costomerregist(PetitionPeriod);
849

    
850
-- ????f?[?^
851
drop table if exists dailydataconstruction cascade;
852

    
853
create table dailydataconstruction (
854
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
855
  , DailyDataDate date not null comment '???????'
856
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
857
  , Weather varchar(60) comment '?V?C'
858
  , EntryDate datetime not null comment '?o?^???t'
859
  , UpdateDate datetime not null comment '?X?V???t'
860
  , constraint dailydataconstruction_PKC primary key (PersonCode,DailyDataDate,ConstructionCode)
861
) comment '????f?[?^' ;
862

    
863
create index DailyDataConstruction_Index1
864
  on dailydataconstruction(PersonCode);
865

    
866
create index DailyDataConstruction_Index2
867
  on dailydataconstruction(DailyDataDate);
868

    
869
create index DailyDataConstruction_Index3
870
  on dailydataconstruction(ConstructionCode);
871

    
872
-- ????f?[?^ (????)
873
drop table if exists dailydatadetail cascade;
874

    
875
create table dailydatadetail (
876
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
877
  , DailyDataDate date not null comment '???????'
878
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
879
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
880
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
881
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
882
  , TodayHeadCount decimal(4,1) not null comment '?????l????'
883
  , TotalHeadCount decimal(5,1) not null comment '??v?l????'
884
  , TodayWork varchar(100) comment '?????????e'
885
  , NextdayWork varchar(100) comment '?????????e'
886
  , NextdayHeadCount decimal(4,1) not null comment '?????l????'
887
  , EntryDate datetime not null comment '?o?^???t'
888
  , UpdateDate datetime not null comment '?X?V???t'
889
  , constraint dailydatadetail_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
890
) comment '????f?[?^ (????)' ;
891

    
892
create index DailyDataDetail_Index
893
  on dailydatadetail(PersonCode,DailyDataDate,ConstructionCode);
894

    
895
-- ????f?[?^ (??????)
896
drop table if exists dailydatafield cascade;
897

    
898
create table dailydatafield (
899
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
900
  , DailyDataDate date not null comment '???????'
901
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
902
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
903
  , PatrolTime datetime not null comment '?????'
904
  , ContentsText varchar(200) comment '???e'
905
  , EntryDate datetime not null comment '?o?^???t'
906
  , UpdateDate datetime not null comment '?X?V???t'
907
  , constraint dailydatafield_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
908
) comment '????f?[?^ (??????)' ;
909

    
910
create index DailyDataField_Index
911
  on dailydatafield(PersonCode,DailyDataDate,ConstructionCode);
912

    
913
-- ????f?[?^ (????)
914
drop table if exists dailydatamaterials cascade;
915

    
916
create table dailydatamaterials (
917
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
918
  , DailyDataDate date not null comment '???????'
919
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
920
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
921
  , Materials varchar(100) comment '?????'
922
  , Quantity varchar(100) comment '????'
923
  , Production varchar(100) comment '??????'
924
  , Delivery varchar(100) comment '?[?????'
925
  , QualityControl varchar(100) comment '?i?????????'
926
  , EntryDate datetime not null comment '?o?^???t'
927
  , UpdateDate datetime not null comment '?X?V???t'
928
  , constraint dailydatamaterials_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
929
) comment '????f?[?^ (????)' ;
930

    
931
create index DailyDataMaterials_Index
932
  on dailydatamaterials(PersonCode,DailyDataDate,ConstructionCode);
933

    
934
-- ????f?[?^ (??????w??)
935
drop table if exists dailydatasubcontractors cascade;
936

    
937
create table dailydatasubcontractors (
938
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
939
  , DailyDataDate date not null comment '???????'
940
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
941
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
942
  , Attendee varchar(100) comment '?o???'
943
  , ContentsText varchar(200) comment '???e'
944
  , EntryDate datetime not null comment '?o?^???t'
945
  , UpdateDate datetime not null comment '?X?V???t'
946
  , constraint dailydatasubcontractors_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
947
) comment '????f?[?^ (??????w??)' ;
948

    
949
create index DailyDataSubcontractors_Index
950
  on dailydatasubcontractors(PersonCode,DailyDataDate,ConstructionCode);
951

    
952
-- ????f?[?^ (???)
953
drop table if exists dailydatavehicles cascade;
954

    
955
create table dailydatavehicles (
956
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
957
  , DailyDataDate date not null comment '???????'
958
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
959
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
960
  , Model varchar(100) comment '?@??'
961
  , Performance varchar(100) comment '???\'
962
  , Owner varchar(100) comment '???L???'
963
  , Driver varchar(100) comment '?????^?]??'
964
  , StartWorkingTime datetime not null comment '??????J?n'
965
  , EndWorkingTime datetime not null comment '??????I??'
966
  , EntryDate datetime not null comment '?o?^???t'
967
  , UpdateDate datetime not null comment '?X?V???t'
968
  , constraint dailydatavehicles_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
969
) comment '????f?[?^ (???)' ;
970

971
create index DailyDataVehicles_Index
972
  on dailydatavehicles(PersonCode,DailyDataDate,ConstructionCode);
973

974
-- ???}?X?^
975
drop table if exists daymaster cascade;
976

977
create table daymaster (
978
  days smallint(6) not null comment '??'
979
) comment '???}?X?^' ;
980

981
create index day_Index1
982
  on daymaster(days);
983

984
-- ?????}?X?^
985
drop table if exists deadlinemaster cascade;
986

987
create table deadlinemaster (
988
  LABOURKIND decimal(1,0) default '0' not null comment '??????'
989
  , DEADLINE decimal(2,0) comment '????'
990
  , PAYDAY decimal(2,0) comment '?x????'
991
  , NOTE varchar(120) comment '???l'
992
  , DELETEFLG decimal(1,0) comment '???t???O'
993
  , ENTRYDATE datetime comment '?o?^???t'
994
  , UPDATEDATE datetime comment '?X?V???t'
995
  , constraint deadlinemaster_PKC primary key (LABOURKIND)
996
) comment '?????}?X?^' ;
997

998
-- ?????o???}?X?^
999
drop table if exists departmentexpensesmaster cascade;
1000

1001
create table departmentexpensesmaster (
1002
  DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1003
  , ExpensesPeriod smallint(6) not null comment '?????'
1004
  , NameCode decimal(5,0) unsigned not null comment '?o????R?[?h'
1005
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1006
  , ExpensesRaito decimal(4,2) not null comment '?o??'
1007
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1008
  , EntryDate datetime not null comment '?o?^???t'
1009
  , UpdateDate datetime not null comment '?X?V???t'
1010
  , constraint departmentexpensesmaster_PKC primary key (DepartmentCode,ExpensesPeriod,NameCode)
1011
) comment '?????o???}?X?^' ;
1012

1013
-- ?????}?X?^
1014
drop table if exists departmentmaster cascade;
1015

1016
create table departmentmaster (
1017
  DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1018
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1019
  , DepartmentString varchar(100) not null comment '??????'
1020
  , ActionScheduleFlg decimal(1,0) not null comment '?s???\??\???t???O'
1021
  , StaffAssignFlg decimal(1,0) not null comment '?l???z?u?\???t???O'
1022
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1023
  , EntryDate datetime not null comment '?o?^???t'
1024
  , UpdateDate datetime not null comment '?X?V???t'
1025
  , constraint departmentmaster_PKC primary key (DepartmentCode)
1026
) comment '?????}?X?^' ;
1027

1028
create index DepartmentMaster_index1
1029
  on departmentmaster(DisplayOrder);
1030

1031
-- ?????m?F???F?f?[?^
1032
drop table if exists depositapprovalinfo cascade;
1033

1034
create table depositapprovalinfo (
1035
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1036
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1037
  , TARGETDATE decimal(6,0) not null comment '???N??'
1038
  , SEQNO decimal(3,0) not null comment '?A??'
1039
  , LINECOUNT decimal(3,0) not null comment '?s???'
1040
  , APPROVALNO decimal(3,0) not null comment '???F????'
1041
  , APPROVALPERSON decimal(8,0) comment '???F??R?[?h'
1042
  , APPROVALPERSONNAME varchar(20) comment '???F???'
1043
  , APPROVALAUTHORITY decimal(1,0) comment '???F??????'
1044
  , APPROVALDATE date comment '???F???t'
1045
  , ENTRYDATE datetime comment '?o?^???t'
1046
  , UPDATEDATE datetime comment '?X?V???t'
1047
  , constraint depositapprovalinfo_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,SEQNO,LINECOUNT,APPROVALNO)
1048
) comment '?????m?F???F?f?[?^' ;
1049

1050
-- ?????f?[?^
1051
drop table if exists depositdata cascade;
1052

1053
create table depositdata (
1054
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1055
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1056
  , TARGETDATE decimal(6,0) not null comment '???N??'
1057
  , SEQNO decimal(3,0) not null comment '?A??'
1058
  , BUSINESSPERIOD decimal(4,0) comment '?c???'
1059
  , DEPOSITDATE date comment '??????'
1060
  , DEPOSITAMOUNT decimal(12,0) comment '???????z'
1061
  , DEPOSITAMOUNTCASH decimal(10,0) comment '???????z?i?????j'
1062
  , DEPOSITAMOUNTBILL decimal(10,0) comment '???????z?i??`?j'
1063
  , DEPOSITPERSONCODE decimal(8,0) not null comment '?????S????R?[?h'
1064
  , NOTE varchar(120) comment '???l'
1065
  , ENTRYDATE datetime comment '?o?^???t'
1066
  , UPDATEDATE datetime comment '?X?V???t'
1067
  , constraint depositdata_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,SEQNO)
1068
) comment '?????f?[?^' ;
1069

1070
-- ????????f?[?^
1071
drop table if exists depositdatadetail cascade;
1072

1073
create table depositdatadetail (
1074
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1075
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1076
  , TARGETDATE decimal(6,0) not null comment '???N??'
1077
  , REQUESTNO decimal(10,0) not null comment '????No'
1078
  , ORDERNO decimal(2,0) comment '??t???'
1079
  , DEPOSITAMOUNT decimal(10,0) comment '???????z'
1080
  , DISCOUNTAMOUNT decimal(10,0) comment '?l???????z'
1081
  , CNSTRPRICE decimal(10,0) comment '?????'
1082
  , FEES decimal(10,0) comment '????'
1083
  , OTHERADJUSTMENTS decimal(10,0) comment '?????'
1084
  , DIFFERENCEAMOUNT decimal(10,0) comment '????'
1085
  , CONFIRMATIONPERSONCODE decimal(8,0) comment '?m?F?S????R?[?h'
1086
  , CONFIRMATIONDATE date comment '?S????m?F???t'
1087
  , CONFIRMATIONENDFLG decimal(1,0) comment '?m?F?????t???O'
1088
  , NOTE varchar(120) comment '???l'
1089
  , ENTRYDATE datetime comment '?o?^???t'
1090
  , UPDATEDATE datetime comment '?X?V???t'
1091
  , constraint depositdatadetail_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,REQUESTNO)
1092
) comment '????????f?[?^' ;
1093

1094
-- ???}?X?^
1095
drop table if exists divisionmaster cascade;
1096

1097
create table divisionmaster (
1098
  DivisionCode decimal(5,0) unsigned not null comment '???R?[?h'
1099
  , NameCode decimal(5,0) unsigned not null comment '????R?[?h'
1100
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1101
  , NameString varchar(100) not null comment '????'
1102
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1103
  , EntryDate datetime not null comment '?o?^???t'
1104
  , UpdateDate datetime not null comment '?X?V???t'
1105
  , constraint divisionmaster_PKC primary key (DivisionCode,NameCode)
1106
) comment '???}?X?^' ;
1107

1108
-- ??Z?\?Z???f?[?^
1109
drop table if exists estimatebudget cascade;
1110

1111
create table estimatebudget (
1112
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1113
  , ConstructionTime decimal(5,2) unsigned not null comment '?H??'
1114
  , IntegratedCode decimal(8,0) not null comment '??Z??'
1115
  , DataCreateDate datetime not null comment '?f?[?^??????'
1116
  , RetValue1 decimal(12,0) not null comment '?\???i'
1117
  , RetValue2 decimal(12,0) not null comment '????H????'
1118
  , RetValue3 decimal(12,0) not null comment '????????????'
1119
  , RetValue4 decimal(12,0) not null comment '????????????'
1120
  , RetPercent decimal(5,2) not null comment '???????'
1121
  , EntryDate datetime not null comment '?o?^???t'
1122
  , UpdateDate datetime not null comment '?X?V???t'
1123
  , constraint estimatebudget_PKC primary key (ConstructionCode)
1124
) comment '??Z?\?Z???f?[?^' ;
1125

1126
-- ??Z?\?Z????f?[?^????
1127
drop table if exists estimatebudgetdetail cascade;
1128

1129
create table estimatebudgetdetail (
1130
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1131
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
1132
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1133
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1134
  , ItemCode decimal(5,0) unsigned comment '?H??L?['
1135
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1136
  , FirstString varchar(120) comment '???????'
1137
  , SecondString varchar(120) comment '?H????E???????'
1138
  , Content varchar(120) comment '???e'
1139
  , EstimatePrice decimal(12,0) not null comment '????????z'
1140
  , NegotiationPrice decimal(12,0) not null comment '????????z'
1141
  , Notes varchar(120) comment '???????'
1142
  , EntryDate datetime not null comment '?o?^???t'
1143
  , UpdateDate datetime not null comment '?X?V???t'
1144
  , constraint estimatebudgetdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
1145
) comment '??Z?\?Z????f?[?^????' ;
1146

1147
-- ??Z????f?[?^
1148
drop table if exists estimatedata cascade;
1149

1150
create table estimatedata (
1151
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1152
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1153
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1154
  , FixedItemCode varchar(1) comment '?????L?['
1155
  , ItemName varchar(120) comment '??????'
1156
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
1157
  , PriceValue decimal(14,0) not null comment '???z'
1158
  , note varchar(60) comment '???l'
1159
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
1160
  , InputFlg decimal(1,0) not null comment '????t???O'
1161
  , EntryDate datetime not null comment '?o?^???t'
1162
  , UpdateDate datetime not null comment '?X?V???t'
1163
  , constraint estimatedata_PKC primary key (ConstructionCode,LineCount)
1164
) comment '??Z????f?[?^' ;
1165

1166
create index EstimateData_Index1
1167
  on estimatedata(ConstructionCode,FixedItemCode);
1168

1169
-- ??Z????y?[?W?f?[?^
1170
drop table if exists estimatedatabody cascade;
1171

1172
create table estimatedatabody (
1173
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1174
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
1175
  , Category decimal(1,0) not null comment '?y?[?W??'
1176
  , UnionComponentCode decimal(5,0) unsigned not null comment '?????\???L?['
1177
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1178
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1179
  , SelectComponent decimal(5,0) unsigned not null comment '?I???\???L?['
1180
  , PageTitle varchar(120) not null comment '?y?[?W?\????'
1181
  , DetailLineCount decimal(3,0) unsigned not null comment '????s???'
1182
  , EntryDate datetime not null comment '?o?^???t'
1183
  , UpdateDate datetime not null comment '?X?V???t'
1184
  , constraint estimatedatabody_PKC primary key (ConstructionCode,PageCount)
1185
) comment '??Z????y?[?W?f?[?^' ;
1186

1187
create index EstimateDataBody_Index1
1188
  on estimatedatabody(ConstructionCode,ComponentCode,ItemCode);
1189

1190
-- ??Z????f?[?^????
1191
drop table if exists estimatedatadetail cascade;
1192

1193
create table estimatedatadetail (
1194
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1195
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
1196
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1197
  , DataType decimal(1,0) not null comment '?f?[?^???'
1198
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1199
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1200
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
1201
  , ItemName varchar(120) comment '??????'
1202
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
1203
  , Unitcount decimal(8,2) not null comment '????'
1204
  , UnitName varchar(30) comment '?P?????'
1205
  , UnitPrice decimal(9,2) not null comment '?P??'
1206
  , LineTotal decimal(12,0) not null comment '???z'
1207
  , note varchar(60) comment '???l'
1208
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1209
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
1210
  , InputFlg decimal(1,0) comment '????t???O'
1211
  , EntryDate datetime not null comment '?o?^???t'
1212
  , UpdateDate datetime not null comment '?X?V???t'
1213
  , constraint estimatedatadetail_PKC primary key (ConstructionCode,PageCount,LineCount)
1214
) comment '??Z????f?[?^????' ;
1215

1216
create index EstimateDataDetail_Index1
1217
  on estimatedatadetail(ConstructionCode,PageCount);
1218

1219
-- ?o???}?X?^
1220
drop table if exists expensesmaster cascade;
1221

1222
create table expensesmaster (
1223
  DivisionCode smallint(6) not null comment '?H?????R?[?h'
1224
  , NameCode smallint(6) not null comment '?o????R?[?h'
1225
  , DisplayOrder smallint(6) not null comment '?\????'
1226
  , ExpensesRatio decimal(4,2) not null comment '?o??'
1227
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1228
  , EntryDate datetime not null comment '?o?^???t'
1229
  , UpdateDate datetime not null comment '?X?V???t'
1230
  , constraint expensesmaster_PKC primary key (DivisionCode,NameCode)
1231
) comment '?o???}?X?^' ;
1232

1233
-- ???x???}?X?^
1234
drop table if exists holidaycalendermaster cascade;
1235

1236
create table holidaycalendermaster (
1237
  Holiday date not null comment '?x??'
1238
  , BusinessYear smallint(5) unsigned not null comment '?c??N?x'
1239
  , TargetMonth tinyint(3) unsigned not null comment '?Y????'
1240
  , TargetDay tinyint(3) unsigned not null comment '?Y????'
1241
  , constraint holidaycalendermaster_PKC primary key (Holiday)
1242
) comment '???x???}?X?^' ;
1243

1244
create index HolidayCalender_Index1
1245
  on holidaycalendermaster(BusinessYear);
1246

1247
create index HolidayCalenderMaster_Index2
1248
  on holidaycalendermaster(TargetMonth);
1249

1250
create index HolidayCalenderMaster_Index3
1251
  on holidaycalendermaster(TargetDay);
1252

1253
-- ?????????????
1254
drop table if exists inputsearchlogdata cascade;
1255

1256
create table inputsearchlogdata (
1257
  ConstructionCode decimal(10,0) not null comment '?H???R?[?h'
1258
  , UsedProcessNo decimal(4,0) not null comment '?g?p?@?\???'
1259
  , DisplayOrder decimal(4,0) unsigned not null comment '?\????'
1260
  , DataType decimal(1,0) not null comment '?f?[?^???'
1261
  , InputCode decimal(10,0) comment '????R?[?h'
1262
  , constraint inputsearchlogdata_PKC primary key (ConstructionCode,UsedProcessNo,DisplayOrder)
1263
) comment '?????????????' ;
1264

1265
create index InputSearchLogData_Index1
1266
  on inputsearchlogdata(ConstructionCode,UsedProcessNo,InputCode);
1267

1268
-- ???????f?[?^
1269
drop table if exists invoicedata cascade;
1270

1271
create table invoicedata (
1272
  INVOICENO decimal(9,0) not null comment '??????No'
1273
  , ORDERERSDIVISION decimal(5,0) not null comment '???????'
1274
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1275
  , REQUESTMONTH decimal(6,0) not null comment '??????'
1276
  , SEQNO decimal(2,0) not null comment '?A??'
1277
  , CRETATEDATE date not null comment '????'
1278
  , REQUESTDATE date not null comment '??????'
1279
  , REQUESTNAME varchar(120) comment '??????'
1280
  , TOTALAMOUNT decimal(10,0) comment '???????v???z'
1281
  , TAXAMOUNT decimal(10,0) comment '???????z'
1282
  , COMMENT1 varchar(60) comment '?R?????g1'
1283
  , COMMENT2 varchar(60) comment '?R?????g2'
1284
  , COMMENT3 varchar(60) not null comment '?R?????g3'
1285
  , COMMENT4 varchar(60) not null comment '?R?????g4'
1286
  , COMMENT5 varchar(60) not null comment '?R?????g5'
1287
  , COMPLETEFLG decimal(1,0) default '0' not null comment '?????t???O'
1288
  , ENTRYDATE datetime not null comment '?o?^?N????'
1289
  , UPDATEDATE datetime not null comment '?X?V?N????'
1290
  , constraint invoicedata_PKC primary key (INVOICENO)
1291
) comment '???????f?[?^' ;
1292

1293
alter table invoicedata add unique ORDERERSDIVISION (ORDERERSDIVISION,ORDERERSCODE,REQUESTMONTH,SEQNO) ;
1294

1295
-- ??????
1296
drop table if exists materialinfo cascade;
1297

1298
create table materialinfo (
1299
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1300
  , MATERIALCOUNT smallint(5) unsigned comment '?????'
1301
  , RENTCOUNT smallint(5) unsigned comment '??o??\??'
1302
  , DELETEFLG smallint(5) unsigned comment '???t???O'
1303
  , ENTRYDATE datetime comment '?o?^???t'
1304
  , UPDATEDATE datetime comment '?X?V???t'
1305
  , constraint materialinfo_PKC primary key (MATERIALITEMCODE)
1306
) comment '??????' ;
1307

1308
-- ????i??}?X?^
1309
drop table if exists materialitemmaster cascade;
1310

1311
create table materialitemmaster (
1312
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1313
  , MATERIALKINDCODE smallint(5) unsigned comment '??????R?[?h'
1314
  , MATERIALITEMNAME varchar(40) comment '????i?????'
1315
  , DISPLAYORDER smallint(5) unsigned comment '?\????'
1316
  , DELETEFLG tinyint(3) unsigned comment '???t???O'
1317
  , ENTRYDATE datetime comment '?o?^???t'
1318
  , UPDATEDATE datetime comment '?X?V???t'
1319
  , VERSIONNO decimal(8,0) default '0' not null comment '?o?[?W???????'
1320
  , constraint materialitemmaster_PKC primary key (MATERIALITEMCODE)
1321
) comment '????i??}?X?^' ;
1322

1323
-- ??????}?X?^
1324
drop table if exists materialkindmaster cascade;
1325

1326
create table materialkindmaster (
1327
  MATERIALKINDCODE smallint(5) unsigned default 0 not null comment '??????R?[?h'
1328
  , MATERIALKINDNAME varchar(40) comment '?????????'
1329
  , DISPLAYORDER smallint(5) unsigned comment '?\????'
1330
  , DELETEFLG tinyint(3) unsigned comment '???t???O'
1331
  , ENTRYDATE datetime comment '?o?^???t'
1332
  , UPDATEDATE datetime comment '?X?V???t'
1333
  , constraint materialkindmaster_PKC primary key (MATERIALKINDCODE)
1334
) comment '??????}?X?^' ;
1335

1336
-- ??????????
1337
drop table if exists materialrecordinfo cascade;
1338

1339
create table materialrecordinfo (
1340
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1341
  , PROCESSDATE date default '0000-00-00' not null comment '?????N????'
1342
  , SEQNO smallint(5) unsigned default 0 not null comment '?A??'
1343
  , RECKIND tinyint(3) unsigned comment '???R?[?h??'
1344
  , CONSTRUCTIONCODE int(10) unsigned comment '?H?????'
1345
  , PERSONCODE int(10) unsigned comment '?S????R?[?h'
1346
  , MATERIALCOUNT smallint(5) unsigned comment '?????'
1347
  , REPAYPLANDATE date comment '??p?\??N????'
1348
  , COMMENTTEXT varchar(80) comment '?R?????g'
1349
  , ENTRYDATE datetime comment '?o?^???t'
1350
  , UPDATEDATE datetime comment '?X?V???t'
1351
  , constraint materialrecordinfo_PKC primary key (MATERIALITEMCODE,PROCESSDATE,SEQNO)
1352
) comment '??????????' ;
1353

1354
-- ?f??????b?Z?[?W
1355
drop table if exists messageboarddata cascade;
1356

1357
create table messageboarddata (
1358
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1359
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1360
  , FromCode decimal(8,0) unsigned not null comment '???????R?[?h'
1361
  , FromName varchar(60) not null comment '???????'
1362
  , MessageTitile varchar(100) comment '?`???^?C?g??'
1363
  , MessageContent varchar(1333) not null comment '?`?????e'
1364
  , LinkType decimal(2,0) not null comment '?????N????^?C?v'
1365
  , LinkMessage varchar(200) comment '?????N??????'
1366
  , LinkCode varchar(30) comment '?????N?L?['
1367
  , WritingDate datetime not null comment '?????????'
1368
  , PersonCode decimal(8,0) not null comment '??????S????R?[?h'
1369
  , ShareFlag decimal(2,0) not null comment '???????t???O'
1370
  , MessageColor varchar(8) comment '?????F'
1371
  , BackColor varchar(8) comment '?o?b?N?J???['
1372
  , MessageFlag decimal(1,0) not null comment '???b?Z?[?W?t???O'
1373
  , EntryDate datetime not null comment '?o?^???t'
1374
  , UpdateDate datetime not null comment '?X?V???t'
1375
  , constraint messageboarddata_PKC primary key (RecordNumber,BranchNumber)
1376
) comment '?f??????b?Z?[?W' ;
1377

1378
create index MessageBoardData_Index1
1379
  on messageboarddata(WritingDate);
1380

1381
create index MessageBoardData_Index2
1382
  on messageboarddata(MessageFlag);
1383

1384
-- ?f???????e?[?u??
1385
drop table if exists messageboardterget cascade;
1386

1387
create table messageboardterget (
1388
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1389
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1390
  , SeqNum decimal(3,0) unsigned not null comment '????'
1391
  , ToCode decimal(8,0) not null comment '????R?[?h'
1392
  , ToName varchar(60) not null comment '????'
1393
  , EntryDate datetime not null comment '?o?^???t'
1394
  , UpdateDate datetime not null comment '?X?V???t'
1395
  , constraint messageboardterget_PKC primary key (RecordNumber,BranchNumber,SeqNum)
1396
) comment '?f???????e?[?u??' ;
1397

1398
create index MessageBoardTerget_Index1
1399
  on messageboardterget(RecordNumber,BranchNumber);
1400

1401
-- ?f??????b?Z?[?W?{??????
1402
drop table if exists messagebrowsinghistory cascade;
1403

1404
create table messagebrowsinghistory (
1405
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1406
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1407
  , SeqNum decimal(3,0) unsigned not null comment '????'
1408
  , BrowsingCode decimal(8,0) not null comment '?{????R?[?h'
1409
  , BrowsingDate datetime not null comment '?{?????t'
1410
  , EntryDate datetime not null comment '?o?^???t'
1411
  , UpdateDate datetime not null comment '?X?V???t'
1412
  , constraint messagebrowsinghistory_PKC primary key (RecordNumber,BranchNumber,SeqNum)
1413
) comment '?f??????b?Z?[?W?{??????' ;
1414

1415
-- ???}?X?^
1416
drop table if exists monthmaster cascade;
1417

1418
create table monthmaster (
1419
  month smallint(6) not null comment '??'
1420
) comment '???}?X?^' ;
1421

1422
create index month_Index1
1423
  on monthmaster(month);
1424

1425
-- ??????}?X?^
1426
drop table if exists orderersmaster cascade;
1427

1428
create table orderersmaster (
1429
  OrderCotegory decimal(5,0) unsigned not null comment '???????'
1430
  , OrderersCode decimal(5,0) unsigned not null comment '??????R?[?h'
1431
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1432
  , OrderFlg decimal(1,0) not null comment '?@?l?c??E??l?t???O'
1433
  , CorporateStatusName varchar(100) comment '?@?l?i????'
1434
  , CorporateStatusPoint decimal(1,0) comment '?@?l?i?????u'
1435
  , OrderersName1 varchar(60) not null comment '???????1'
1436
  , OrderersName2 varchar(60) comment '????????Q'
1437
  , DepartmentName varchar(60) comment '??????'
1438
  , ChargePersonName varchar(60) comment '?S?????'
1439
  , ZipCode varchar(8) comment '?X????'
1440
  , Address1 varchar(60) comment '?Z???P'
1441
  , Address2 varchar(60) comment '?Z??2'
1442
  , Address3 varchar(60) comment '?Z??3'
1443
  , PhoneNumber varchar(13) comment '?d?b???'
1444
  , FaxNumber varchar(13) comment 'FAX???'
1445
  , MailAddress varchar(257) comment '???[???A?h???X'
1446
  , Note varchar(300) comment '???l'
1447
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1448
  , EntryDate datetime not null comment '?o?^???t'
1449
  , UpdateDate datetime not null comment '?X?V???t'
1450
  , constraint orderersmaster_PKC primary key (OrderCotegory,OrderersCode)
1451
) comment '??????}?X?^' ;
1452

1453
-- ????z?f?[?^
1454
drop table if exists orderspricedata cascade;
1455

1456
create table orderspricedata (
1457
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1458
  , ChangeNo decimal(3,0) unsigned not null comment '??X???'
1459
  , ChangeDate date not null comment '??X??'
1460
  , ChangePersonCode decimal(8,0) unsigned not null comment '??X??R?[?h'
1461
  , ChangePersonName varchar(60) comment '??X???'
1462
  , BeforeValue decimal(14,0) not null comment '??X?O???????z'
1463
  , BeforeValueInTax decimal(14,0) not null comment '??X?O???????z'
1464
  , AfterValue decimal(14,0) not null comment '??X????????z'
1465
  , AfterValueInTax decimal(14,0) not null comment '??X????????z'
1466
  , ChangeComment varchar(200) comment '??X???R'
1467
  , EntryDate datetime not null comment '?o?^???t'
1468
  , UpdateDate datetime not null comment '?X?V???t'
1469
  , constraint orderspricedata_PKC primary key (ConstructionCode,ChangeNo)
1470
) comment '????z?f?[?^' ;
1471

1472
-- ?x?????F???f?[?^
1473
drop table if exists paymentapprovalinfo cascade;
1474

1475
create table paymentapprovalinfo (
1476
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
1477
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
1478
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
1479
  , LINECOUNT decimal(3,0) default '0' not null comment '?s???'
1480
  , APPROVALNO decimal(3,0) default '0' not null comment '???F????'
1481
  , APPROVALPERSON decimal(8,0) comment '???F??R?[?h'
1482
  , APPROVALPERSONNAME varchar(20) comment '???F???'
1483
  , APPROVALAUTHORITY decimal(1,0) comment '???F??????'
1484
  , APPROVALDATE date comment '???F???t'
1485
  , ENTRYDATE datetime comment '?o?^???t'
1486
  , UPDATEDATE datetime comment '?X?V???t'
1487
  , constraint paymentapprovalinfo_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT,APPROVALNO)
1488
) comment '?x?????F???f?[?^' ;
1489

1490
-- ?x??????f?[?^
1491
drop table if exists paymentdatadetail cascade;
1492

1493
create table paymentdatadetail (
1494
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
1495
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
1496
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
1497
  , LINECOUNT decimal(3,0) default '0' not null comment '?s???'
1498
  , BILLPRICE decimal(10,0) comment '???????z'
1499
  , DISCOUNTPRICE decimal(10,0) comment '?l???????z'
1500
  , OFFSETPRICE decimal(10,0) comment '???E???z'
1501
  , NEXTCOPRICE decimal(10,0) comment '????J?z'
1502
  , HIGHWPRICE decimal(10,0) comment '??????'
1503
  , HARDWPRICE decimal(10,0) comment '??????'
1504
  , INDSWASTETAX decimal(10,0) comment '?Y?p??'
1505
  , CNSTRPRICE decimal(10,0) comment '?????'
1506
  , CNSTRPRICEEXIST decimal(1,0) comment '??????L??'
1507
  , APPROVALPERSONCODE decimal(8,0) comment '???F?S????R?[?h'
1508
  , APPROVALDATE date comment '?S??????F???t'
1509
  , APPROVALENDFLG decimal(1,0) comment '???F?????t???O'
1510
  , ENTRYDATE datetime comment '?o?^???t'
1511
  , UPDATEDATE datetime comment '?X?V???t'
1512
  , constraint paymentdatadetail_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT)
1513
) comment '?x??????f?[?^' ;
1514

1515
create index PayDataDetail_Index1
1516
  on paymentdatadetail(TARGETDATE);
1517

1518
create index PayDataDetail_Index2
1519
  on paymentdatadetail(APPROVALPERSONCODE);
1520

1521
-- ?H??????????f?[?^
1522
drop table if exists periodavoidance cascade;
1523

1524
create table periodavoidance (
1525
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1526
  , ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
1527
  , FieldNo decimal(2,0) not null comment '?`?F?b?N???t?B?[???h???'
1528
  , EntryDate datetime not null comment '?o?^???t'
1529
  , UpdateDate datetime not null comment '?X?V???t'
1530
  , constraint periodavoidance_PKC primary key (ConstructionCode,ConstructionStatusFlg,FieldNo)
1531
) comment '?H??????????f?[?^' ;
1532

1533
create index PeriodAvoidance_Index1
1534
  on periodavoidance(ConstructionCode);
1535

1536
create index PeriodAvoidance_Index2
1537
  on periodavoidance(ConstructionStatusFlg);
1538

1539
create index PeriodAvoidance_Index3
1540
  on periodavoidance(FieldNo);
1541

1542
-- ?S??????F?f?[?^
1543
drop table if exists personapproval cascade;
1544

1545
create table personapproval (
1546
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1547
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1548
  , OrderDate date not null comment '??t??'
1549
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1550
  , SeqNo decimal(2,0) not null comment '?}??'
1551
  , PersonCodeApproval decimal(8,0) unsigned not null comment '?\???E???F??R?[?h'
1552
  , PetitionApprovalDate datetime not null comment '?\???E???F???t'
1553
  , ApprovalLimitDates datetime not null comment '???F??]??'
1554
  , ApprovalStatus decimal(1,0) not null comment '???F???'
1555
  , InputComment varchar(300) comment '?R?????g'
1556
  , EntryDate datetime not null comment '?o?^???t'
1557
  , UpdateDate datetime not null comment '?X?V???t'
1558
  , constraint personapproval_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,SeqNo)
1559
) comment '?S??????F?f?[?^' ;
1560

1561
-- ?S??????F?R?????g?f?[?^
1562
drop table if exists personapprovalcomment cascade;
1563

1564
create table personapprovalcomment (
1565
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1566
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1567
  , OrderDate date not null comment '??t??'
1568
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1569
  , CommentNo decimal(2,0) not null comment '?R?????g???'
1570
  , ParentNo decimal(2,0) not null comment '?e?R?????g???'
1571
  , ApproValComment varchar(300) comment '?w???E?A???R?????g'
1572
  , EntryDate datetime not null comment '?o?^???t'
1573
  , UpdateDate datetime not null comment '?X?V???t'
1574
  , constraint personapprovalcomment_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,CommentNo)
1575
) comment '?S??????F?R?????g?f?[?^' ;
1576

1577
-- ?S??????????}?X?^
1578
drop table if exists persondepartmentmaster cascade;
1579

1580
create table persondepartmentmaster (
1581
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1582
  , DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1583
  , AffiliationFlg decimal(1,0) not null comment '?????t???O'
1584
  , EntryDate datetime not null comment '?o?^???t'
1585
  , UpdateDate datetime not null comment '?X?V???t'
1586
  , constraint persondepartmentmaster_PKC primary key (PersonCode,DepartmentCode)
1587
) comment '?S??????????}?X?^' ;
1588

1589
create index PersonDepartmentMaster_Index1
1590
  on persondepartmentmaster(PersonCode);
1591

1592
create index PersonDepartmentMaster_Index2
1593
  on persondepartmentmaster(DepartmentCode);
1594

1595
-- ?S????}?X?^
1596
drop table if exists personinchargemaster cascade;
1597

1598
create table personinchargemaster (
1599
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1600
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
1601
  , PersonName varchar(60) not null comment '?S?????'
1602
  , StartDate date not null comment '?g?p?J?n?N????'
1603
  , EndDate date comment '?g?p?I???N????'
1604
  , PassWord varchar(16) comment '?p?X???[?h'
1605
  , SecurityManagement decimal(1,0) not null comment '?@????'
1606
  , SecCode decimal(2,0) unsigned not null comment '???????'
1607
  , MsgBackColor varchar(8) comment '???b?Z?[?W?w?i?F'
1608
  , DisplayString varchar(20) comment '?\???E???????'
1609
  , DepartmentCode decimal(5,0) unsigned comment '?????R?[?h'
1610
  , MonthlySalary decimal(11,0) not null comment '???????z'
1611
  , YearSalary decimal(12,0) not null comment '?N????z'
1612
  , Qualification varchar(120) comment '???i?????'
1613
  , SealPrintName varchar(5) comment '???\????'
1614
  , EmployeeClassFlg decimal(1,0) not null comment '?????'
1615
  , LedgerFlg decimal(1,0) not null comment '???v?Z???t???O'
1616
  , CommutingDistance decimal(5,2) not null comment '??????'
1617
  , CommuteCosts decimal(5,0) not null comment '??????'
1618
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1619
  , EntryDate datetime not null comment '?o?^???t'
1620
  , UpdateDate datetime not null comment '?X?V???t'
1621
  , constraint personinchargemaster_PKC primary key (PersonCode)
1622
) comment '?S????}?X?^' ;
1623

1624
create index PersonInChargeMaster_Index1
1625
  on personinchargemaster(StartDate);
1626

1627
create index PersonInChargeMaster_Index2
1628
  on personinchargemaster(DepartmentCode);
1629

1630
-- ?S??????^?}?X?^
1631
drop table if exists personsalarymaster cascade;
1632

1633
create table personsalarymaster (
1634
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1635
  , StartDate date not null comment '?g?p?J?n?N????'
1636
  , MonthlySalary decimal(11,0) not null comment '???????z'
1637
  , YearSalary decimal(12,0) not null comment '?N????z'
1638
  , EntryDate datetime not null comment '?o?^???t'
1639
  , UpdateDate datetime not null comment '?X?V???t'
1640
  , constraint personsalarymaster_PKC primary key (PersonCode,StartDate)
1641
) comment '?S??????^?}?X?^' ;
1642

1643
create index PersonSalaryMaster_Index1
1644
  on personsalarymaster(PersonCode);
1645

1646
create index PersonSalaryMaster_Index2
1647
  on personsalarymaster(StartDate);
1648

1649
-- ?w???????f?[?^
1650
drop table if exists pointingoutcomment cascade;
1651

1652
create table pointingoutcomment (
1653
  ConstructionCode decimal(10,0) not null comment '?H???R?[?h'
1654
  , ProcessNo smallint(6) not null comment '????????i??????j'
1655
  , SeqNo smallint(6) not null comment '????'
1656
  , PageCount smallint(6) not null comment '?y?[?W???'
1657
  , PersonCode decimal(8,0) not null comment '?L????R?[?h'
1658
  , DrowColor varchar(8) comment '?`??F'
1659
  , CommentMessage varchar(1000) comment '???b?Z?[?W'
1660
  , StartPointX smallint(6) not null comment '?w?E?????u?w'
1661
  , StartPointY smallint(6) not null comment '?w?E?????u?x'
1662
  , CurrentPointX smallint(6) not null comment '??????u?w'
1663
  , CurrentPointY smallint(6) not null comment '??????u?x'
1664
  , CurrentWidth smallint(6) not null comment '?\???T?C?YWidth'
1665
  , CurrentHeight smallint(6) not null comment '?\???T?C?YHeigth'
1666
  , EntryDate datetime not null comment '?o?^???t'
1667
  , UpdateDate datetime not null comment '?X?V???t'
1668
  , constraint pointingoutcomment_PKC primary key (ConstructionCode,ProcessNo,SeqNo)
1669
) comment '?w???????f?[?^' ;
1670

1671
-- ?????????????c???^?f?[?^
1672
drop table if exists proceedingsdata cascade;
1673

1674
create table proceedingsdata (
1675
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1676
  , ProceedingsDataDate date not null comment '?c???^????'
1677
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1678
  , EndMeetingTime decimal(4,0) unsigned not null comment '??c????I??'
1679
  , CreatorCode decimal(8,0) not null comment '????R?[?h'
1680
  , PalceFlag decimal(1,0) not null comment '???n?t???O'
1681
  , MeetingPalce varchar(120) comment '???????'
1682
  , EntryDate datetime not null comment '?o?^???t'
1683
  , UpdateDate datetime not null comment '?X?V???t'
1684
  , constraint proceedingsdata_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime)
1685
) comment '?????????????c???^?f?[?^' ;
1686

1687
-- ?????????????c???^?f?[?^?i?o???j
1688
drop table if exists proceedingsdataattend cascade;
1689

1690
create table proceedingsdataattend (
1691
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1692
  , ProceedingsDataDate date not null comment '?c???^????'
1693
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1694
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1695
  , Department varchar(20) comment '?o??????'
1696
  , AttendName varchar(10) comment '?o??????'
1697
  , EntryDate datetime not null comment '?o?^???t'
1698
  , UpdateDate datetime not null comment '?X?V???t'
1699
  , constraint proceedingsdataattend_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
1700
) comment '?????????????c???^?f?[?^?i?o???j' ;
1701

1702
-- ?????????????c???^?f?[?^?i????j
1703
drop table if exists proceedingsdatadetail cascade;
1704

1705
create table proceedingsdatadetail (
1706
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1707
  , ProceedingsDataDate date not null comment '?c???^????'
1708
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1709
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1710
  , TitleNo varchar(5) comment '?c????'
1711
  , Title varchar(20) comment '?c??'
1712
  , ContentsText varchar(50) comment '???e'
1713
  , EntryDate datetime not null comment '?o?^???t'
1714
  , UpdateDate datetime not null comment '?X?V???t'
1715
  , constraint proceedingsdatadetail_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
1716
) comment '?????????????c???^?f?[?^?i????j' ;
1717

1718
-- ???F?f?[?^
1719
drop table if exists processapproval cascade;
1720

1721
create table processapproval (
1722
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1723
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1724
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1725
  , SeqNo decimal(2,0) not null comment '?}??'
1726
  , PersonCode decimal(8,0) unsigned not null comment '?\???E???F??R?[?h'
1727
  , PetitionApprovalDate datetime not null comment '?\???E???F???t'
1728
  , ApprovalLimitDates datetime not null comment '???F??]??'
1729
  , ApprovalStatus decimal(1,0) not null comment '???F???'
1730
  , InputComment varchar(300) comment '?R?????g'
1731
  , EntryDate datetime not null comment '?o?^???t'
1732
  , UpdateDate datetime not null comment '?X?V???t'
1733
  , constraint processapproval_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SeqNo)
1734
) comment '???F?f?[?^' ;
1735

1736
-- ???F?R?????g?f?[?^
1737
drop table if exists processapprovalcomment cascade;
1738

1739
create table processapprovalcomment (
1740
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1741
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1742
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1743
  , CommentNo decimal(2,0) not null comment '?R?????g???'
1744
  , ParentNo decimal(2,0) not null comment '?e?R?????g???'
1745
  , ApproValComment varchar(300) comment '?w???E?A???R?????g'
1746
  , EntryDate datetime not null comment '?o?^???t'
1747
  , UpdateDate datetime not null comment '?X?V???t'
1748
  , constraint processapprovalcomment_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,CommentNo)
1749
) comment '???F?R?????g?f?[?^' ;
1750

1751
-- ???F????f?[?^
1752
drop table if exists processapprovaldetail cascade;
1753

1754
create table processapprovaldetail (
1755
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1756
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1757
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1758
  , SerialNo decimal(2,0) unsigned not null comment '?}??'
1759
  , LinkCode decimal(10,0) not null comment '?????N???'
1760
  , EntryDate datetime not null comment '?o?^???t'
1761
  , UpdateDate datetime not null comment '?X?V???t'
1762
  , constraint processapprovaldetail_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SerialNo)
1763
) comment '???F????f?[?^' ;
1764

1765
-- ?N?????}?X?^
1766
drop table if exists processexcutemaster cascade;
1767

1768
create table processexcutemaster (
1769
  SecCode decimal(2,0) unsigned not null comment '???????'
1770
  , ExecCode decimal(4,0) unsigned not null comment '?N?????????'
1771
  , EditFlg decimal(1,0) not null comment '??W?t???O'
1772
  , EntryDate datetime not null comment '?o?^???t'
1773
  , UpdateDate datetime not null comment '?X?V???t'
1774
  , constraint processexcutemaster_PKC primary key (SecCode,ExecCode)
1775
) comment '?N?????}?X?^' ;
1776

1777
create index ProcessExcuteMaster_Index1
1778
  on processexcutemaster(SecCode);
1779

1780
create index ProcessExcuteMaster_Index2
1781
  on processexcutemaster(ExecCode);
1782

1783
-- ???????f?[?^
1784
drop table if exists purchaseorder cascade;
1785

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

1819
-- ?????????t?f?[?^
1820
drop table if exists purchaseorderdate cascade;
1821

1822
create table purchaseorderdate (
1823
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1824
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1825
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1826
  , SendDate date not null comment '???????X????'
1827
  , ReturnDate date not null comment '???????????'
1828
  , ReturnCheckDate date not null comment '??????????m?F??'
1829
  , EntryDate datetime not null comment '?o?^???t'
1830
  , UpdateDate datetime not null comment '?X?V???t'
1831
  , constraint purchaseorderdate_PKC primary key (ConstructionCode,SeqNo)
1832
) comment '?????????t?f?[?^' ;
1833

1834
-- ??????????f?[?^
1835
drop table if exists purchaseorderdetail cascade;
1836

1837
create table purchaseorderdetail (
1838
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1839
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1840
  , GroupCount decimal(1,0) not null comment '?O???[?v???'
1841
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1842
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1843
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1844
  , FirstString varchar(120) comment '?H??E?i??'
1845
  , SecondString varchar(120) comment '???e????'
1846
  , UnitCount decimal(8,2) not null comment '????'
1847
  , UnitName varchar(30) comment '?P??'
1848
  , UnitPrice decimal(10,0) not null comment '?P??'
1849
  , OrdersLinePrice decimal(12,0) comment '???z'
1850
  , SourceCode decimal(10,0) unsigned not null comment '???H?????'
1851
  , SourceDetailCnt decimal(4,0) unsigned not null comment '????????'
1852
  , DataTypeFlag decimal(1,0) unsigned not null comment '?f?[?^?^?C?v?t???O'
1853
  , EntryDate datetime not null comment '?o?^???t'
1854
  , UpdateDate datetime not null comment '?X?V???t'
1855
  , constraint purchaseorderdetail_PKC primary key (ConstructionCode,SeqNo,GroupCount,LineCount)
1856
) comment '??????????f?[?^' ;
1857

1858
create index POrderDetail_Index1
1859
  on purchaseorderdetail(SourceCode);
1860

1861
-- ?????f?[?^
1862
drop table if exists requestdata cascade;
1863

1864
create table requestdata (
1865
  REQUESTNO decimal(9,0) not null comment '????No'
1866
  , MAINCONSTRUCTIONCODE decimal(10,0) not null comment '?{?H?????'
1867
  , CONSTRUCTIONNAME varchar(120) not null comment '?H??????'
1868
  , CONTRACTAMOUNT decimal(10,0) not null comment '???????z'
1869
  , PAIDAMOUNT decimal(10,0) not null comment '????????z'
1870
  , REQUESTAMOUNT0 decimal(10,0) not null comment '???????z?O'
1871
  , REQUESTAMOUNT1 decimal(10,0) not null comment '???????z?P'
1872
  , REQUESTAMOUNT2 decimal(10,0) comment '???????z?Q'
1873
  , REQUESTAMOUNT3 decimal(10,0) comment '???????z?R'
1874
  , REQUESTAMOUNT4 decimal(10,0) comment '???????z?S'
1875
  , REQUESTAMOUNT5 decimal(10,0) comment '???????z?T'
1876
  , REQUESTAMOUNT6 decimal(10,0) comment '???????z?U'
1877
  , UNCLAIMEDAMOUNT decimal(10,0) not null comment '?????c???z'
1878
  , UNPAIDAMOUNT decimal(10,0) not null comment '?????????z'
1879
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1880
  , NOTE varchar(120) not null comment '???l'
1881
  , ENTRYDATE datetime not null comment '?o?^?N????'
1882
  , UPDATEDATE datetime not null comment '?X?V?N????'
1883
  , constraint requestdata_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE)
1884
) comment '?????f?[?^' ;
1885

1886
-- ?????f?[?^????
1887
drop table if exists requestdatadetail cascade;
1888

1889
create table requestdatadetail (
1890
  REQUESTNO decimal(9,0) not null comment '????No'
1891
  , MAINCONSTRUCTIONCODE decimal(10,0) not null comment '?{?H?????'
1892
  , CONSTRUCTIONCODE decimal(10,0) not null comment '?H?????'
1893
  , CONSTRUCTIONKIND decimal(1,0) not null comment '?H????'
1894
  , REQUESTAMOUNT decimal(10,0) not null comment '???????z'
1895
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1896
  , ENTRYDATE datetime not null comment '?o?^?N????'
1897
  , UPDATEDATE datetime not null comment '?X?V?N????'
1898
  , constraint requestdatadetail_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE,CONSTRUCTIONCODE,CONSTRUCTIONKIND)
1899
) comment '?????f?[?^????' ;
1900

1901
-- ?????w?b?_
1902
drop table if exists requesthead cascade;
1903

1904
create table requesthead (
1905
  REQUESTNO decimal(9,0) not null comment '????No'
1906
  , REQCONSTRUCTIONCODE decimal(10,0) not null comment '?????H?????'
1907
  , ORDERNO decimal(2,0) not null comment '??t???'
1908
  , REQUESTMONTH decimal(6,0) not null comment '??????'
1909
  , ORDERERSDIVISION decimal(5,0) not null comment '???????'
1910
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1911
  , ORDERERSNAME varchar(120) not null comment '???????'
1912
  , REQCONSTRUCTIONNAME varchar(120) not null comment '?????H??????'
1913
  , REQUESTTOTALAMOUNT decimal(10,0) not null comment '???????z???v'
1914
  , REQUESTAMOUNT decimal(10,0) not null comment '???????z'
1915
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1916
  , UNPAIDAMOUNT decimal(10,0) comment '??????'
1917
  , NOTE varchar(120) comment '???l'
1918
  , ASSIGNEDFLG decimal(1,0) comment '??????t???O'
1919
  , INVOICENO decimal(9,0) not null comment '??????No'
1920
  , ENTRYDATE datetime not null comment '?o?^?N????'
1921
  , UPDATEDATE datetime not null comment '?X?V?N????'
1922
  , constraint requesthead_PKC primary key (REQUESTNO)
1923
) comment '?????w?b?_' ;
1924

1925
alter table requesthead add unique REQCONSTRUCTIONCODE (REQCONSTRUCTIONCODE,ORDERNO) ;
1926

1927
-- ?????????t?f?[?^
1928
drop table if exists requestorderdate cascade;
1929

1930
create table requestorderdate (
1931
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1932
  , InvoiceNo decimal(9,0) not null comment '??????No'
1933
  , SendDate date not null comment '???????????X????'
1934
  , EntryDate datetime not null comment '?o?^???t'
1935
  , UpdateDate datetime not null comment '?X?V???t'
1936
  , constraint requestorderdate_PKC primary key (ConstructionCode,InvoiceNo)
1937
) comment '?????????t?f?[?^' ;
1938

1939
-- ????O???t?f?[?^
1940
drop table if exists salesgraphdata cascade;
1941

1942
create table salesgraphdata (
1943
  GraphDataCode decimal(8,0) not null comment '?O???t?f?[?^?R?[?h'
1944
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
1945
  , SalesDataDays date not null comment '????N??'
1946
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
1947
  , DataName varchar(100) not null comment '?f?[?^?\??????'
1948
  , SalesAmount decimal(10,0) not null comment '????f?[?^'
1949
  , AdministrativeExpense decimal(10,0) not null comment '???E?????o??'
1950
  , GrossProfit decimal(10,0) not null comment '?e???v'
1951
  , NetIncome decimal(10,0) not null comment '?????v(???v)'
1952
  , EntryDate datetime not null comment '?o?^???t'
1953
  , UpdateDate datetime not null comment '?X?V???t'
1954
  , constraint salesgraphdata_PKC primary key (GraphDataCode,ConstructionPeriod,SalesDataDays)
1955
) comment '????O???t?f?[?^' ;
1956

1957
create index SalesGraphData_Idx1
1958
  on salesgraphdata(DisplayOrder);
1959

1960
create index SalesGraphData_idx2
1961
  on salesgraphdata(ConstructionPeriod);
1962

1963
-- ?????}?X?^
1964
drop table if exists securitymaster cascade;
1965

1966
create table securitymaster (
1967
  SecCode decimal(2,0) unsigned not null comment '???????'
1968
  , DisplayOrder decimal(2,0) not null comment '?\????'
1969
  , SecName varchar(60) not null comment '????????'
1970
  , SecRank decimal(1,0) not null comment '?????????N'
1971
  , SecRange decimal(1,0) not null comment '???????'
1972
  , GeneralAffairs decimal(1,0) not null comment '????????t???O'
1973
  , SelectBackColor varchar(8) not null comment '?I??w?i?F'
1974
  , EntryDate datetime not null comment '?o?^???t'
1975
  , UpdateDate datetime not null comment '?X?V???t'
1976
  , constraint securitymaster_PKC primary key (SecCode)
1977
) comment '?????}?X?^' ;
1978

1979
create index SecurityMaster_Index1
1980
  on securitymaster(DisplayOrder);
1981

1982
create index SecurityMaster_Index2
1983
  on securitymaster(SecRank);
1984

1985
create index SecurityMaster_Index3
1986
  on securitymaster(SecRange);
1987

1988
-- ???S?p?g???[???f?[?^
1989
drop table if exists sfpdata cascade;
1990

1991
create table sfpdata (
1992
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1993
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
1994
  , RequestDate datetime not null comment '?p?g???[???v??????'
1995
  , PersonCode decimal(8,0) unsigned not null comment '?\????R?[?h'
1996
  , StringValue varchar(300) comment '?R?????g'
1997
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
1998
  , EntryDate datetime not null comment '?o?^???t'
1999
  , UpdateDate datetime not null comment '?X?V???t'
2000
  , constraint sfpdata_PKC primary key (ConstructionCode,DataCount)
2001
) comment '???S?p?g???[???f?[?^' ;
2002

2003
create index SFPData_Index1
2004
  on sfpdata(RequestDate);
2005

2006
-- ???S?p?g???[??????f?[?^
2007
drop table if exists sfpdatadetail cascade;
2008

2009
create table sfpdatadetail (
2010
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
2011
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
2012
  , SeqNo decimal(2,0) unsigned not null comment '?f?[?^?}??'
2013
  , CompanyCode decimal(8,0) unsigned not null comment '??????R?[?h'
2014
  , EntryDate datetime not null comment '?o?^???t'
2015
  , UpdateDate datetime not null comment '?X?V???t'
2016
  , constraint sfpdatadetail_PKC primary key (ConstructionCode,DataCount,SeqNo)
2017
) comment '???S?p?g???[??????f?[?^' ;
2018

2019
-- ??????{?H?H??o?^?\???f?[?^
2020
drop table if exists subconstrjobitemregist cascade;
2021

2022
create table subconstrjobitemregist (
2023
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2024
  , CreateDate date not null comment '????'
2025
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2026
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2027
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2028
  , EntryDate datetime not null comment '?o?^???t'
2029
  , UpdateDate datetime not null comment '?X?V???t'
2030
  , constraint subconstrjobitemregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
2031
) comment '??????{?H?H??o?^?\???f?[?^' ;
2032

2033
-- ??????E?????N?o?^?\???f?[?^
2034
drop table if exists subconstrjoblinkregist cascade;
2035

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

2047
-- ??????o?^?\???f?[?^
2048
drop table if exists subconstrregist cascade;
2049

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

2082
-- ??????H??}?X?^
2083
drop table if exists subcontractoritemmaster cascade;
2084

2085
create table subcontractoritemmaster (
2086
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2087
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2088
  , ItemName varchar(120) not null comment '?H????'
2089
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2090
  , EntryDate datetime not null comment '?o?^???t'
2091
  , UpdateDate datetime not null comment '?X?V???t'
2092
  , constraint subcontractoritemmaster_PKC primary key (ItemCode)
2093
) comment '??????H??}?X?^' ;
2094

2095
-- ??????E??}?X?^
2096
drop table if exists subcontractorjobcategory cascade;
2097

2098
create table subcontractorjobcategory (
2099
  JobCategoryCode decimal(5,0) not null comment '?E??L?['
2100
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2101
  , JobCategoryName varchar(120) not null comment '?E????'
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 subcontractorjobcategory_PKC primary key (JobCategoryCode)
2106
) comment '??????E??}?X?^' ;
2107

2108
-- ??????{?H?H??f?[?^
2109
drop table if exists subcontractorjobitem cascade;
2110

2111
create table subcontractorjobitem (
2112
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2113
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2114
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2115
  , EntryDate datetime not null comment '?o?^???t'
2116
  , UpdateDate datetime not null comment '?X?V???t'
2117
  , constraint subcontractorjobitem_PKC primary key (CompanyCode,ItemCode)
2118
) comment '??????{?H?H??f?[?^' ;
2119

2120
create index SubContractorJobItem_Index1
2121
  on subcontractorjobitem(CompanyCode);
2122

2123
create index SubContractorJobItem_Index2
2124
  on subcontractorjobitem(ItemCode);
2125

2126
-- ??????E?????N?}?X?^
2127
drop table if exists subcontractorjoblink cascade;
2128

2129
create table subcontractorjoblink (
2130
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2131
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
2132
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2133
  , EntryDate datetime not null comment '?o?^???t'
2134
  , UpdateDate datetime not null comment '?X?V???t'
2135
  , constraint subcontractorjoblink_PKC primary key (CompanyCode,JobCategoryCode)
2136
) comment '??????E?????N?}?X?^' ;
2137

2138
create index SubContractorJobLink_Index1
2139
  on subcontractorjoblink(CompanyCode);
2140

2141
create index SubContractorJobLink_Index2
2142
  on subcontractorjoblink(JobCategoryCode);
2143

2144
-- ??????}?X?^
2145
drop table if exists subcontractormaster cascade;
2146

2147
create table subcontractormaster (
2148
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2149
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2150
  , CorporateStatusName varchar(40) comment '?@?l?i????'
2151
  , CorporateStatusPoint decimal(1,0) not null comment '?@?l?i?????u'
2152
  , CompanyName varchar(100) not null comment '???????'
2153
  , CEOPositionName varchar(60) comment '??\???E??'
2154
  , CEOName varchar(60) comment '??\?????'
2155
  , ContactPersonName varchar(60) comment '?S???????'
2156
  , ZipCode varchar(8) comment '?X????'
2157
  , Address1 varchar(60) comment '?Z???P'
2158
  , Address2 varchar(60) comment '?Z??2'
2159
  , Address3 varchar(60) comment '?Z??3'
2160
  , CellPhoneNumber varchar(13) comment '?g??d?b???'
2161
  , MailAddress varchar(257) comment '???[???A?h???X'
2162
  , PhoneNumber varchar(13) comment '?d?b???'
2163
  , FaxNumber varchar(13) comment 'FAX???'
2164
  , JapaneseSyllabary varchar(2) comment '50?????'
2165
  , StartDate date not null comment '????J?n?N????'
2166
  , Note varchar(300) comment '???l'
2167
  , labourKind decimal(1,0) not null comment '?x???????E????'
2168
  , DeleteFlg decimal(1,0) default '0' not null comment '???t???O'
2169
  , EntryDate datetime not null comment '?o?^???t'
2170
  , UpdateDate datetime not null comment '?X?V???t'
2171
  , constraint subcontractormaster_PKC primary key (CompanyCode)
2172
) comment '??????}?X?^' ;
2173

2174
create index SubContractorMaster_Index1
2175
  on subcontractormaster(JapaneseSyllabary);
2176

2177
-- ?d????}?X?^
2178
drop table if exists suppliersmaster cascade;
2179

2180
create table suppliersmaster (
2181
  SuppliersCode decimal(5,0) unsigned not null comment '?d????R?[?h'
2182
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2183
  , SuppliersName1 varchar(60) not null comment '?d????1'
2184
  , SuppliersName2 varchar(60) comment '?d?????Q'
2185
  , ZipCode varchar(8) comment '?X????'
2186
  , Address1 varchar(60) comment '?Z???P'
2187
  , Address2 varchar(60) comment '?Z??2'
2188
  , Address3 varchar(60) comment '?Z??3'
2189
  , PhoneNumber varchar(13) comment '?d?b???'
2190
  , FaxNumber varchar(13) comment 'FAX???'
2191
  , Note varchar(300) comment '???l'
2192
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2193
  , EntryDate datetime not null comment '?o?^???t'
2194
  , UpdateDate datetime not null comment '?X?V???t'
2195
  , constraint suppliersmaster_PKC primary key (SuppliersCode)
2196
) comment '?d????}?X?^' ;
2197

2198
-- ?V?X?e???N???m?F?f?[?^
2199
drop table if exists systemexecute cascade;
2200

2201
create table systemexecute (
2202
  PrimaryCode tinyint(4) not null comment '?L?[????'
2203
  , TargetDate date not null comment '?N?????t'
2204
  , SystemVersion int(11) not null comment '?{??E????o?[?W????'
2205
  , UpDateCopyVersion int(11) not null comment '?R?s?[?o?[?W????'
2206
  , EntryDate datetime not null comment '?o?^???t'
2207
  , UpdateDate datetime not null comment '?X?V???t'
2208
  , constraint systemexecute_PKC primary key (PrimaryCode)
2209
) comment '?V?X?e???N???m?F?f?[?^' ;
2210

2211
-- ????}?X?^
2212
drop table if exists systemmaster cascade;
2213

2214
create table systemmaster (
2215
  SystemCode decimal(3,0) unsigned not null comment '???R?[?h'
2216
  , CompanyName1 varchar(60) not null comment '?????P'
2217
  , CompanyName2 varchar(60) comment '?????Q'
2218
  , CEOName varchar(60) not null comment '??\?????'
2219
  , CEOPositionName varchar(60) comment '??\???E??'
2220
  , ZipCode varchar(8) not null comment '?X????'
2221
  , Address1 varchar(60) not null comment '?Z???P'
2222
  , Address2 varchar(60) comment '?Z??2'
2223
  , Address3 varchar(60) comment '?Z??3'
2224
  , PhoneNumber varchar(13) not null comment '?d?b???'
2225
  , FaxNumber varchar(13) comment 'FAX???'
2226
  , HomePageURL varchar(120) comment '?z?[???y?[?WURL'
2227
  , ConstructionExpenses decimal(4,2) not null comment '?H?????o??'
2228
  , OfficeExpenses decimal(4,2) not null comment '???????o??'
2229
  , OperatingExpenses decimal(4,2) not null comment '?c??o??'
2230
  , ConsumptionTax decimal(4,2) not null comment '?????'
2231
  , CooperationRate decimal(4,2) not null comment '???????'
2232
  , StatutoryWelfareRate decimal(4,2) not null comment '?@???????'
2233
  , FuelPrice decimal(5,2) not null comment '?R???L???P??'
2234
  , AreaDistance decimal(5,2) not null comment '????u????????'
2235
  , ExcelSavePath varchar(120) comment 'Excel????p?X'
2236
  , BusinessPeriod smallint(6) not null comment '????c?????'
2237
  , ConstructionYear smallint(6) not null comment '????H???N?x'
2238
  , BusinessBeginningDate varchar(5) not null comment '?c????????'
2239
  , ConstructionBeginningDate varchar(5) not null comment '?H???N?x?????'
2240
  , ConstructionNoBase decimal(1,0) not null comment '?H????????l'
2241
  , SloganString1 varchar(100) comment '?W??1'
2242
  , SloganString2 varchar(100) comment '?W??2'
2243
  , SloganString3 varchar(100) comment '?W??3'
2244
  , EntryDate datetime not null comment '?o?^???t'
2245
  , UpdateDate datetime not null comment '?X?V???t'
2246
  , constraint systemmaster_PKC primary key (SystemCode)
2247
) comment '????}?X?^' ;
2248

2249
-- ?????}?X?^
2250
drop table if exists termmaster cascade;
2251

2252
create table termmaster (
2253
  ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
2254
  , FieldNo decimal(2,0) not null comment '?`?F?b?N???t?B?[???h???'
2255
  , SeqNo decimal(2,0) not null comment '?}??'
2256
  , DisplayOrder decimal(2,0) not null comment '?\????'
2257
  , CheckSchdule decimal(1,0) not null comment '?`?F?b?N?^?C?~???O'
2258
  , TermDays decimal(3,0) not null comment '?o???'
2259
  , SendTitile varchar(100) comment '?^?C?g??'
2260
  , SendMessage varchar(100) comment '???b?Z?[?W'
2261
  , BackColor varchar(8) comment '?w?i?F'
2262
  , ForeColor varchar(8) comment '?????F'
2263
  , EntryDate datetime not null comment '?o?^???t'
2264
  , UpdateDate datetime not null comment '?X?V???t'
2265
  , constraint termmaster_PKC primary key (ConstructionStatusFlg,FieldNo,SeqNo)
2266
) comment '?????}?X?^' ;
2267

2268
create index TermMaster_Index1
2269
  on termmaster(DisplayOrder);
2270

2271
-- ?o?????f?[?^
2272
drop table if exists tranceportdailydata cascade;
2273

2274
create table tranceportdailydata (
2275
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
2276
  , AttendanceDate date not null comment '???????'
2277
  , StartDistance decimal(7,1) not null comment '?????o???L????'
2278
  , ComplateDistance decimal(7,1) not null comment '?????I???L????'
2279
  , TotalDistance decimal(6,1) not null comment '???????v?L????'
2280
  , OfficeGoFlg decimal(1,0) not null comment '???????o??t???O'
2281
  , OfficeOutFlg decimal(1,0) not null comment '???????A??t???O'
2282
  , TrancePayGoFlg decimal(1,0) not null comment '?L?????o??t???O'
2283
  , TrancePayOutFlg decimal(1,0) not null comment '?L?????A??t???O'
2284
  , WareHouseFlg decimal(1,0) not null comment '????u??t???O'
2285
  , EntryDate datetime not null comment '?o?^???t'
2286
  , UpdateDate datetime not null comment '?X?V???t'
2287
  , constraint tranceportdailydata_PKC primary key (PersonCode,AttendanceDate)
2288
) comment '?o?????f?[?^' ;
2289

2290
create index TranceportDailyData_Index1
2291
  on tranceportdailydata(AttendanceDate);
2292

2293
-- ?H?????o???}?X?^
2294
drop table if exists typeexpensesmaster cascade;
2295

2296
create table typeexpensesmaster (
2297
  TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
2298
  , ExpensesPeriod smallint(6) not null comment '?????'
2299
  , NameCode decimal(5,0) unsigned not null comment '?o????R?[?h'
2300
  , ExpensesRaito decimal(4,2) not null comment '?o??'
2301
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2302
  , EntryDate datetime not null comment '?o?^???t'
2303
  , UpdateDate datetime not null comment '?X?V???t'
2304
  , constraint typeexpensesmaster_PKC primary key (TypeCode,ExpensesPeriod,NameCode)
2305
) comment '?H?????o???}?X?^' ;
2306

2307
-- ?P??}?X?^
2308
drop table if exists unitmaster cascade;
2309

2310
create table unitmaster (
2311
  UnitKey decimal(5,0) unsigned not null comment '?P??L?['
2312
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2313
  , UnitName varchar(30) not null comment '?P?????'
2314
  , EntryDate datetime not null comment '?o?^???t'
2315
  , UpdateDate datetime not null comment '?X?V???t'
2316
  , constraint unitmaster_PKC primary key (UnitKey)
2317
) comment '?P??}?X?^' ;
2318

2319
create index UnitMaster_Index1
2320
  on unitmaster(DisplayOrder);
2321

2322
-- ????}?X?^
2323
drop table if exists vehiclemaster cascade;
2324

2325
create table vehiclemaster (
2326
  VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2327
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2328
  , VehicleName varchar(100) not null comment '???????'
2329
  , RegistrationNumber varchar(30) comment '?o?^???'
2330
  , IdentificationNumber varchar(30) comment '?????'
2331
  , ModelCode varchar(30) comment '?^??'
2332
  , DepartmentCode decimal(5,0) unsigned not null comment '???????'
2333
  , VehicleScheduleFlg decimal(1,0) not null comment '????\??\???t???O'
2334
  , PurchaseDate date comment '?w????'
2335
  , PurchaseName varchar(30) comment '?w????'
2336
  , PurchaseContactPersons varchar(30) comment '?w????S????'
2337
  , PurchasePhone varchar(13) comment '?w????d?b???'
2338
  , LeaseDate date comment '???[?X?J?n??'
2339
  , LeaseDestination varchar(30) comment '???[?X??'
2340
  , LeaseContactPersons varchar(30) comment '???[?X??S????'
2341
  , LeasePhone varchar(13) comment '???[?X??d?b???'
2342
  , InsuranceCompany varchar(30) comment '?C???????'
2343
  , InsuranceContactPersons varchar(30) comment '?C???????S????'
2344
  , InsurancePhone varchar(13) comment '?C???????d?b???'
2345
  , Note varchar(300) comment '???l'
2346
  , EntryDate datetime comment '?o?^???t'
2347
  , UpdateDate datetime comment '?X?V???t'
2348
  , constraint vehiclemaster_PKC primary key (VehicleCode)
2349
) comment '????}?X?^' ;
2350

2351
-- ????L?^?f?[?^
2352
drop table if exists vehiclerecorddata cascade;
2353

2354
create table vehiclerecorddata (
2355
  VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2356
  , DivisionCode decimal(2,0) unsigned not null comment '?f?[?^??'
2357
  , SeqNo decimal(2,0) not null comment '?}??'
2358
  , RecordDate date comment '???n??'
2359
  , Mileage mediumint(9) comment '???s????'
2360
  , Content varchar(100) comment '???e'
2361
  , PaymentCost decimal(10,0) comment '??p'
2362
  , EntryDate datetime not null comment '?o?^???t'
2363
  , UpdateDate datetime not null comment '?X?V???t'
2364
  , constraint vehiclerecorddata_PKC primary key (VehicleCode,DivisionCode,SeqNo)
2365
) comment '????L?^?f?[?^' ;
2366

2367
-- ????\??f?[?^
2368
drop table if exists vehiclescheduledata cascade;
2369

2370
create table vehiclescheduledata (
2371
  TargetDate date not null comment '????'
2372
  , VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2373
  , MorningAfternoon decimal(1,0) not null comment '??O?E???'
2374
  , PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
2375
  , TargetYear year(4) not null comment '?Y???N'
2376
  , TargetMonth tinyint(3) unsigned not null comment '?Y????'
2377
  , TargetDay year(4) not null comment '?Y????'
2378
  , EntryDate datetime not null comment '?o?^???t'
2379
  , UpdateDate datetime not null comment '?X?V???t'
2380
  , constraint vehiclescheduledata_PKC primary key (TargetDate,VehicleCode,MorningAfternoon)
2381
) comment '????\??f?[?^' ;
2382

2383
create index VehicleScheduleData_Index1
2384
  on vehiclescheduledata(TargetYear);
2385

2386
create index VehicleScheduleData_Index2
2387
  on vehiclescheduledata(TargetMonth);
2388

2389
create index VehicleScheduleData_Index3
2390
  on vehiclescheduledata(TargetDay);
2391

2392
-- ?N?}?X?^
2393
drop table if exists yearmaster cascade;
2394

2395
create table yearmaster (
2396
  years smallint(6) not null comment '?N'
2397
) comment '?N?}?X?^' ;
2398

2399
create index year_Index1
2400
  on yearmaster(years);
2401