プロジェクト

全般

プロフィール

統計
| リビジョン:

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

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

1
-- Project Name : noname
2
-- Date/Time    : 2017/12/12 10:48:17
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
  , EntryDate datetime not null comment '?o?^???t'
474
  , UpdateDate datetime not null comment '?X?V???t'
475
  , constraint constructionbaseinfo_PKC primary key (ConstructionCode)
476
) comment '?H????{???' ;
477

    
478
create index BaseInfo_Index1
479
  on constructionbaseinfo(ConstructionStatusFlg);
480

    
481
create index BaseInfo_Index2
482
  on constructionbaseinfo(EstimateType);
483

    
484
create index BaseInfo_Index3
485
  on constructionbaseinfo(SalesPersonCode);
486

    
487
create index BaseInfo_Index4
488
  on constructionbaseinfo(ConstructionPersonCode);
489

    
490
create index BaseInfo_Index5
491
  on constructionbaseinfo(ConstructionInstructor);
492

    
493
create index BaseInfo_Index6
494
  on constructionbaseinfo(ConstructionPeriod);
495

    
496
-- ?H????{????
497
drop table if exists constructionbaseinfodetail cascade;
498

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

    
508
create index BaseInfoDetail_Idx1
509
  on constructionbaseinfodetail(ConstructionCode);
510

    
511
create index BaseInfoDetail_Idx2
512
  on constructionbaseinfodetail(DetailNo);
513

    
514
-- ?H???{?H?\?Z?f?[?^
515
drop table if exists constructionbudget cascade;
516

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

    
545
-- ?H???{?H?\?Z?f?[?^????
546
drop table if exists constructionbudgetdetail cascade;
547

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

    
570
-- ?H??}?X?^
571
drop table if exists constructionitemmaster cascade;
572

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

    
585
-- ?H???????f?[?^
586
drop table if exists constructionledger cascade;
587

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

    
612
-- ?H??????????f?[?^
613
drop table if exists constructionledgerdetail cascade;
614

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

    
646
create index LedgerDetail_Index01
647
  on constructionledgerdetail(ConstructionCode);
648

    
649
create index LedgerDetail_Index02
650
  on constructionledgerdetail(GroupCount);
651

    
652
create index LedgerDetail_Index03
653
  on constructionledgerdetail(LineCount);
654

    
655
create index LedgerDetail_Index04
656
  on constructionledgerdetail(SourceCode);
657

    
658
create index LedgerDetail_Index05
659
  on constructionledgerdetail(DetailCount);
660

    
661
-- ?H?????????s?f?[?^
662
drop table if exists constructionledgerexcute cascade;
663

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

    
676
create index LedgerExcute_Index1
677
  on constructionledgerexcute(ConstructionCode,TargetMonth,GroupCount,LineCount);
678

    
679
-- ?H???????N???
680
drop table if exists constructionlink cascade;
681

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

    
691
create index ConstructionLink_Index1
692
  on constructionlink(ConstructionCode);
693

    
694
create index ConstructionLink_Index2
695
  on constructionlink(FluctuationCode);
696

    
697
create index ConstructionLink_Index3
698
  on constructionlink(LinkType);
699

    
700
-- ?H????????
701
drop table if exists constructionmaterialinfo cascade;
702

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

    
716
-- ????i?????t?f?[?^
717
drop table if exists constructionprogressdate cascade;
718

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

    
730
-- ???}?X?^
731
drop table if exists constructionspecmaster cascade;
732

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

    
747
create index ConstructionSpecMaster_Index1
748
  on constructionspecmaster(DisplayOrder);
749

    
750
-- ???P???}?X?^
751
drop table if exists constructionspecunitprice cascade;
752

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

    
764
-- ?H?????}?X?^
765
drop table if exists constructiontypemaster cascade;
766

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

    
780
-- ?S??????o??f?[?^
781
drop table if exists costdataofperson cascade;
782

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

    
804
create index CostDataOfPerson_Index1
805
  on costdataofperson(TargetMonth);
806

    
807
create index CostDataOfPerson_Index2
808
  on costdataofperson(ConstructionCode);
809

    
810
-- ??????o?^?\???f?[?^
811
drop table if exists costomerregist cascade;
812

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

    
844
create index CostomerRegist_Index1
845
  on costomerregist(PetitionPeriod);
846

    
847
-- ????f?[?^
848
drop table if exists dailydataconstruction cascade;
849

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

    
860
create index DailyDataConstruction_Index1
861
  on dailydataconstruction(PersonCode);
862

    
863
create index DailyDataConstruction_Index2
864
  on dailydataconstruction(DailyDataDate);
865

    
866
create index DailyDataConstruction_Index3
867
  on dailydataconstruction(ConstructionCode);
868

    
869
-- ????f?[?^ (????)
870
drop table if exists dailydatadetail cascade;
871

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

    
889
create index DailyDataDetail_Index
890
  on dailydatadetail(PersonCode,DailyDataDate,ConstructionCode);
891

    
892
-- ????f?[?^ (??????)
893
drop table if exists dailydatafield cascade;
894

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

    
907
create index DailyDataField_Index
908
  on dailydatafield(PersonCode,DailyDataDate,ConstructionCode);
909

    
910
-- ????f?[?^ (????)
911
drop table if exists dailydatamaterials cascade;
912

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

    
928
create index DailyDataMaterials_Index
929
  on dailydatamaterials(PersonCode,DailyDataDate,ConstructionCode);
930

    
931
-- ????f?[?^ (??????w??)
932
drop table if exists dailydatasubcontractors cascade;
933

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

    
946
create index DailyDataSubcontractors_Index
947
  on dailydatasubcontractors(PersonCode,DailyDataDate,ConstructionCode);
948

    
949
-- ????f?[?^ (???)
950
drop table if exists dailydatavehicles cascade;
951

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

968
create index DailyDataVehicles_Index
969
  on dailydatavehicles(PersonCode,DailyDataDate,ConstructionCode);
970

971
-- ???}?X?^
972
drop table if exists daymaster cascade;
973

974
create table daymaster (
975
  days smallint(6) not null comment '??'
976
) comment '???}?X?^' ;
977

978
create index day_Index1
979
  on daymaster(days);
980

981
-- ?????}?X?^
982
drop table if exists deadlinemaster cascade;
983

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

995
-- ?????o???}?X?^
996
drop table if exists departmentexpensesmaster cascade;
997

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

1010
-- ?????}?X?^
1011
drop table if exists departmentmaster cascade;
1012

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

1025
create index DepartmentMaster_index1
1026
  on departmentmaster(DisplayOrder);
1027

1028
-- ?????m?F???F?f?[?^
1029
drop table if exists depositapprovalinfo cascade;
1030

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

1047
-- ?????f?[?^
1048
drop table if exists depositdata cascade;
1049

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

1067
-- ????????f?[?^
1068
drop table if exists depositdatadetail cascade;
1069

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

1091
-- ???}?X?^
1092
drop table if exists divisionmaster cascade;
1093

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

1105
-- ??Z?\?Z???f?[?^
1106
drop table if exists estimatebudget cascade;
1107

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

1123
-- ??Z?\?Z????f?[?^????
1124
drop table if exists estimatebudgetdetail cascade;
1125

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

1144
-- ??Z????f?[?^
1145
drop table if exists estimatedata cascade;
1146

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

1163
create index EstimateData_Index1
1164
  on estimatedata(ConstructionCode,FixedItemCode);
1165

1166
-- ??Z????y?[?W?f?[?^
1167
drop table if exists estimatedatabody cascade;
1168

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

1184
create index EstimateDataBody_Index1
1185
  on estimatedatabody(ConstructionCode,ComponentCode,ItemCode);
1186

1187
-- ??Z????f?[?^????
1188
drop table if exists estimatedatadetail cascade;
1189

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

1213
create index EstimateDataDetail_Index1
1214
  on estimatedatadetail(ConstructionCode,PageCount);
1215

1216
-- ?o???}?X?^
1217
drop table if exists expensesmaster cascade;
1218

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

1230
-- ???x???}?X?^
1231
drop table if exists holidaycalendermaster cascade;
1232

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

1241
create index HolidayCalender_Index1
1242
  on holidaycalendermaster(BusinessYear);
1243

1244
create index HolidayCalenderMaster_Index2
1245
  on holidaycalendermaster(TargetMonth);
1246

1247
create index HolidayCalenderMaster_Index3
1248
  on holidaycalendermaster(TargetDay);
1249

1250
-- ?????????????
1251
drop table if exists inputsearchlogdata cascade;
1252

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

1262
create index InputSearchLogData_Index1
1263
  on inputsearchlogdata(ConstructionCode,UsedProcessNo,InputCode);
1264

1265
-- ???????f?[?^
1266
drop table if exists invoicedata cascade;
1267

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

1290
alter table invoicedata add unique ORDERERSDIVISION (ORDERERSDIVISION,ORDERERSCODE,REQUESTMONTH,SEQNO) ;
1291

1292
-- ??????
1293
drop table if exists materialinfo cascade;
1294

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

1305
-- ????i??}?X?^
1306
drop table if exists materialitemmaster cascade;
1307

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

1320
-- ??????}?X?^
1321
drop table if exists materialkindmaster cascade;
1322

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

1333
-- ??????????
1334
drop table if exists materialrecordinfo cascade;
1335

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

1351
-- ?f??????b?Z?[?W
1352
drop table if exists messageboarddata cascade;
1353

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

1375
create index MessageBoardData_Index1
1376
  on messageboarddata(WritingDate);
1377

1378
create index MessageBoardData_Index2
1379
  on messageboarddata(MessageFlag);
1380

1381
-- ?f???????e?[?u??
1382
drop table if exists messageboardterget cascade;
1383

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

1395
create index MessageBoardTerget_Index1
1396
  on messageboardterget(RecordNumber,BranchNumber);
1397

1398
-- ?f??????b?Z?[?W?{??????
1399
drop table if exists messagebrowsinghistory cascade;
1400

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

1412
-- ???}?X?^
1413
drop table if exists monthmaster cascade;
1414

1415
create table monthmaster (
1416
  month smallint(6) not null comment '??'
1417
) comment '???}?X?^' ;
1418

1419
create index month_Index1
1420
  on monthmaster(month);
1421

1422
-- ??????}?X?^
1423
drop table if exists orderersmaster cascade;
1424

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

1450
-- ????z?f?[?^
1451
drop table if exists orderspricedata cascade;
1452

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

1469
-- ?x?????F???f?[?^
1470
drop table if exists paymentapprovalinfo cascade;
1471

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

1487
-- ?x??????f?[?^
1488
drop table if exists paymentdatadetail cascade;
1489

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

1512
-- ?H??????????f?[?^
1513
drop table if exists periodavoidance cascade;
1514

1515
create table periodavoidance (
1516
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1517
  , ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
1518
  , FieldNo decimal(2,0) not null comment '?`?F?b?N???t?B?[???h???'
1519
  , EntryDate datetime not null comment '?o?^???t'
1520
  , UpdateDate datetime not null comment '?X?V???t'
1521
  , constraint periodavoidance_PKC primary key (ConstructionCode,ConstructionStatusFlg,FieldNo)
1522
) comment '?H??????????f?[?^' ;
1523

1524
create index PeriodAvoidance_Index1
1525
  on periodavoidance(ConstructionCode);
1526

1527
create index PeriodAvoidance_Index2
1528
  on periodavoidance(ConstructionStatusFlg);
1529

1530
create index PeriodAvoidance_Index3
1531
  on periodavoidance(FieldNo);
1532

1533
-- ?S??????F?f?[?^
1534
drop table if exists personapproval cascade;
1535

1536
create table personapproval (
1537
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1538
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1539
  , OrderDate date not null comment '??t??'
1540
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1541
  , SeqNo decimal(2,0) not null comment '?}??'
1542
  , PersonCodeApproval decimal(8,0) unsigned not null comment '?\???E???F??R?[?h'
1543
  , PetitionApprovalDate datetime not null comment '?\???E???F???t'
1544
  , ApprovalLimitDates datetime not null comment '???F??]??'
1545
  , ApprovalStatus decimal(1,0) not null comment '???F???'
1546
  , InputComment varchar(300) comment '?R?????g'
1547
  , EntryDate datetime not null comment '?o?^???t'
1548
  , UpdateDate datetime not null comment '?X?V???t'
1549
  , constraint personapproval_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,SeqNo)
1550
) comment '?S??????F?f?[?^' ;
1551

1552
-- ?S??????F?R?????g?f?[?^
1553
drop table if exists personapprovalcomment cascade;
1554

1555
create table personapprovalcomment (
1556
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1557
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1558
  , OrderDate date not null comment '??t??'
1559
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1560
  , CommentNo decimal(2,0) not null comment '?R?????g???'
1561
  , ParentNo decimal(2,0) not null comment '?e?R?????g???'
1562
  , ApproValComment varchar(300) comment '?w???E?A???R?????g'
1563
  , EntryDate datetime not null comment '?o?^???t'
1564
  , UpdateDate datetime not null comment '?X?V???t'
1565
  , constraint personapprovalcomment_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,CommentNo)
1566
) comment '?S??????F?R?????g?f?[?^' ;
1567

1568
-- ?S??????????}?X?^
1569
drop table if exists persondepartmentmaster cascade;
1570

1571
create table persondepartmentmaster (
1572
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1573
  , DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1574
  , AffiliationFlg decimal(1,0) not null comment '?????t???O'
1575
  , EntryDate datetime not null comment '?o?^???t'
1576
  , UpdateDate datetime not null comment '?X?V???t'
1577
  , constraint persondepartmentmaster_PKC primary key (PersonCode,DepartmentCode)
1578
) comment '?S??????????}?X?^' ;
1579

1580
create index PersonDepartmentMaster_Index1
1581
  on persondepartmentmaster(PersonCode);
1582

1583
create index PersonDepartmentMaster_Index2
1584
  on persondepartmentmaster(DepartmentCode);
1585

1586
-- ?S????}?X?^
1587
drop table if exists personinchargemaster cascade;
1588

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

1615
create index PersonInChargeMaster_Index1
1616
  on personinchargemaster(StartDate);
1617

1618
create index PersonInChargeMaster_Index2
1619
  on personinchargemaster(DepartmentCode);
1620

1621
-- ?S??????^?}?X?^
1622
drop table if exists personsalarymaster cascade;
1623

1624
create table personsalarymaster (
1625
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1626
  , StartDate date not null comment '?g?p?J?n?N????'
1627
  , MonthlySalary decimal(11,0) not null comment '???????z'
1628
  , YearSalary decimal(12,0) not null comment '?N????z'
1629
  , EntryDate datetime not null comment '?o?^???t'
1630
  , UpdateDate datetime not null comment '?X?V???t'
1631
  , constraint personsalarymaster_PKC primary key (PersonCode,StartDate)
1632
) comment '?S??????^?}?X?^' ;
1633

1634
create index PersonSalaryMaster_Index1
1635
  on personsalarymaster(PersonCode);
1636

1637
create index PersonSalaryMaster_Index2
1638
  on personsalarymaster(StartDate);
1639

1640
-- ?w???????f?[?^
1641
drop table if exists pointingoutcomment cascade;
1642

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

1662
-- ?????????????c???^?f?[?^
1663
drop table if exists proceedingsdata cascade;
1664

1665
create table proceedingsdata (
1666
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1667
  , ProceedingsDataDate date not null comment '?c???^????'
1668
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1669
  , EndMeetingTime decimal(4,0) unsigned not null comment '??c????I??'
1670
  , CreatorCode decimal(8,0) not null comment '????R?[?h'
1671
  , PalceFlag decimal(1,0) not null comment '???n?t???O'
1672
  , MeetingPalce varchar(120) comment '???????'
1673
  , EntryDate datetime not null comment '?o?^???t'
1674
  , UpdateDate datetime not null comment '?X?V???t'
1675
  , constraint proceedingsdata_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime)
1676
) comment '?????????????c???^?f?[?^' ;
1677

1678
-- ?????????????c???^?f?[?^?i?o???j
1679
drop table if exists proceedingsdataattend cascade;
1680

1681
create table proceedingsdataattend (
1682
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1683
  , ProceedingsDataDate date not null comment '?c???^????'
1684
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1685
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1686
  , Department varchar(20) comment '?o??????'
1687
  , AttendName varchar(10) comment '?o??????'
1688
  , EntryDate datetime not null comment '?o?^???t'
1689
  , UpdateDate datetime not null comment '?X?V???t'
1690
  , constraint proceedingsdataattend_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
1691
) comment '?????????????c???^?f?[?^?i?o???j' ;
1692

1693
-- ?????????????c???^?f?[?^?i????j
1694
drop table if exists proceedingsdatadetail cascade;
1695

1696
create table proceedingsdatadetail (
1697
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1698
  , ProceedingsDataDate date not null comment '?c???^????'
1699
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1700
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1701
  , TitleNo varchar(5) comment '?c????'
1702
  , Title varchar(20) comment '?c??'
1703
  , ContentsText varchar(50) comment '???e'
1704
  , EntryDate datetime not null comment '?o?^???t'
1705
  , UpdateDate datetime not null comment '?X?V???t'
1706
  , constraint proceedingsdatadetail_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
1707
) comment '?????????????c???^?f?[?^?i????j' ;
1708

1709
-- ???F?f?[?^
1710
drop table if exists processapproval cascade;
1711

1712
create table processapproval (
1713
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1714
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1715
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1716
  , SeqNo decimal(2,0) not null comment '?}??'
1717
  , PersonCode decimal(8,0) unsigned not null comment '?\???E???F??R?[?h'
1718
  , PetitionApprovalDate datetime not null comment '?\???E???F???t'
1719
  , ApprovalLimitDates datetime not null comment '???F??]??'
1720
  , ApprovalStatus decimal(1,0) not null comment '???F???'
1721
  , InputComment varchar(300) comment '?R?????g'
1722
  , EntryDate datetime not null comment '?o?^???t'
1723
  , UpdateDate datetime not null comment '?X?V???t'
1724
  , constraint processapproval_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SeqNo)
1725
) comment '???F?f?[?^' ;
1726

1727
-- ???F?R?????g?f?[?^
1728
drop table if exists processapprovalcomment cascade;
1729

1730
create table processapprovalcomment (
1731
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1732
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1733
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1734
  , CommentNo decimal(2,0) not null comment '?R?????g???'
1735
  , ParentNo decimal(2,0) not null comment '?e?R?????g???'
1736
  , ApproValComment varchar(300) comment '?w???E?A???R?????g'
1737
  , EntryDate datetime not null comment '?o?^???t'
1738
  , UpdateDate datetime not null comment '?X?V???t'
1739
  , constraint processapprovalcomment_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,CommentNo)
1740
) comment '???F?R?????g?f?[?^' ;
1741

1742
-- ???F????f?[?^
1743
drop table if exists processapprovaldetail cascade;
1744

1745
create table processapprovaldetail (
1746
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1747
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1748
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1749
  , SerialNo decimal(2,0) unsigned not null comment '?}??'
1750
  , LinkCode decimal(10,0) not null comment '?????N???'
1751
  , EntryDate datetime not null comment '?o?^???t'
1752
  , UpdateDate datetime not null comment '?X?V???t'
1753
  , constraint processapprovaldetail_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SerialNo)
1754
) comment '???F????f?[?^' ;
1755

1756
-- ?N?????}?X?^
1757
drop table if exists processexcutemaster cascade;
1758

1759
create table processexcutemaster (
1760
  SecCode decimal(2,0) unsigned not null comment '???????'
1761
  , ExecCode decimal(4,0) unsigned not null comment '?N?????????'
1762
  , EditFlg decimal(1,0) not null comment '??W?t???O'
1763
  , EntryDate datetime not null comment '?o?^???t'
1764
  , UpdateDate datetime not null comment '?X?V???t'
1765
  , constraint processexcutemaster_PKC primary key (SecCode,ExecCode)
1766
) comment '?N?????}?X?^' ;
1767

1768
create index ProcessExcuteMaster_Index1
1769
  on processexcutemaster(SecCode);
1770

1771
create index ProcessExcuteMaster_Index2
1772
  on processexcutemaster(ExecCode);
1773

1774
-- ???????f?[?^
1775
drop table if exists purchaseorder cascade;
1776

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

1810
-- ?????????t?f?[?^
1811
drop table if exists purchaseorderdate cascade;
1812

1813
create table purchaseorderdate (
1814
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1815
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1816
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1817
  , SendDate date not null comment '???????X????'
1818
  , ReturnDate date not null comment '???????????'
1819
  , ReturnCheckDate date not null comment '??????????m?F??'
1820
  , EntryDate datetime not null comment '?o?^???t'
1821
  , UpdateDate datetime not null comment '?X?V???t'
1822
  , constraint purchaseorderdate_PKC primary key (ConstructionCode,SeqNo)
1823
) comment '?????????t?f?[?^' ;
1824

1825
-- ??????????f?[?^
1826
drop table if exists purchaseorderdetail cascade;
1827

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

1849
create index POrderDetail_Index1
1850
  on purchaseorderdetail(SourceCode);
1851

1852
-- ?????f?[?^
1853
drop table if exists requestdata cascade;
1854

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

1877
-- ?????f?[?^????
1878
drop table if exists requestdatadetail cascade;
1879

1880
create table requestdatadetail (
1881
  REQUESTNO decimal(9,0) not null comment '????No'
1882
  , MAINCONSTRUCTIONCODE decimal(10,0) not null comment '?{?H?????'
1883
  , CONSTRUCTIONCODE decimal(10,0) not null comment '?H?????'
1884
  , CONSTRUCTIONKIND decimal(1,0) not null comment '?H????'
1885
  , REQUESTAMOUNT decimal(10,0) not null comment '???????z'
1886
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1887
  , ENTRYDATE datetime not null comment '?o?^?N????'
1888
  , UPDATEDATE datetime not null comment '?X?V?N????'
1889
  , constraint requestdatadetail_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE,CONSTRUCTIONCODE,CONSTRUCTIONKIND)
1890
) comment '?????f?[?^????' ;
1891

1892
-- ?????w?b?_
1893
drop table if exists requesthead cascade;
1894

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

1916
alter table requesthead add unique REQCONSTRUCTIONCODE (REQCONSTRUCTIONCODE,ORDERNO) ;
1917

1918
-- ?????????t?f?[?^
1919
drop table if exists requestorderdate cascade;
1920

1921
create table requestorderdate (
1922
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1923
  , InvoiceNo decimal(9,0) not null comment '??????No'
1924
  , SendDate date not null comment '???????????X????'
1925
  , EntryDate datetime not null comment '?o?^???t'
1926
  , UpdateDate datetime not null comment '?X?V???t'
1927
  , constraint requestorderdate_PKC primary key (ConstructionCode,InvoiceNo)
1928
) comment '?????????t?f?[?^' ;
1929

1930
-- ????O???t?f?[?^
1931
drop table if exists salesgraphdata cascade;
1932

1933
create table salesgraphdata (
1934
  GraphDataCode decimal(8,0) not null comment '?O???t?f?[?^?R?[?h'
1935
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
1936
  , SalesDataDays date not null comment '????N??'
1937
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
1938
  , DataName varchar(100) not null comment '?f?[?^?\??????'
1939
  , SalesAmount decimal(10,0) not null comment '????f?[?^'
1940
  , AdministrativeExpense decimal(10,0) not null comment '???E?????o??'
1941
  , GrossProfit decimal(10,0) not null comment '?e???v'
1942
  , NetIncome decimal(10,0) not null comment '?????v(???v)'
1943
  , EntryDate datetime not null comment '?o?^???t'
1944
  , UpdateDate datetime not null comment '?X?V???t'
1945
  , constraint salesgraphdata_PKC primary key (GraphDataCode,ConstructionPeriod,SalesDataDays)
1946
) comment '????O???t?f?[?^' ;
1947

1948
create index SalesGraphData_Idx1
1949
  on salesgraphdata(DisplayOrder);
1950

1951
create index SalesGraphData_idx2
1952
  on salesgraphdata(ConstructionPeriod);
1953

1954
-- ?????}?X?^
1955
drop table if exists securitymaster cascade;
1956

1957
create table securitymaster (
1958
  SecCode decimal(2,0) unsigned not null comment '???????'
1959
  , DisplayOrder decimal(2,0) not null comment '?\????'
1960
  , SecName varchar(60) not null comment '????????'
1961
  , SecRank decimal(1,0) not null comment '?????????N'
1962
  , SecRange decimal(1,0) not null comment '???????'
1963
  , GeneralAffairs decimal(1,0) not null comment '????????t???O'
1964
  , SelectBackColor varchar(8) not null comment '?I??w?i?F'
1965
  , EntryDate datetime not null comment '?o?^???t'
1966
  , UpdateDate datetime not null comment '?X?V???t'
1967
  , constraint securitymaster_PKC primary key (SecCode)
1968
) comment '?????}?X?^' ;
1969

1970
create index SecurityMaster_Index1
1971
  on securitymaster(DisplayOrder);
1972

1973
create index SecurityMaster_Index2
1974
  on securitymaster(SecRank);
1975

1976
create index SecurityMaster_Index3
1977
  on securitymaster(SecRange);
1978

1979
-- ???S?p?g???[???f?[?^
1980
drop table if exists sfpdata cascade;
1981

1982
create table sfpdata (
1983
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1984
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
1985
  , RequestDate datetime not null comment '?p?g???[???v??????'
1986
  , PersonCode decimal(8,0) unsigned not null comment '?\????R?[?h'
1987
  , StringValue varchar(300) comment '?R?????g'
1988
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
1989
  , EntryDate datetime not null comment '?o?^???t'
1990
  , UpdateDate datetime not null comment '?X?V???t'
1991
  , constraint sfpdata_PKC primary key (ConstructionCode,DataCount)
1992
) comment '???S?p?g???[???f?[?^' ;
1993

1994
create index SFPData_Index1
1995
  on sfpdata(RequestDate);
1996

1997
-- ???S?p?g???[??????f?[?^
1998
drop table if exists sfpdatadetail cascade;
1999

2000
create table sfpdatadetail (
2001
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
2002
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
2003
  , SeqNo decimal(2,0) unsigned not null comment '?f?[?^?}??'
2004
  , CompanyCode decimal(8,0) unsigned not null comment '??????R?[?h'
2005
  , EntryDate datetime not null comment '?o?^???t'
2006
  , UpdateDate datetime not null comment '?X?V???t'
2007
  , constraint sfpdatadetail_PKC primary key (ConstructionCode,DataCount,SeqNo)
2008
) comment '???S?p?g???[??????f?[?^' ;
2009

2010
-- ??????{?H?H??o?^?\???f?[?^
2011
drop table if exists subconstrjobitemregist cascade;
2012

2013
create table subconstrjobitemregist (
2014
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2015
  , CreateDate date not null comment '????'
2016
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2017
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2018
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2019
  , EntryDate datetime not null comment '?o?^???t'
2020
  , UpdateDate datetime not null comment '?X?V???t'
2021
  , constraint subconstrjobitemregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
2022
) comment '??????{?H?H??o?^?\???f?[?^' ;
2023

2024
-- ??????E?????N?o?^?\???f?[?^
2025
drop table if exists subconstrjoblinkregist cascade;
2026

2027
create table subconstrjoblinkregist (
2028
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2029
  , CreateDate date not null comment '????'
2030
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2031
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2032
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
2033
  , EntryDate datetime not null comment '?o?^???t'
2034
  , UpdateDate datetime not null comment '?X?V???t'
2035
  , constraint subconstrjoblinkregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
2036
) comment '??????E?????N?o?^?\???f?[?^' ;
2037

2038
-- ??????o?^?\???f?[?^
2039
drop table if exists subconstrregist cascade;
2040

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

2073
-- ??????H??}?X?^
2074
drop table if exists subcontractoritemmaster cascade;
2075

2076
create table subcontractoritemmaster (
2077
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2078
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2079
  , ItemName varchar(120) not null comment '?H????'
2080
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2081
  , EntryDate datetime not null comment '?o?^???t'
2082
  , UpdateDate datetime not null comment '?X?V???t'
2083
  , constraint subcontractoritemmaster_PKC primary key (ItemCode)
2084
) comment '??????H??}?X?^' ;
2085

2086
-- ??????E??}?X?^
2087
drop table if exists subcontractorjobcategory cascade;
2088

2089
create table subcontractorjobcategory (
2090
  JobCategoryCode decimal(5,0) not null comment '?E??L?['
2091
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2092
  , JobCategoryName varchar(120) not null comment '?E????'
2093
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2094
  , EntryDate datetime not null comment '?o?^???t'
2095
  , UpdateDate datetime not null comment '?X?V???t'
2096
  , constraint subcontractorjobcategory_PKC primary key (JobCategoryCode)
2097
) comment '??????E??}?X?^' ;
2098

2099
-- ??????{?H?H??f?[?^
2100
drop table if exists subcontractorjobitem cascade;
2101

2102
create table subcontractorjobitem (
2103
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2104
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2105
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2106
  , EntryDate datetime not null comment '?o?^???t'
2107
  , UpdateDate datetime not null comment '?X?V???t'
2108
  , constraint subcontractorjobitem_PKC primary key (CompanyCode,ItemCode)
2109
) comment '??????{?H?H??f?[?^' ;
2110

2111
create index SubContractorJobItem_Index1
2112
  on subcontractorjobitem(CompanyCode);
2113

2114
create index SubContractorJobItem_Index2
2115
  on subcontractorjobitem(ItemCode);
2116

2117
-- ??????E?????N?}?X?^
2118
drop table if exists subcontractorjoblink cascade;
2119

2120
create table subcontractorjoblink (
2121
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2122
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
2123
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2124
  , EntryDate datetime not null comment '?o?^???t'
2125
  , UpdateDate datetime not null comment '?X?V???t'
2126
  , constraint subcontractorjoblink_PKC primary key (CompanyCode,JobCategoryCode)
2127
) comment '??????E?????N?}?X?^' ;
2128

2129
create index SubContractorJobLink_Index1
2130
  on subcontractorjoblink(CompanyCode);
2131

2132
create index SubContractorJobLink_Index2
2133
  on subcontractorjoblink(JobCategoryCode);
2134

2135
-- ??????}?X?^
2136
drop table if exists subcontractormaster cascade;
2137

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

2165
create index SubContractorMaster_Index1
2166
  on subcontractormaster(JapaneseSyllabary);
2167

2168
-- ?d????}?X?^
2169
drop table if exists suppliersmaster cascade;
2170

2171
create table suppliersmaster (
2172
  SuppliersCode decimal(5,0) unsigned not null comment '?d????R?[?h'
2173
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2174
  , SuppliersName1 varchar(60) not null comment '?d????1'
2175
  , SuppliersName2 varchar(60) comment '?d?????Q'
2176
  , ZipCode varchar(8) comment '?X????'
2177
  , Address1 varchar(60) comment '?Z???P'
2178
  , Address2 varchar(60) comment '?Z??2'
2179
  , Address3 varchar(60) comment '?Z??3'
2180
  , PhoneNumber varchar(13) comment '?d?b???'
2181
  , FaxNumber varchar(13) comment 'FAX???'
2182
  , Note varchar(300) comment '???l'
2183
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2184
  , EntryDate datetime not null comment '?o?^???t'
2185
  , UpdateDate datetime not null comment '?X?V???t'
2186
  , constraint suppliersmaster_PKC primary key (SuppliersCode)
2187
) comment '?d????}?X?^' ;
2188

2189
-- ?V?X?e???N???m?F?f?[?^
2190
drop table if exists systemexecute cascade;
2191

2192
create table systemexecute (
2193
  PrimaryCode tinyint(4) not null comment '?L?[????'
2194
  , TargetDate date not null comment '?N?????t'
2195
  , SystemVersion int(11) not null comment '?{??E????o?[?W????'
2196
  , UpDateCopyVersion int(11) not null comment '?R?s?[?o?[?W????'
2197
  , EntryDate datetime not null comment '?o?^???t'
2198
  , UpdateDate datetime not null comment '?X?V???t'
2199
  , constraint systemexecute_PKC primary key (PrimaryCode)
2200
) comment '?V?X?e???N???m?F?f?[?^' ;
2201

2202
-- ????}?X?^
2203
drop table if exists systemmaster cascade;
2204

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

2240
-- ?????}?X?^
2241
drop table if exists termmaster cascade;
2242

2243
create table termmaster (
2244
  ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
2245
  , FieldNo decimal(2,0) not null comment '?`?F?b?N???t?B?[???h???'
2246
  , SeqNo decimal(2,0) not null comment '?}??'
2247
  , DisplayOrder decimal(2,0) not null comment '?\????'
2248
  , CheckSchdule decimal(1,0) not null comment '?`?F?b?N?^?C?~???O'
2249
  , TermDays decimal(3,0) not null comment '?o???'
2250
  , SendTitile varchar(100) comment '?^?C?g??'
2251
  , SendMessage varchar(100) comment '???b?Z?[?W'
2252
  , BackColor varchar(8) comment '?w?i?F'
2253
  , ForeColor varchar(8) comment '?????F'
2254
  , EntryDate datetime not null comment '?o?^???t'
2255
  , UpdateDate datetime not null comment '?X?V???t'
2256
  , constraint termmaster_PKC primary key (ConstructionStatusFlg,FieldNo,SeqNo)
2257
) comment '?????}?X?^' ;
2258

2259
create index TermMaster_Index1
2260
  on termmaster(DisplayOrder);
2261

2262
-- ?o?????f?[?^
2263
drop table if exists tranceportdailydata cascade;
2264

2265
create table tranceportdailydata (
2266
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
2267
  , AttendanceDate date not null comment '???????'
2268
  , StartDistance decimal(7,1) not null comment '?????o???L????'
2269
  , ComplateDistance decimal(7,1) not null comment '?????I???L????'
2270
  , TotalDistance decimal(6,1) not null comment '???????v?L????'
2271
  , OfficeGoFlg decimal(1,0) not null comment '???????o??t???O'
2272
  , OfficeOutFlg decimal(1,0) not null comment '???????A??t???O'
2273
  , TrancePayGoFlg decimal(1,0) not null comment '?L?????o??t???O'
2274
  , TrancePayOutFlg decimal(1,0) not null comment '?L?????A??t???O'
2275
  , WareHouseFlg decimal(1,0) not null comment '????u??t???O'
2276
  , EntryDate datetime not null comment '?o?^???t'
2277
  , UpdateDate datetime not null comment '?X?V???t'
2278
  , constraint tranceportdailydata_PKC primary key (PersonCode,AttendanceDate)
2279
) comment '?o?????f?[?^' ;
2280

2281
create index TranceportDailyData_Index1
2282
  on tranceportdailydata(AttendanceDate);
2283

2284
-- ?H?????o???}?X?^
2285
drop table if exists typeexpensesmaster cascade;
2286

2287
create table typeexpensesmaster (
2288
  TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
2289
  , ExpensesPeriod smallint(6) not null comment '?????'
2290
  , NameCode decimal(5,0) unsigned not null comment '?o????R?[?h'
2291
  , ExpensesRaito decimal(4,2) not null comment '?o??'
2292
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2293
  , EntryDate datetime not null comment '?o?^???t'
2294
  , UpdateDate datetime not null comment '?X?V???t'
2295
  , constraint typeexpensesmaster_PKC primary key (TypeCode,ExpensesPeriod,NameCode)
2296
) comment '?H?????o???}?X?^' ;
2297

2298
-- ?P??}?X?^
2299
drop table if exists unitmaster cascade;
2300

2301
create table unitmaster (
2302
  UnitKey decimal(5,0) unsigned not null comment '?P??L?['
2303
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2304
  , UnitName varchar(30) not null comment '?P?????'
2305
  , EntryDate datetime not null comment '?o?^???t'
2306
  , UpdateDate datetime not null comment '?X?V???t'
2307
  , constraint unitmaster_PKC primary key (UnitKey)
2308
) comment '?P??}?X?^' ;
2309

2310
create index UnitMaster_Index1
2311
  on unitmaster(DisplayOrder);
2312

2313
-- ????}?X?^
2314
drop table if exists vehiclemaster cascade;
2315

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

2342
-- ????L?^?f?[?^
2343
drop table if exists vehiclerecorddata cascade;
2344

2345
create table vehiclerecorddata (
2346
  VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2347
  , DivisionCode decimal(2,0) unsigned not null comment '?f?[?^??'
2348
  , SeqNo decimal(2,0) not null comment '?}??'
2349
  , RecordDate date comment '???n??'
2350
  , Mileage mediumint(9) comment '???s????'
2351
  , Content varchar(100) comment '???e'
2352
  , PaymentCost decimal(10,0) comment '??p'
2353
  , EntryDate datetime not null comment '?o?^???t'
2354
  , UpdateDate datetime not null comment '?X?V???t'
2355
  , constraint vehiclerecorddata_PKC primary key (VehicleCode,DivisionCode,SeqNo)
2356
) comment '????L?^?f?[?^' ;
2357

2358
-- ????\??f?[?^
2359
drop table if exists vehiclescheduledata cascade;
2360

2361
create table vehiclescheduledata (
2362
  TargetDate date not null comment '????'
2363
  , VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2364
  , MorningAfternoon decimal(1,0) not null comment '??O?E???'
2365
  , PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
2366
  , TargetYear year(4) not null comment '?Y???N'
2367
  , TargetMonth tinyint(3) unsigned not null comment '?Y????'
2368
  , TargetDay year(4) not null comment '?Y????'
2369
  , EntryDate datetime not null comment '?o?^???t'
2370
  , UpdateDate datetime not null comment '?X?V???t'
2371
  , constraint vehiclescheduledata_PKC primary key (TargetDate,VehicleCode,MorningAfternoon)
2372
) comment '????\??f?[?^' ;
2373

2374
create index VehicleScheduleData_Index1
2375
  on vehiclescheduledata(TargetYear);
2376

2377
create index VehicleScheduleData_Index2
2378
  on vehiclescheduledata(TargetMonth);
2379

2380
create index VehicleScheduleData_Index3
2381
  on vehiclescheduledata(TargetDay);
2382

2383
-- ?N?}?X?^
2384
drop table if exists yearmaster cascade;
2385

2386
create table yearmaster (
2387
  years smallint(6) not null comment '?N'
2388
) comment '?N?}?X?^' ;
2389

2390
create index year_Index1
2391
  on yearmaster(years);
2392